Pages

Wednesday, March 14, 2012

Calculator Pi

There is a very fast converging algorithm for computing pi that you can do on a desktop calculator.
  • Set x = 3
  • Now set x = x + sin(x)
  • Repeat
This converges ridiculously fast, after 1 step you get 4 digits right, after 2 steps you get 11 correct, in general we find:



# steps Digits right
1 4
2 11
3 33
4 100
5 301
6 903
7 2708
8 8124


of course on a pocket calculator, you only need to do 2 steps to have an accuracy greater than the calculator can display.  To make this chart I had to trick a computer into doing high precision arithmetic, the code is here.

Granted, this approximation is really cheating, since sin is a hard function to compute, and basically being able to compute sin means you know what pi is already.  Really, this is just Newton's method for computing the root of sin(x) in disguise

8 comments:

  1. I always like to read a quality content having accurate information regarding the subject and the same thing I found in this post. Nice work
    Donovan Mtichell HBCU Pride Jacket

    ReplyDelete
  2. This is a fantastic and quite useful article for me. Thank you so much for all of your hard work in giving such excellent information! search engine optimization services in usa

    ReplyDelete
  3. Great article has truly peaked my interest. thank you for this great stories

    ReplyDelete
  4. I definitely loved every little bit of it. Cheers for the info! you will be a great author man!

    ReplyDelete
  5. I should say its awesome post! This Blog is so Wonderful. Thanks

    ReplyDelete
  6. Hello there, You have done a fantastic article here. I want more Thanks

    ReplyDelete
  7. For sure I will check out more posts. This is just great! So Continue

    ReplyDelete
  8. This is such an interesting post about calculators and the fascinating concept of pi! It’s incredible how tools like these have evolved to make complex calculations more accessible. Speaking of tools, Google has also transformed how we approach problem-solving in math and science. Whether it’s using Google’s calculator feature directly in the search bar or finding tutorials and resources, google is a go-to platform for learners and enthusiasts alike. Thanks for sharing this thought-provoking post—looking forward to reading more!

    ReplyDelete