-
Notifications
You must be signed in to change notification settings - Fork 34
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
Newton-Raphson divison, sqrt #72
Conversation
Thank you for your PR. I have some comments.
In addition, I can unfortunately tell that you did no research into my However, all of that could be safely discarded if the code shows promise. So I wrote benchmarks to test your new code. I ran these commands with my code:
Then I ran the benchmarks as follows:
Then I repeated the steps with your code:
The To test how your code did, I used
Then to test the time difference on
As you can tell, there's no difference at the lowest confidence I can accept. To test the memory difference (max RSS) for
No memory difference. Cool. For the elapsed time for
As you can see, there is a difference, with 99.5% confidence, but in favor of the old code. In fact, if not for the one outlier, your code would be twice as slow. And if we look at the max RSS difference for
Your code uses 50% more memory, with 99.5% confidence. Moving onto
Your code is twice as slow with 99.5% confidence. For memory on
So there's a small increase of memory in your code, even at 99.5% confidence, but that's small enough that I can ignore it. For time on
Your code is almost twice as slow at 99.5% confidence. For memory on
Your code uses twice as much memory at 99.5% confidence. So on average, your code is twice as slow and uses more memory. Unfortunately, based on the poor performance of your code compared to what already exists, I can't say that it shows promise. Combined with the problems I mentioned at the beginning, I'm afraid I must reject this PR completely. Sorry. |
Newton-Raphson approximation is applied to division and sqrt.
Try 5^1000000 / 2^1000000 and sort(5^999999)