Accuracy summation question - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Accuracy summation question (/thread-20464.html) |
Accuracy summation question - lrdheat - 09-06-2023 07:30 PM I calculated 2000! in home by summing from 1 to 2000 log (x), and taking 10^answer, getting 3.316274+ E5735 On the WP34S, I directly get 3.31627509245+ E5735 On my CASIO 991CW, using the summation method used on prime, I got 3.3162750924 E5735 On my CASIO 9750giii, I got 3.316275094 E5735 The CASIO 991CW uses 22 or 23 significant digits in its calculations, may help explain close agreement with the WP34S. I was surprised that the Prime in home disagreed with the others in just the 6th decimal. RE: Accuracy summation question - rkf - 09-07-2023 08:38 AM (09-06-2023 07:30 PM)lrdheat Wrote: I calculated 2000! in home by summing from 1 to 2000 log (x), and taking 10^answer, getting 3.316274+ E5735 It´s indeed strange (altough I would say it differs in the seventh place, ...487 vs. 509). Assuming the LOGs are calculated correctly to 12 digits with values rising from 0 to about 3.3, the error of one summand should be less than +/- 5E-12 If the error in summation propagates normally, I would expect in the sum an error of ca. sqrt(2000)*(+/- 5E-12) < 2.3E-10 Taking 10^ this I get 1.00000000051, so I would nevertheless expect about 9 correct places, and not 7. :-( Addendum: BTW I just compared with my HP50g, which gives exactly the same result of 5735.52065052 for the sum of logarithms as the prime, thus indicating the 12digits arithmetics core engine is the same. RE: Accuracy summation question - Albert Chan - 09-07-2023 10:40 AM (09-07-2023 08:38 AM)rkf Wrote: It´s indeed strange (altough I would say it differs in the seventh place, ...487 vs. 509). Assuming your numbers are correct: log10(3.31627487E5735) vs log10(3.31627509E5735) = 5735.52065052 vs 5735.52065055 For 12 decimal digits, 1 .. 2000 log10 sum, error is just 3 ULP. But we are mapping sum with 10^, IP goes to exponent, FP goes to mantissa. FP with 7 digits accuracy translate to about 7 digits mantissa with 10^, as expected. 10^(FP*(1+ε)) = 10^FP * e^(ln(10)*FP*ε) ≈ 10^FP * (1 + ln(10)*FP*ε) 0.5207*ln(10) ≈ 0.5207/0.4343 ≈ 1.20 // FP → mantissa relative error expanded a little. RE: Accuracy summation question - byoung - 09-07-2023 08:29 PM OK, this is probably a dumb question, but how are you guys getting such large exponents? Mine maxes out at E499. RE: Accuracy summation question - Gerson W. Barbosa - 09-08-2023 01:38 AM (09-07-2023 08:29 PM)byoung Wrote: OK, this is probably a dumb question, but how are you guys getting such large exponents? Mine maxes out at E499. Just using property of logarithms. Sum(n=1,2000,log(n)) = 5735.52065052 (hp 50g) -> 2000! 10^0.520652*10^5735 2000! = 3.31627(487045)*10^5735 RE: Accuracy summation question - byoung - 09-08-2023 01:04 PM (09-08-2023 01:38 AM)Gerson W. Barbosa Wrote:(09-07-2023 08:29 PM)byoung Wrote: OK, this is probably a dumb question, but how are you guys getting such large exponents? Mine maxes out at E499. Thanks. I just thought you had discovered some way to put the calculator into a high-precision mode, which I didn't think was possible. |