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

speed up gaspari cohn #157

Closed
mathause opened this issue Jun 10, 2022 · 1 comment · Fixed by #393
Closed

speed up gaspari cohn #157

mathause opened this issue Jun 10, 2022 · 1 comment · Fixed by #393
Labels
good first issue Good for newcomers

Comments

@mathause
Copy link
Member

mathause commented Jun 10, 2022

From #109 (comment): it should be possible to speed up calculating the gaspari cohn function by getting rid of the exponents:

-1 - 5 / 3 * r_s ** 2 + 5 / 8 * r_s ** 3 + 1 / 2 * r_s ** 4 - 1 / 4 * r_s ** 5
+1 - (5 / 3 + (5 / 8 + (1 / 2 - 1 / 4 * r_s) * r_s) * r_s) * r_s**2

admittedly a micro optimisation and making it more difficult to read but about 10 times faster (double check) because exponentiation is expensive.

See also #158

@mathause mathause added the good first issue Good for newcomers label Jun 10, 2022
@mathause mathause added this to the v0.9.0 milestone Dec 13, 2022
@mathause
Copy link
Member Author

Removing from the milestone again. This remains a not-critical good first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant