Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd behavior for for simple user defined functions #68

Closed
CaptainKubi opened this issue Dec 13, 2023 · 3 comments
Closed

Odd behavior for for simple user defined functions #68

CaptainKubi opened this issue Dec 13, 2023 · 3 comments

Comments

@CaptainKubi
Copy link

The derivative function behaves really odd for simple user defined function.
If I define two simple functions as follows

julia> f(x) = x*x
julia> h(x) = x^2

then the first order derivatives a 0.0 only gives the correct result for f(x).

julia> derivative(f, 0.0, 1)
0.0
julia> derivative(h, 0.0, 1)
NaN

Oddly, if the derivative is evaluated at 1.0 both functions work as expected.

julia> derivative(f, 1.0, 1)
2.0
julia> derivative(h, 1.0,1)
2.0

I tested this on v0.2.1.

I was hoping to use TaylorDiff to calculate higher order derivatives for Sellmeier Equations. But it also seems to fail for these in a not easy to understand way.

@CaptainKubi
Copy link
Author

This apparantly was already addressed in #33.
However it seems it is not part of the currently available latest version.

@lrnv
Copy link
Contributor

lrnv commented Mar 7, 2024

Also this one: #61

@tansongchen
Copy link
Member

0.2.2 contains the fix and would be good for these functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants