3 ms·
This seems off: >> f(x) = x^2 >> f''(4) 0.9995297887
by Bootvis 5y ago
This seems off:
>> f(x) = x^2
>> f''(4)
0.9995297887
- paddim8 5y agoOh yeah, derivatives of higher order being less accurate is a known problem. I forgot to specify that, thanks!
- Bootvis 5y agoMaybe best to just disable it for now, I played with e^x as well and the results were off as well. Ignoring these, I really like Kalk!
- paddim8 5y agoThank you! Yeah, or at least give a warning.
- whiterock 5y agolook into Dual numbers. That way there is no accuracy loss. More generally look into AD (automatic differentiation). thanks me later, cheers
- longemen3000 5y agoMaybe the derivation could be done by the complex step trick, if programing an AD system is too hard
- onhn 5y agoNote that if f(x) = x^2 then the second derivative f''(x) = 2, so it looks like you're off by a factor of 2 (as well as the accuracy issue).
- deleted 5y ago[deleted]