Re: Root finding needs higher accuracy

*To*: mathgroup at smc.vnet.net*Subject*: [mg123221] Re: Root finding needs higher accuracy*From*: Dana DeLouis <dana01 at me.com>*Date*: Sun, 27 Nov 2011 04:13:24 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com

> This problem is known to be difficult for solvers in double precision Hi. As a side note, look at the Newton version of the equation. f[x_]:=x^2/(2 E^1)-(2 x)/Sqrt[E^1]+Log[x]+1 x-f[x]/f'[x] //FullSimplify (x (x^2-2 E Log[x])) / (2 (Sqrt[E]-x)^2) Notice that as the next guess (x) approaches Sqrt[E], then the next guess approaches infinity, as the denominator goes to zero. I think this explains why this is a hard problem, especially at machine precision. So, my First guess would be Sqrt[E] using limits instead. Limit[%,x->Sqrt[E]] Sqrt[E] Lucky guess! ;>0 It happens to be the solution. = = = = = = = = = = = = = = HTH Dana DeLouis Mac, Ver 8 = = = = = = = = = = = = = = On Nov 24, 7:04 am, HwB <hwborch... at googlemail.com> wrote: > I would like to numerically find the root of the following function > with up to 20 digits. > > f12[x_] := Log[x] + x^2 / (2 Exp[1]) - 2 x / Sqrt[Exp[1]] + 1 > > This problem is known to be difficult for solvers in double precision > arithmetics. I thought it should be easy with Mathematica, but the > following attempts were not successful. > > SetPrecision[ > x /. FindRoot[f12[x], {x, 1.0, 3.4}, Method -> "Brent", > AccuracyGoal -> Infinity, PrecisionGoal -> 20], 16] > # 1.648732212532746 > SetPrecision[ > x /. FindRoot[f12[x], {x, 1.0, 3.4}, Method -> "Secant", > AccuracyGoal -> Infinity, PrecisionGoal -> 20], 16] > # 1.648710202030051 > > The true root obviously is Sqrt[Exp[1]]//N = 1.648721270700128... > > The symbolic solver explicitely says it cannot solve this expression. > What do I need to do to get a much more exact result out of > Mathematica? > > Many thanks, Hans Werner