Prev: Can't get Mathematica to evaluate correctly a difficult expression
Next: Can't get Mathematica to evaluate correctly a
From: Niels R. Walet on 4 Aug 2010 07:34 Damien Wyart wrote: > Hello, > > I am using Mathematica 7.0.2 and playing a bit with an expression > analyzed in the following paper: > http://www.loria.fr/~zimmerma/papers/cise.pdf > > I tried many constructions with N and SetPrecision and can't get > Mathematica to output the correct result (I am not very experienced with > Mathematica). Here is the expression : > > 173746*Sin[10^22]+94228*Log[17.1]-78487*Exp[0.42] > > The correct result should be -1.341818958*10^-12 but even forcing each > term with N and a very large number, I am still not getting this value > at all. > > > Any help will be appreciated. Thanks in advance ; best regards, > > Use 30 digit precision on the reals: 173746*Sin[10^(22)]+94228*Log[17.1`30]-78487*Exp[0.42`30] -1.341818957830*10^-12 -- Prof. Niels R. Walet Phone: +44(0)1613063693 School of Physics and Astronomy Fax: +44(0)1613064303 The University of Manchester Mobile: +44(0)7905438934 Manchester, M13 9PL, UK room 7.7, Schuster Building email: Niels.Walet(a)manchester.ac.uk web: http://www.theory.physics.manchester.ac.uk/~mccsnrw
From: Peter Pein on 4 Aug 2010 07:52 Am Wed, 4 Aug 2010 09:51:49 +0000 (UTC) schrieb Damien Wyart <damien.wyart(a)free.fr>: > Hello, > > I am using Mathematica 7.0.2 and playing a bit with an expression > analyzed in the following paper: > http://www.loria.fr/~zimmerma/papers/cise.pdf > > I tried many constructions with N and SetPrecision and can't get > Mathematica to output the correct result (I am not very experienced > with Mathematica). Here is the expression : > > 173746*Sin[10^22]+94228*Log[17.1]-78487*Exp[0.42] > > The correct result should be -1.341818958*10^-12 but even forcing each > term with N and a very large number, I am still not getting this value > at all. > > > Any help will be appreciated. Thanks in advance ; best regards, > Hi Damien, use exact input and then evaluate with a precision greater than 22 : In[14]:= N[173746*Sin[10^22]+94228*Log[171/10]-78487*Exp[21/50],30] Out[14]= -1.34181895782961954970427868423*10^-12 or change the precision of the input: In[15]:= 173746*Sin[10^22]+94228*Log[17.1`30]-78487*Exp[0.42`30] Out[15]= -1.341818957830*10^-12 Peter
From: Damien Wyart on 5 Aug 2010 07:01
* Peter Pein <petsie(a)dordos.net> in comp.soft-sys.math.mathematica: > use exact input and then evaluate with a precision greater than 22 : > In[14]:= N[173746*Sin[10^22]+94228*Log[171/10]-78487*Exp[21/50],30] > Out[14]= -1.34181895782961954970427868423*10^-12 > or change the precision of the input: > In[15]:= 173746*Sin[10^22]+94228*Log[17.1`30]-78487*Exp[0.42`30] > Out[15]= -1.341818957830*10^-12 Many thanks for this answer and also to all the people who sent a private answer. It is very much appreciated. I realize my question was maybe a bit silly, but now I understand better why my trials were not successful. Very best regards, -- DW |