-
Notifications
You must be signed in to change notification settings - Fork 69
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
Rewrite JacobiSNCNDNReduced #2220
Conversation
numerics/elliptic_functions.cpp
Outdated
namespace numerics { | ||
namespace { | ||
|
||
void JacobiSNCNDNReduced(double u, double mc, double& s, double& c, double& d); | ||
|
||
// Maclaurin series for Fukushima b₀. These are polynomials in m that are used | ||
// to build a polynomial in u₀². The index gives the degree of the polynomial. |
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.
that are used
to buildas coefficients of a polynomial in u₀²
The index gives the degree of the polynomial
The index should give the corresponding power of u₀² .
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.
Done.
numerics/elliptic_functions.cpp
Outdated
double const uA = 1.76269 + 1.16357 * mc; | ||
bool const may_have_cancellation = u > uA; | ||
double aᵢ = 1.0; | ||
for (int j = 0; j < n; ++j) { |
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.
Rename j
to i
, for consistency with the subscript.
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.
Done.
numerics/elliptic_functions.cpp
Outdated
double cᵢ = aᵢ - bᵢ; | ||
double const two_mc = 2.0 * mc; | ||
double const two_m = 2.0 * m; | ||
for (int i = j; i < n; ++i) { |
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.
This just finishes the outer loop; reuse the same index accordingly.
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.
Done.
No description provided.