Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1950

Re: MachinePrecision vs. Arbitrary Precision

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.mixmin.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.bbs-scene.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail
From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: MachinePrecision vs. Arbitrary Precision
Date Thu, 28 Apr 2011 10:34:47 +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 <ipbfs7$ad3$1@smc.vnet.net> (permalink)
Lines 45
NNTP-Posting-Date 28 Apr 2011 09:35:32 GMT
NNTP-Posting-Host b65042e2.news.twtelecom.net
X-Trace DXC=gcgAl:8HON::SYOHUdL]M7C_A=>8kQj6=;[h;PUXBgb4AbB79SZHZ=<EFiONJ7[Go6RbF[gf1C_E8
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1950

Show key headers only | View raw


On 4/27/11 at 5:39 AM, worthless.trash.junk@gmail.com (Rafael Dunn)
wrote:

>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,

More specifically, this asks hardware to do the required computation.

>it produces an incorrect result in this example.

That is due to the limitations of floating point arithmetic as
implemented in hardware. The actual result you get will vary
according to what hardware is being used.

>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?

The key is whenever you use N[expr, n], you invoke Mathematica's
arbitrary precision arithmetic and Mathematica does what is
needed to get the desired precision. This often means the result
returned is more accurate than what you get from N[expr] even
when n is less than $MachinePrecision. And note, doing

N[expr, $MachinePrecision]

is quite different than doing either

N[expr]

or

N[expr, MachinePrecision]

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: MachinePrecision vs. Arbitrary Precision Bill Rowe <readnews@sbcglobal.net> - 2011-04-28 10:34 +0000
  Re: MachinePrecision vs. Arbitrary Precision Scott Hemphill <hemphill@hemphills.net> - 2011-04-29 11:30 +0000

csiph-web