Mercurial > octave
diff liboctave/numeric/lo-specfun.cc @ 19200:068a3e51b7b8
ellipj: Fix continuity of dn output when cn is near zero (bug #43344)
* lo-specfun.cc (ellipj): Fix continuity of the dn output, the current
method results in a discontinuity when cn is near zero.
* ellipj.cc: Add test for bug #43344.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Wed, 01 Oct 2014 22:39:04 -0400 |
parents | 161ebb78ac1b |
children | 06e7ad9b5154 |
line wrap: on
line diff
--- a/liboctave/numeric/lo-specfun.cc Wed Oct 01 19:36:05 2014 +0100 +++ b/liboctave/numeric/lo-specfun.cc Wed Oct 01 22:39:04 2014 -0400 @@ -3680,12 +3680,11 @@ phi = ii*a[Nn]*u; for (n = Nn; n > 0; --n) { - t = phi; phi = (asin ((c[n]/a[n])* sin (phi)) + phi)/2; } sn = sin (phi); cn = cos (phi); - dn = cn/cos (t - phi); + dn = sqrt (1 - m*sn*sn); } }