Post Reply 
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
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Approximate pi to 24 digits via keyboard - Dieter - 02-01-2015 10:25 PM



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