Post Reply 
Ψ(x)⁻¹ [wp 34s]
05-09-2016, 06:39 PM
Post: #4
RE: Ψ(x)⁻¹ [wp 34s]
(05-09-2016 05:24 PM)Ángel Martin Wrote:  
(05-09-2016 03:19 PM)Gerson W. Barbosa Wrote:  Basically I have used a weighted mean of two assymptotic approximations, which are more accurate than any of them individually:

<see above>

This requires less evaluations of ψ(x), on the other hand it needs additional evaluations of Lambert's W function. I am not sure wether this takes more time, but it surely will require a lesser number of evaluations of the basic approximation, thus making the resulting code shorter than the equivalent to the one I used for the HP 50g here recently.

The accuracy is mostly twelve digits in the valid range ( x ≥ -1 ). It depends also of the accuracy of the library function 'ψ'.

Hi Gerson, thanks for this follow-up. What's the accuracy expected from this method? I must be doing something wrong (I admit it, I jumped into coding it without reading the other thread...) but I'm not getting the expected results beyond the second decimal digit.
I'm using WL0 from the SandMath, with that it's an easy task to program your last expression:

01 LBL "APSI"
02 E^X
03 ST+ X
04 1
05 X<>Y
06 +
07 LASTX
08 1/X
09 WL0
10 ST+ X
11 1/X
12 +
13 3
14 /
15 END

Do you see any flagrantly obvious mistake with the code above?

Cheers,
'AM

Hi, Ángel!

Your code is correct. For x = 2, the expect result is 7.88387350, good to four significant digits (the exact 10-digit result is 7.883428632). For smaller arguments things get worse, but then again the other two approximations get even worse. I don't claim this is a good method, but this is the only one I have so far. Perhaps a specific solver is a better option, the two first approximations being used as the initial guesses, since the true results lie between them (at least for the few arguments I've checked).

Cheers,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Ψ(x)⁻¹ [wp 34s] - Gerson W. Barbosa - 05-09-2016, 03:19 PM
RE: Ψ(x)⁻¹ [wp 34s] - Ángel Martin - 05-09-2016, 05:24 PM
RE: Ψ(x)⁻¹ [wp 34s] - Gerson W. Barbosa - 05-09-2016 06:39 PM



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