JuliaDiff / TaylorDiff.jl

Taylor-mode automatic differentiation for higher-order derivatives
https://juliadiff.org/TaylorDiff.jl/
MIT License
73 stars 8 forks source link

^ is not equivalent to * for positive integer exponents in zero. #54

Closed rcalxrc08 closed 1 year ago

rcalxrc08 commented 1 year ago
using TaylorDiff
x=TaylorScalar(0.0,1.0)
y_2=x^2
@assert isnan(TaylorDiff.extract_derivative(y_2,2))
y_1=x^1
@assert isnan(TaylorDiff.extract_derivative(y_1,2))

This doesn't happen in case of *

x=TaylorScalar(0.0,1.0)
y_2=x*x
@assert !isnan(TaylorDiff.extract_derivative(y_2,2))
y_4=x*x*x*x
@assert !isnan(TaylorDiff.extract_derivative(y_4,2))
rcalxrc08 commented 1 year ago

I am sorry this is a duplicate of #33