Skip to main content
9 events
when toggle format what by license comment
Nov 21, 2020 at 9:00 history tweeted twitter.com/StackSciComp/status/1330073501294862338
Nov 20, 2020 at 9:20 answer added MPIchael timeline score: 2
Nov 20, 2020 at 2:08 answer added Maxim Umansky timeline score: 3
Nov 19, 2020 at 22:29 comment added Laurent90 Actually troubles appear when $|z|>15$, which is already better than with the method you showcased. Then the value of $f$ is 0 up to machine precision therefore the computation yields 0/0=NaN. I think the only way to overcome this is to use analytical formulae, or maybe automatic differentiation can do the trick as well.
Nov 19, 2020 at 22:15 comment added Laurent90 Maybe I still did not get it, but I've tried your example with finite differences or complex step, and it works like a charm... What's the method that gave the erratic result from your post ?
Nov 19, 2020 at 21:03 comment added Hamilcar I almost achieve machine precision, the problem is that at some magnitude the function value gets close to machine precision and that's the point where the problems start (see in the first figure, where the high oscillations start) since the error is now of the same magnitude as the function value.
Nov 19, 2020 at 19:35 comment added Laurent90 I am not sure I get this right, but if you only need the value of this derivative on a set of discrete points, you can try finite differences (which may not work if your function is really not "well behaved"), or complex step, which is an extension of the finite difference method, but with a complex perturbation instead, allowing to reach machine accuracy for the pointwise estimation of the derivative of a real function. If that suits your need, I can link you to some references. You can also try automatic differentiation maybe.
Nov 19, 2020 at 19:20 review First posts
Nov 20, 2020 at 23:30
Nov 19, 2020 at 19:16 history asked Hamilcar CC BY-SA 4.0