Which is more correct? Neither is correct in the bolded digits you post. In fact, the digit preceding that is also incorrect, in both cases.
0.00016658581098763341149213050712475
In both cases, the digits beyond 987633... are garbage.
Both tools are computing an essentially double precision computation of exp(x), but the result will be correct only to roughly 16 significant digits. To go beyond that point is to compute meaningless dreck.
If you want to know which is "more" correct, I guess MATLAB wins here by a hair. It as slightly less incorrect in the last digit before it begins to diverge from the "correct" value.
As another point of comparison, below i use code I wrote myself (in MATLAB), so I know it to be correct. Here, 60 decimal digits are used, then rounded so only 50 were displayed:
0.00016658581098763341149213050712474673081123537780704
And if you don't believe me (nobody ever seems to) then Wolfram Alpha tells me it is:
0.0001665858109876334114921305071247467308112353778070434276
So my rounding to 50 digits seems to have been correct.
0 Comments
Sign in to comment.