Programming Exercise (HP-15C, 15C LE - and others)
|
04-06-2014, 11:24 AM
(This post was last modified: 04-06-2014 12:17 PM by Gerson W. Barbosa.)
Post: #99
|
|||
|
|||
RE: Programming Exercise (HP-15C, 15C LE - and others)
(04-06-2014 06:24 AM)Thomas Klemm Wrote: Now we have 3 different ways to calculate the same thing: No, the proof has yet to be found (in case there isn't one already), by someone more capable than I. I only found this empirically, using the WP 34S in double precision and the sum of the first 10000 terms of the series, the difference to ln(2) being found to be 1/20001 + (1/20001 + 4/(20001 + 9/(20001 + 16/(20001 + ... Then I assumed the next numerators to be 25, 36, 49... (04-06-2014 06:24 AM)Thomas Klemm Wrote:Quote:The first parameter is the number of terms in the continued fraction, minus one.This parameter is ignored. Instead the 2nd parameter is used twice (cf. lines 14-15). Thank you very much! The timings and results were indeed strange. I ought to have checked them more carefully. I think I got it right this time. Faster, and only one step longer: Code:
4 10 GSB A --> 0.6931471806 ( 9 s ) 5 8 GSB A --> 0.6931471805 ( 8.9 s ) 6 8 GSB A --> 0.6931471806 ( 9.6 s ) 10 4 GSB A --> 0.6931471808 ( 11 s ) 7 6 GSB A --> 0.6931471805 ( 8.6 s ) 6 6 GSB A --> 0.6931471807 ( 8.4 s ) Cheers, Gerson. P.S.: My HP-15C (2905B29505) is somewhat slower: 4 10 GSB A --> 0.6931471806 ( 10.2 s ) Code:
On the other hand the HP-15C LE might do it in about 70 ms :-) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)