|Re: Does wp34S Have A "MANT" Function?|
Message #35 Posted by Dieter on 20 Aug 2011, 10:28 a.m.,
in response to message #34 by Oliver Unter Ecker
The advantage of the XROOT command is its higher precision due to the internal guard digits. Usually there are three digits more than you see, on the 34s it's even 39 digits internal precision while only 16 are returned to the user. This additional precision avoids the following error. The example assumes 16 significant digits.
I'm convinced and thank you for the info. The next update of ND1 will have the XROOT function, though I don't yet know how to implement it. I tried 4782969, enter, 1/7, enter, ^ in ND1 which displays as "9" but really is "8.999999999999999998" (two ULPs off). An alternative interface to XROOT will be exponentiation with a fraction.
The 7th root of x is x^(1/7). But we connot provide the exact value for 1/7 on any limited-precision calculator. On a 16-digit machine, all that can be done is providing the best possible exponent, thus calculating
7th root of x = x1/7 ~= x0,1428 5714 2857 1429
On a perfect calculator the exponent is off by at most 0,5 ULP. In this case it's 0,43 ULP. If we call this deviation dx, with a bit of calculus it can be shown that, in the final result, this causes a possible relative error of
rel. error = dx * ln x
= 0,42857 E-16 * ln 4782969
= 6,592 E-16
abs. error = rel. error * exact result
= 6,592 E-16 * 9
= 5,93 E-15
Which is exactly what we get in the example:
47829690,1428 5714 2857 1429 = 9,000 0000 0000 0005 93...
which finally is rounded to ...006.
The result for a 12-digit calculator is better since here the rounded value for 1/7 is only 0,14 ULP off, so that the absolute error is "only" 1,98E-11 or 2 ULP.
The above calculation can be used to find out how many digits are required to ensure a full 16-digit result for the n-th root of x. <8)