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

Add Leibniz formula for Pi benchmark #311

Merged
merged 1 commit into from
Mar 24, 2024
Merged

Conversation

leewei05
Copy link
Contributor

@leewei05 leewei05 commented Mar 4, 2024

It took about 2 seconds to calculate the current approximation of Pi. If we add another 0 to the number of loops, it would take about 20 seconds to add another digit, so I just stop here.

1000000:

$ time bril2json < leibniz.bril | brili
3.14159365359077425
________________________________________________________
Executed in    2.28 secs    fish           external
   usr time    2.15 secs    0.52 millis    2.15 secs
   sys time    0.09 secs    1.62 millis    0.09 secs

10000000:

$ time bril2json < leibniz.bril | brili
3.14159275358980139
________________________________________________________
Executed in   20.98 secs    fish           external
   usr time   20.43 secs    0.44 millis   20.43 secs
   sys time    0.27 secs    1.43 millis    0.27 secs

@sampsyo
Copy link
Owner

sampsyo commented Mar 24, 2024

This is SUPER cool! Thank you!!

@sampsyo sampsyo merged commit 0eedeea into sampsyo:main Mar 24, 2024
5 checks passed
@leewei05 leewei05 deleted the leibniz-bench branch March 25, 2024 01:52
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.

2 participants