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

11 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
  9. Fascinating read about the calculator and Pi! Always love learning something new. Also, if you're crunching numbers for hours, staying refreshed is key Drip Drops Bulk Water is perfect for that!

    ReplyDelete
  10. When searching for reliable laptop repair near me services in your vicinity, it is essential to consider several factors that can influence the quality and efficiency of the repair process. Local repair shops often provide personalized service, allowing technicians to assess your device's issues directly and offer tailored solutions.

    These establishments typically have a range of expertise, from hardware malfunctions to software troubleshooting, ensuring that your laptop is in capable hands. Additionally, being nearby means you can easily drop off and pick up your device, minimizing downtime and inconvenience.

    ReplyDelete
  11. Great post—really appreciate the insights you've shared here. It's always valuable to see such thoughtful discussions on financial management and recovery strategies. For those exploring solutions in the revenue cycle space, partnering with experienced professionals can make a significant difference. Services like those offered by Early Out Collection Agency and Commercial Debt Recovery Experts can provide the support needed to streamline operations and improve outcomes.

    ReplyDelete