Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1941
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail |
|---|---|
| From | DrMajorBob <btreat1@austin.rr.com> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: N[] MachinePrecision vs. Arbitrary Precision |
| Date | Thu, 28 Apr 2011 10:33:12 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <ipbfp8$aal$1@smc.vnet.net> (permalink) |
| Lines | 75 |
| NNTP-Posting-Date | 28 Apr 2011 09:33:57 GMT |
| NNTP-Posting-Host | b65042e2.news.twtelecom.net |
| X-Trace | DXC=LbfBN^Bd>kJ^0S5=_@A1nOC_A=>8kQj6M;[h;PUXBgbDAbB79SZHZ=LEFiONJ7[GoF]hHNEH1685I |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1941 |
Show key headers only | View raw
These are the same:
N[Sin[Exp[100]]]
Sin[Exp[100.]]
RealDigits /@ {%, %%}
-0.999105
-0.999105
{{{9, 9, 9, 1, 0, 5, 0, 1, 3, 0, 7, 7, 4, 3, 9, 3},
0}, {{9, 9, 9, 1, 0, 5, 0, 1, 3, 0, 7, 7, 4, 3, 9, 3}, 0}}
But they're not precise. How could they be?
D[Sin[Exp[x]], x]
% /. x -> 100 // N
E^x Cos[E^x]
-1.13704*10^42
You need 43 digits of accuracy in the argument (100.) to get ONE digit
accuracy in Sin[Exp[100.]], and machine precision doesn't give that much.
$MachinePrecision
15.9546
Using precision arithmetic gives better results (for this problem):
N[Sin[Exp[100]], 1]
N[Sin[Exp[100]], 11]
N[Sin[Exp[100]], 50]
0.1
0.14219812366
0.14219812365823863777245030647868525633473760956388
And that's because it's completely different arithmetic. (We mortals are
not privy to the details, which may be just as well.)
Bobby
On Wed, 27 Apr 2011 04:39:25 -0500, Rafael Dunn
<worthless.trash.junk@gmail.com> wrote:
> Mathematica 8.0.1.0, Mac OSX x86
>
> In:=
> N[Sin[Exp[100]]]
> N[Sin[Exp[100]], 1]
> N[Sin[Exp[100]], 11]
>
> Out:=
> -0.999105
> 0.1
> 0.14219812366
>
> I realize that N[exp] = N[exp, MachinePrecision]. This indicates when
> N[] is asked to calculate to MachinePrecision, it produces an incorrect
> result in this example. However, when I use N[exp,n] where n <
> MachinePrecision, I get a correct output. Is this because N[exp,n] uses
> ExtraPrecision, while N[exp] does not? If I set MaxExtraPrecision =
> 0, then N[exp,n] produces a result of 0 with the note that there are no
> significant digits to display until I have made n high enough for
> Mathematica to be able to internally compute it.
>
--
DrMajorBob@yahoo.com
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: N[] MachinePrecision vs. Arbitrary Precision DrMajorBob <btreat1@austin.rr.com> - 2011-04-28 10:33 +0000
csiph-web