Approximate pi to 24 digits via keyboard
02-01-2015, 10:25 PM (This post was last modified: 02-01-2015 10:28 PM by Dieter.)
Post: #20
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Approximate pi to 24 digits via keyboard
(02-01-2015 09:17 PM)Rick314 Wrote:  Hello Thomas. I'm with Dieter here, and yes absolutely non-entered input digits should be considered to be 0. e^1003, e^(1003 + 1e-8) and e^(1003 - 1e-8) are distinct different recognizable inputs to a 12-digit calculator and each has a different unique 12-digit approximation to the exact correct answer.

Thank you, Rick. But in the end I think we will all come together with something we all can agree with. ;-) If I understand Thomas correctly, his point is that a 12-digit approximation for pi (e.g. 3,14159265358 or ...59) may be anything within this interval, but the sine of such a random argument can vary substantially. So taking all results magno cum grano salis is advised – as usual.

I chose this example with the exponential function because here the relative error can be estimated very easily: since ex approximately equals 1+x if x is sufficiently small, the three values differ by a relative difference of quite exactly 1E–8. So the results agree in not more than 8 out of 12 digits. Now if you assume that "1003" is just an approximation of a random value within 0,5 ULP, i.e. something between 1002,999999995 and 1003,000000005, where ex agrees only in its first 8 digits: how much sense is then in a 12-digit result?

So there are simply two different assumptions: either 3,14159265358 is considered exact, i.e. 3,1415926535800000000000000.... (that's what I prefer, and obviously you do as well), or one may think of it as "anything between 3,141592653575 and 3,141592653585" (which would mean that any returned value for the sine of this is meaningless).

(02-01-2015 09:17 PM)Rick314 Wrote:  (I checked with extended-precision software and Dieter's 3 answers are indeed the best 12-digit answers possible. They are also what my HP-35S returns, so kudos to the HP-35S same as for its sin(x) algorithm.) I don't think there is any "relative error" on the 3 different inputs, and the 3 different answers are the correct 12-digit answers.

Yes, the 35s does return these three results – actually that's the calculator I used for the calculation. But you should not be too generous with your kudos: take a look at these results by the 35s and probably also other HPs:

Code:
3,1           [SIN]  4,15806624333 E-2    exact 3,14          [SIN]  1,59265291648 E-3    last digit off (-1 ULP) 3,141         [SIN]  5,92653555096 E-4    last digit off (-3 ULP) 3,1415        [SIN]  9,26535896582 E-5    last 2 digits off (-25 ULP) 3,14159       [SIN]  2,65358979 E-6       last 3 digits lost 3,141592      [SIN]  6,5358979 E-7        last 4 digits lost 3,1415926     [SIN]  5,358979 E-8         last 5 digits lost 3,14159265    [SIN]  3,58979 E-9          last 6 digits lost 3,141592653   [SIN]  5,89793238463 E-10   exact 3,1415926535  [SIN]  8,97932384626 E-11   exact 3,14159265358 [SIN]  9,79323846264 E-12   exact

;-)

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread Approximate pi to 24 digits via keyboard - Rick314 - 01-30-2015, 06:35 PM RE: Approximate pi to 24 digits via keyboard - PANAMATIK - 01-30-2015, 07:22 PM RE: Approximate pi to 24 digits via keyboard - Rick314 - 01-30-2015, 07:53 PM RE: Approximate pi to 24 digits via keyboard - Gilles - 01-30-2015, 08:38 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 01-31-2015, 07:11 AM RE: Approximate pi to 24 digits via keyboard - Gilles - 01-31-2015, 11:25 AM RE: Approximate pi to 24 digits via keyboard - Dieter - 01-31-2015, 06:17 PM RE: Approximate pi to 24 digits via keyboard - Gerson W. Barbosa - 02-02-2015, 02:57 AM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-02-2015, 06:56 AM RE: Approximate pi to 24 digits via keyboard - Dieter - 01-31-2015, 07:06 AM RE: Approximate pi to 24 digits via keyboard - Rick314 - 02-01-2015, 12:21 AM RE: Approximate pi to 24 digits via keyboard - J-F Garnier - 02-01-2015, 08:41 AM RE: Approximate pi to 24 digits via keyboard - Rick314 - 02-01-2015, 05:44 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-01-2015, 02:12 PM RE: Approximate pi to 24 digits via keyboard - EdS2 - 02-01-2015, 08:08 PM RE: Approximate pi to 24 digits via keyboard - Thomas Klemm - 02-01-2015, 11:07 AM RE: Approximate pi to 24 digits via keyboard - J-F Garnier - 02-01-2015, 11:34 AM RE: Approximate pi to 24 digits via keyboard - Han - 02-02-2015, 11:01 PM RE: Approximate pi to 24 digits via keyboard - Mark Hardman - 02-03-2015, 12:01 AM RE: Approximate pi to 24 digits via keyboard - rprosperi - 02-03-2015, 12:33 AM RE: Approximate pi to 24 digits via keyboard - Thomas Klemm - 02-01-2015, 04:27 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-01-2015, 05:34 PM RE: Approximate pi to 24 digits via keyboard - Thomas Klemm - 02-01-2015, 07:24 PM RE: Approximate pi to 24 digits via keyboard - Rick314 - 02-01-2015, 09:17 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-01-2015 10:25 PM RE: Approximate pi to 24 digits via keyboard - Gerson W. Barbosa - 02-02-2015, 02:43 AM RE: Approximate pi to 24 digits via keyboard - Rick314 - 02-02-2015, 06:46 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-05-2015, 02:32 PM RE: Approximate pi to 24 digits via keyboard - Gerson W. Barbosa - 02-05-2015, 10:59 PM RE: Approximate pi to 24 digits via keyboard - Claudio L. - 02-06-2015, 03:03 PM RE: Approximate pi to 24 digits via keyboard - Marcus von Cube - 02-06-2015, 07:16 PM RE: Approximate pi to 24 digits via keyboard - PANAMATIK - 02-06-2015, 04:10 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-06-2015, 06:34 PM RE: Approximate pi to 24 digits via keyboard - Werner - 02-06-2015, 11:16 AM RE: Approximate pi to 24 digits via keyboard - Werner - 02-07-2015, 06:25 AM RE: Approximate pi to 24 digits via keyboard - Marcus von Cube - 02-07-2015, 11:15 PM RE: Approximate pi to 24 digits via keyboard - Dieter - 02-08-2015, 05:00 PM

User(s) browsing this thread: 1 Guest(s)