Faster inverse gamma and factorial for the WP 34S

02162015, 07:09 PM
(This post was last modified: 02162015 07:11 PM by Dieter.)
Post: #33




RE: Faster inverse gamma and factorial for the WP 34S
(02162015 05:46 PM)Bit Wrote: The builtin digamma function that Pauli mentioned, and which isn't available by default, is more accurate. Perhaps up to 33 digits in double precision mode if I see it correctly. That's what should be expected with the internal 39digit precision of Ccoded functions. ;) Back to the current solution: The Ψ code in the user code library was designed for 10digit accuracy on a 41 series calculator. It uses the asymptotic method given in Abramowitz & Stegun (1972) 6.3.18 for x > 8 and four terms of the series. Smaller arguments are evaluated via Ψ(x+1) = Ψ(x)+1/x. For the 34s I suggest using x > 16 (in SP) and six terms, which – when evaluated with sufficient precision – should provide an absolute error order of 10^{–18}. The results are even better with a slight tweak: instead of B_{12} = –691/2730 I simply use –1/4. ;) Here is some experimental code that should work for positive arguments. It is not yet complete and cannot replace the current Ψ routine, but I think it points into the right direction: Code: LBL"PSI" Here are some results: Code: SP mode: (02162015 05:46 PM)Bit Wrote: If you don't have a build environment but would like to play with the builtin function, I can send you some binaries that have it enabled. Thank you very much. But let me try first what can be done with user code. The mentioned results might give a first impression, now let's see what happens if the results move very close to zero, i.e. near the Gamma minimum at 1,4616... I wonder what the internal digamma function might return for Ψ(1,4616321449768362) and ...363? Can you post the results with all 34 digits? Dieter 

« Next Oldest  Next Newest »

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