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


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

Re: Numerical accuracy/precision - this is a bug or a feature?

From "Kevin J. McCann" <kjm@KevinMcCann.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Numerical accuracy/precision - this is a bug or a feature?
Date 2011-07-04 11:18 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ius7hm$358$1@smc.vnet.net> (permalink)
References <ius5op$2g7$1@smc.vnet.net>

Show all headers | View raw


BTW, you can skip the outer N[]:

N[2,20]N[Sqrt[2],20]

produces:

2.8284271247461900976

Kevin

On 7/4/2011 6:47 AM, slawek wrote:
> Let Mathematica (6.x, 7.x) compute quite a simple product
>
> In[1]:= N[N[2.0, 20] * N[Sqrt[2] , 20], 20]
>
> Out[1]= 2.82843
>
> This is a bug.
>
> Why?
>
> Now we analyze it in details:
>
> 1. N[2.0,20] should give 2 with accuracy/precision/whatsever about 20
> decimal digits, i.e. 2.00000000000000000000
>
> 2. Sqrt[2] should give... Sqrt[2]
>
> 3. N[Sqrt[2]] should give 1.4142135623730950488 (this is copy-paste from
> Mathematica output to N[Sqrt[2]] )
>
> 4. The product 2.00000000000000000000 * 1.4142135623730950488 is
> 2.8284271247461900976 (again copy-paste)
>
> 5. BUT THE RESULT OF  N[2.0, 20] * N[Sqrt[2] , 20]  "truncated to 20 digits"
> is Out[1]= 2.82843
>
> Where are missing digits?!
>
> slawek
>
>
>
>

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


Thread

Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-04 10:47 +0000
  Re: Numerical accuracy/precision - this is a bug or a feature? "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-07-04 11:14 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-05 09:17 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? "Kevin J. McCann" <Kevin.McCann@umbc.edu> - 2011-07-06 09:35 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-07 11:40 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Daniel Lichtblau <danl@wolfram.com> - 2011-07-07 11:34 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-07-06 09:39 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-07 11:33 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? Noqsi <noqsiaerospace@gmail.com> - 2011-07-08 08:51 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-12 11:01 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-07-08 09:04 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-09 11:34 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-12 11:02 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-07-09 11:37 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Noqsi <noqsiaerospace@gmail.com> - 2011-07-13 07:11 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-14 09:23 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-07-15 01:19 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? "W. Craig Carter" <ccarter@mit.edu> - 2011-07-15 01:25 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-07-15 08:12 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-07-16 09:45 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-07-16 09:40 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? Noqsi <noqsiaerospace@gmail.com> - 2011-07-13 07:12 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? Noqsi <noqsiaerospace@gmail.com> - 2011-07-15 01:23 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-15 08:10 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? Noqsi <noqsiaerospace@gmail.com> - 2011-07-16 09:41 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-17 10:02 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-18 10:14 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-07-18 10:17 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-19 10:55 +0000
  Re: Numerical accuracy/precision - this is a bug or a feature? "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-07-04 11:18 +0000
    Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-05 09:15 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? "slawek" <slawek@host.pl> - 2011-07-06 09:34 +0000
      Re: Numerical accuracy/precision - this is a bug or a feature? Daniel Lichtblau <danl@wolfram.com> - 2011-07-07 11:35 +0000
        Re: Numerical accuracy/precision - this is a bug or a feature? Richard Fateman <fateman@cs.berkeley.edu> - 2011-07-08 08:53 +0000

csiph-web