Mattias EngdegÄrd writes: > Obviously the claim to guarantee a solution for "any initial guess" is > fanciful. Yes. See attached patch for what I wish the docs had said all along (would have saved me a lot of time). > Unfortunately straight Newton won't converge for this function (erf, > essentially) if you stray too far from the origin (ie, the mean) so I > suggest you always use that as a starting guess no matter what point > you are trying to find the inverse for. > > Another way is to use an interval as starting guess instead of a > single point; that seems to make Calc switch tactics and persevere. I wonder if the implementation can be improved. https://www.gnu.org/software/emacs/manual/html_node/calc/Root-Finding.html suggests that there are some cases where calc will switch over to the bisection method. Perhaps the heuristics can be tweaked? > One thing that can happen is running out of stack, because many of the > implementations like math-newton-root are recursive. This should be > easy to remedy as they all seem to be tail calls. Good to know.