-
-
Notifications
You must be signed in to change notification settings - Fork 29
BUG: amos/amos.h: fix translation bugs in binu and rati #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2666,7 +2666,7 @@ namespace amos { | |
| dfnu = fnu + n - 1; | ||
| if ((az <= 2.) || (az * az * 0.25 <= (dfnu + 1.0))) { | ||
| /* GOTO 10 */ | ||
| nw = seri(z, fnu, kode, n, cy, tol, elim, alim); | ||
| nw = seri(z, fnu, kode, nn, cy, tol, elim, alim); | ||
| inw = std::abs(nw); | ||
| nz += inw; | ||
| nn -= inw; | ||
|
|
@@ -2689,7 +2689,7 @@ namespace amos { | |
| // | ||
| // MILLER ALGORITHM NORMALIZED BY THE SERIES | ||
| // | ||
| nw = mlri(z, fnu, kode, n, cy, tol); | ||
| nw = mlri(z, fnu, kode, nn, cy, tol); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if (nw < 0) { | ||
| nz = -1; | ||
| if (nw == -2) { | ||
|
|
@@ -2706,7 +2706,7 @@ namespace amos { | |
| // | ||
| // ASYMPTOTIC EXPANSION FOR LARGE Z | ||
| // | ||
| nw = asyi(z, fnu, kode, n, cy, rl, tol, elim, alim); | ||
| nw = asyi(z, fnu, kode, nn, cy, rl, tol, elim, alim); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if (nw < 0) { | ||
| nz = -1; | ||
| if (nw == -2) { | ||
|
|
@@ -2760,7 +2760,7 @@ namespace amos { | |
| /* 60 */ | ||
| if (az <= rl) { | ||
| /* 70 */ | ||
| nw = mlri(z, fnu, kode, n, cy, tol); | ||
| nw = mlri(z, fnu, kode, nn, cy, tol); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if (nw < 0) { | ||
| nz = -1; | ||
| if (nw == -2) { | ||
|
|
@@ -2788,7 +2788,11 @@ namespace amos { | |
| } | ||
| /* 100 */ | ||
| if (nw > 0) { | ||
| return -1; | ||
| nz = -1; | ||
| if (nw == -2) { | ||
| nz = -2; | ||
| } | ||
| return nz; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The if condition in 2792 is unreachable as first we check for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, of course you are right, I reverted this change. |
||
| } | ||
| nw = wrsk(z, fnu, kode, nn, cy, cw, tol, elim, alim); | ||
| if (nw < 0) { | ||
|
|
@@ -4296,7 +4300,7 @@ namespace amos { | |
| } | ||
|
|
||
| if (p1 == 0.) { | ||
| p1 = std::complex<double>(0, 0); | ||
| p1 = std::complex<double>(tol, tol); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| cy[n - 1] = p2 / p1; | ||
|
|
@@ -4309,7 +4313,7 @@ namespace amos { | |
| cdfnu = fnu * rz; | ||
|
|
||
| for (i = 2; i < (n + 1); i++) { | ||
| pt = cdfnu + t1 * rz * cy[k]; | ||
| pt = cdfnu + t1 * rz + cy[k]; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| if (pt == 0.0) { | ||
| pt = std::complex<double>(tol, tol); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/scipy/scipy/blob/4edfcaa3ce8a387450b6efce968572def71be089/scipy/special/amos/zbinu.f#L26