Post Reply 
integral competition HP50g vs. DM42
04-06-2024, 11:04 PM (This post was last modified: 04-09-2024 02:16 PM by Albert Chan.)
Post: #32
RE: integral competition HP50g vs. DM42
[Image: MainEq1.gif]

FYI, there is a problem with erfc continued fraction formula.
Calculate bottom up, if any CF denominators caused massive cancellations, all we get is garbage. (*)

Cas> erf(z := 3.16845945394*i)

1 - 58608047158.3*i     // erf(z) = 1 - erfc(z) ... but wrong

Cas> 2/sqrt(pi) * quad(t -> exp(-t*t), 0, z)[1]

4325.2249097*i            // actual integration, erf(z) correct.

(11-16-2023 01:22 PM)parisse Wrote:  I have disabled the continued fraction, it should now work correctly
(it will just be a little bit slower if |z| is between 4 and 6.5).

(*) With re(z)≥0, denominator may get to 0 only if re(z)=0

z + n/z = r*cis(θ) + n/r*cis(-θ)

Since cos(-θ) = cos(θ), we have:
--> re(z + n/z) ≥ re(z)
--> re(z + (n-1/2)/(z + n/z)) ≥ re(z)
...
--> re(z + (1/2)/(z + 1/(z + (3/2)/(z + ...)))) ≥ re(z)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: integral competition HP50g vs. DM42 - Albert Chan - 04-06-2024 11:04 PM



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