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

lots of numerics improvements #1

Closed
wants to merge 1 commit into from

Conversation

oscardssmith
Copy link

the main ones are sqrt(sqrt(x)) instead of x^.25 and cispi(x) instead of exp(im*pi*x). I also started converting abstoabs2` which is noticeably faster for complex, but I think I've missed a few.

@gbaraldi
Copy link

gbaraldi commented Jul 5, 2022

I believe modulo isn't equivalent to mod but to rem

@stla
Copy link
Owner

stla commented Jul 6, 2022

Yes, modulo is rem, thanks.

I've manually done the changes, because of conflicts.

I don't believe in the accuracy of cispi: I had to remove it, because one of my unit tests, a comparison with an exact value, is failing with cispi.

@stla stla closed this Jul 6, 2022
@stla
Copy link
Owner

stla commented Jul 6, 2022

Look:

julia> cispi(1im)
0.04321391826377052 + 0.0im

julia> exp(-pi)
0.04321391826377226

The second one is closer to Wolfram:

0.04321391826377224977...

@oscardssmith
Copy link
Author

Oh, that's surprisingly inaccurate That shouldn't be happening.

@simonp0420
Copy link
Contributor

The inaccuracy in cispi has been fixed, along with a 2x speedup in this PR

@oscardssmith oscardssmith deleted the patch-1 branch May 23, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants