Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6721
| From | "Harvey P. Dale" <hpd1@nyu.edu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Root finding needs higher accuracy |
| Date | 2011-11-25 10:01 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <janp1g$b2h$1@smc.vnet.net> (permalink) |
| References | <201111241157.GAA29024@smc.vnet.net> |
Hans:
The option you need is WorkingPrecision.
FindRoot[Log[x]+x^2/(2 Exp[1])-2
x/Sqrt[Exp[1]]+1==0,{x,1},WorkingPrecision->50]
Best,
Harvey
-----Original Message-----
From: HwB [mailto:hwborchers@googlemail.com]
Sent: Thursday, November 24, 2011 6:57 AM
Subject: Root finding needs higher accuracy
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Root finding needs higher accuracy "Harvey P. Dale" <hpd1@nyu.edu> - 2011-11-25 10:01 +0000
csiph-web