Skip to content
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

A straightforward translation of Fukushima's code for elliptic functions #2201

Merged
merged 16 commits into from
Jun 15, 2019

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Jun 13, 2019

Complete with a unit test and a benchmark.

Run on (4 X 3310 MHz CPU s)
CPU Caches:
  L1 Data 32K (x4)
  L1 Instruction 32K (x4)
  L2 Unified 262K (x4)
  L3 Unified 6291K (x1)
---------------------------------------------------------
Benchmark                  Time           CPU Iterations
---------------------------------------------------------
BM_Gscd                  166 ns        166 ns   16780000
BM_Gscd                  166 ns        165 ns   16780000
BM_Gscd                  166 ns        165 ns   16780000
BM_Gscd                  166 ns        166 ns   16780000
BM_Gscd                  166 ns        165 ns   16780000
BM_Gscd                  166 ns        166 ns   16780000
BM_Gscd                  167 ns        166 ns   16780000
BM_Gscd                  166 ns        165 ns   16780000
BM_Gscd                  166 ns        165 ns   16780000
BM_Gscd                  167 ns        166 ns   16780000
BM_Gscd_mean             166 ns        166 ns         10
BM_Gscd_median           166 ns        166 ns         10
BM_Gscd_stddev             0 ns          1 ns         10


// An auxiliary message used to represent tabulated data. Useful for tests that
// verify precomputed results. The arguments and values are to be interpreted
// by the test.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.proto files are cheap, and we are using this for only one table; just give it fields m, u, s, c, d (or more verbose names as appropriate).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proto are not so cheap when it comes to compilation time. Furthermore, this proto will be used in the next PR to test the integrals. I'm keeping it as is for now, we can revisit when we have more use cases. (It's not like it's really error-prone: if you swap m and u for instance, the test is going to fail all over the place.)


void Gscd(double const u, double const mc, double& s, double& c, double& d);

double Elk(double const mc);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No const in the declaration for parameters passed by value:

void Gscd(double u, double mc, double& s, double& c, double& d);

double 🦌(double mc);

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Sorry, something went wrong.

@eggrobin eggrobin added the LGTM label Jun 15, 2019
@pleroy pleroy merged commit a22abab into mockingbirdnest:master Jun 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants