Ψ⁻¹(x) [wp 34s]
|
05-09-2016, 03:20 PM
Post: #1
|
|||
|
|||
Ψ⁻¹(x) [wp 34s]
.
Code:
Examples 2 g FILL g LN x - 0.5772156649 STO B - A --> 1.5 (5.0 s) 4 ENTER 3 / 2 g LN 3 x - π 2 / + RCL B - A --> 1.75 (5.0 s) RCL B +/- A --> 9.99999999997e-1 (10.3 s) 1 +/- A --> 7.850033253 81e-1 (10.5 s) 0 A --> 1.46163214497 (5.0 s) 1 A --> 3.20317146836 (4.3 s) 2 A --> 7.88342863117 (1.7 s) 4 A --> 55.0973869103 (1.4 s) 9 A --> 8103.58392243 (0.7 s) 2.45 RCL B - A 1 - --> 6 (4.2 s); Hn⁻¹(2.45) = 6, that is, 1 + 1/2 + 1/3 + 1/4 + 1/5 + 1/6 = 2.45 = H₆ 1.2 +/- A --> Domain Error x<>y XEQ 04 7.07122399 653e-1 Basically I have used a weighted mean of two assymptotic approximations, which are more accurate than any of them individually: \[\psi (x+\frac{1}{2})\approx \ln (x)\therefore \psi ^{-1}(x)\approx e^{x}+\frac{1}{2}\] \[\psi (x)\approx \ln (x)-\frac{1}{2x}\therefore \psi ^{-1}(x)\approx \frac{1}{2W_{p}\left ( \frac{1}{2e^{x}} \right )}\] \[\psi ^{-1}(x)\approx \frac{1}{3} \left [2\left ( e^{x}+\frac{1}{2} \right )+\frac{1}{2W_{p}\left ( \frac{1}{2e^{x}} \right )} \right ]\] or, \[\psi ^{-1}(x)\approx \frac{1}{3} \left [1+2 e^{x}+\frac{1}{2W_{p}\left ( \frac{1}{2e^{x}} \right )} \right ]\] 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 'ψ'. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)