@@ -360,14 +360,14 @@ end
360360 end
361361 end
362362 # @inbounds c[k] = c[k] / (kprime * a[l0])
363- aux2 = zero (c[k])
364- for j in eachindex (a[l0])
365- zero! (aux[k], j)
366- mul! (aux[k], kprime, a[l0], j)
367- identity! (aux2, c[k], j)
363+ @inbounds for j in eachindex (c[k])
364+ identity! (aux[k], c[k], j)
368365 end
369- for j in eachindex (a[l0])
370- div! (c[k], aux2, aux[k], j)
366+ @inbounds for j in eachindex (a[l0])
367+ div! (c[k], aux[k], a[l0], j)
368+ end
369+ @inbounds for j in eachindex (a[l0])
370+ div! (c[k], c[k], kprime, j)
371371 end
372372 return nothing
373373end
432432 end
433433 return nothing
434434end
435- @inline function sqr_orderzero! (c:: Taylor1{T} , a:: Taylor1{T } ) where
436- {T<: AbstractSeries }
435+ @inline function sqr_orderzero! (c:: Taylor1{Taylor1{T}} , a:: Taylor1{Taylor1{T} } ) where
436+ {T<: Number }
437437 @inbounds for ord in eachindex (c[0 ])
438438 sqr! (c[0 ], a[0 ], ord)
439439 end
553553 return nothing
554554end
555555
556- @inline function sqr! (c:: Taylor1{Taylor1{T}} , a:: Taylor1{Taylor1{T}} , k :: Int ) where
557- {T<: NumberNotSeriesN }
556+ @inline function sqr! (c:: Taylor1{Taylor1{T}} , a:: Taylor1{Taylor1{T}} ,
557+ k :: Int ) where {T<: NumberNotSeriesN }
558558 if k == 0
559559 sqr_orderzero! (c, a)
560560 return nothing
@@ -702,7 +702,8 @@ coefficient, which must be even.
702702
703703""" sqrt!
704704
705- @inline function sqrt! (c:: Taylor1{T} , a:: Taylor1{T} , k:: Int , k0:: Int = 0 ) where {T<: Number }
705+ @inline function sqrt! (c:: Taylor1{T} , a:: Taylor1{T} , k:: Int , k0:: Int = 0 ) where
706+ {T<: NumberNotSeries }
706707 k < k0 && return nothing
707708 if k == k0
708709 @inbounds c[k] = sqrt (a[2 * k0])
@@ -728,7 +729,8 @@ coefficient, which must be even.
728729 return nothing
729730end
730731
731- @inline function sqrt! (c:: TaylorN{T} , a:: TaylorN{T} , k:: Int ) where {T<: NumberNotSeriesN }
732+ @inline function sqrt! (c:: TaylorN{T} , a:: TaylorN{T} , k:: Int ) where
733+ {T<: NumberNotSeriesN }
732734
733735 if k == 0
734736 @inbounds c[0 ][1 ] = sqrt ( constant_term (a) )
800802 return nothing
801803end
802804
803- @inline function sqrt! (c:: Taylor1{Taylor1{T}} , a:: Taylor1{Taylor1{T}} , k:: Int , k0:: Int = 0 ) where {T<: Number }
805+ @inline function sqrt! (c:: Taylor1{Taylor1{T}} , a:: Taylor1{Taylor1{T}} , k:: Int ,
806+ k0:: Int = 0 ) where {T<: Number }
804807 k < k0 && return nothing
805808 if k == k0
806809 @inbounds c[k] = sqrt (a[2 * k0])
@@ -834,10 +837,14 @@ end
834837 end
835838 end
836839 # @inbounds c[k] = c[k] / (2*c[k0])
840+ @inbounds for j in eachindex (c[k])
841+ identity! (aux, c[k], j)
842+ end
837843 @inbounds for j in eachindex (c[k0])
838- zero! (aux, j)
839- mul! (aux, 2 , c[k0], j)
844+ div! (c[k], aux, c[k0], j)
845+ end
846+ @inbounds for j in eachindex (c[k0])
847+ div! (c[k], c[k], 2 , j)
840848 end
841- c[k] = c[k] / aux
842849 return nothing
843850end
0 commit comments