-
Notifications
You must be signed in to change notification settings - Fork 25
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
Error computing j′vp of a scalar -> matrix function #80
Comments
Maybe part of what is going on here is that the output type of julia> x^3.0
2×2 Array{Float64,2}:
37.0 54.0
81.0 118.0
julia> x^(3.0+sqrt(eps()))
2×2 Array{Complex{Float64},2}:
37.0-1.83838e-9im 54.0+8.40924e-10im
81.0+1.26139e-9im 118.0-5.76992e-10im |
Actually, I'm not convinced anymore that this is a bug. This works julia> j′vp(fdm, p -> complex(x)^real(p), complex(seed), complex(3.0))
(487.58111835736804 - 4.440892098500626e-14im,)
julia> j′vp(fdm, p -> complex(x)^imag(p), complex(seed), complex(3.0))
(8.326672684688674e-16 + 3.0165251948230645im,) where I've made sure the |
Hi Seth. Yes, this is almost certainly what's going on. The doubling of the dimensionality is being caused by the output type being complex for non-integer exponent. I'm not entirely sure what to do about this if I'm completely honest. From Just to be up-front, unless I'm missing something and it's actually really easy to fix this corner case, it's probably going to take a long time for us to implement a solution to this particular problem. edit: I wrote this before seeing your last comment. I suspect that we came to similar conclusions about what's going on. |
even if not making changes, may still warrant a mention in the docs as a "gotcha"? |
Can we detect this case, or a subset of this case, and throw a clearer error? |
Definitely.
We can definitely do something here. A simple option would be to highlight that
Additionally, it's currently not completely straightforward to figure out exactly what inputs |
I can't compute the
j′vp
for the functionp -> x^p
on FiniteDifferences v0.10.0, wherex
is a matrix andp
is a scalar:The text was updated successfully, but these errors were encountered: