JuliaDiff / TaylorDiff.jl

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

Erf support shouldn't convert pi to Float64. #55

Closed rcalxrc08 closed 1 year ago

rcalxrc08 commented 1 year ago

In case of BigFloat the derivative is losing a lot of precision. Related to #48.

rcalxrc08 commented 1 year ago

I can add a dependency on IrrationalConstants in order to automatically support this

tansongchen commented 1 year ago

Thanks for that comment. I am thinking of moving the support for SpecialFunctions to an extension so that additional dependencies don't need to be loaded if user doesn't need them. I will open a pr for that

tansongchen commented 1 year ago

Nevermind, I think the extension infrastructure doesn't work for our package... Fixed in #56

rcalxrc08 commented 1 year ago

Not really solved, 2/sqrtpi is a Float64. And maybe you can directly use the inverse of sqrtpi.

tansongchen commented 1 year ago

Not really solved, 2/sqrtpi is a Float64. And maybe you can directly use the inverse of sqrtpi.

Oh OK. I am not very familiar with BigFloats, so before I try that, could you provide a test case where I can verify if TaylorDiff.jl is losing precision?

rcalxrc08 commented 1 year ago

Actually I think it is solved! I got confused about the precedence of d=abc. Thanks!!