How Google designed a smarter calculator than Apple @DrTrefor
How Google designed a smarter calculator than Apple  @DrTrefor
Uploaded March 2025 | Updated November 2026, 5 days ago
Self-study with Brilliant at brilliant.org/TreforBazett to get started for free for 30 days, and to get 20% off an annual premium subscription!

Paper by Hans Boehm: https://research.google/pubs/towards-an-api-for-the-real-numbers/
Useful blog post also covering the paper: chadnauseam.com/coding/random/calculator-app

The iOS calculator occasionally gives errors like saying that 10^100+1-10^100=0. This is because it uses floating point arithmetic, which is great because it uses little memory, can represent a huge range of numbers, and allows for very efficient calculations. But Hans Boehm at google uses a hybrid approach with recursive real arithmetic to create a calculator app that avoids these errors and, while not perfect, is pretty good at identifying user experience issues like deciding between 0 and 0.00000000.

♡♡♡SUPPORT THE CHANNEL♡♡♡
►Support on PATREON: patreon.com/DrTrefor
► CURIOSITY BOX: CuriosityBox.com/DrTrefor use CODE drtrefor for 25% off awesome STEM merch boxes
► MATH BOOKS I LOVE (affiliate link): amazon.com/shop/treforbazett

0:00 Apple vs Google
0:38 Floating Point Arithmetic
4:11 Rationals and Dyadic Rational Approximations
7:23 Recursive Reals
9:48 Addition of Recursive Reals
15:05 Decidability
18:00 Implementation
24:53 Check out Brilliant.org/TreforBazett

Correction:
8:42 I say we can UNIQUELY choose a dyadic rational within that error bound that has the denominator 2^n. It isn't quite unique. Take 1/3 rounding to the nearest 1/4. Both 1/4 and 2/4 are within the error range. But that's ok, you can choose either of them and ultimately all we care about is choosing something within the error bound that is as small (from a memory perspective, i.e. smaller denominator) as possible. I can't tell from paper, but I suspect in the implementation it spends a bit of computational time to adjudicate that 1/4 is closer than 2/4 and so chooses that one

COURSE PLAYLISTS:
►DISCRETE MATH: youtube.com/playlist?list=PLHXZ9OQGMqxersk8fUxiUMSIx0DBqsKZS
►LINEAR ALGEBRA: youtube.com/playlist?list=PLHXZ9OQGMqxfUl0tcqPNTJsb7R6BqSLo6
►CALCULUS I: youtube.com/playlist?list=PLHXZ9OQGMqxfT9RMcReZ4WcoVILP4k6-m
►CALCULUS II: youtube.com/playlist?list=PLHXZ9OQGMqxc4ySKTIW19TLrT91Ik9M4n
►MULTIVARIABLE CALCULUS (Calc III): youtube.com/playlist?list=PLHXZ9OQGMqxc_CvEy7xBKRQr6I214QJcd
►VECTOR CALCULUS (Calc IV) youtube.com/playlist?list=PLHXZ9OQGMqxfW0GMqeUE1bLKaYor6kbHa
►DIFFERENTIAL EQUATIONS: youtube.com/playlist?list=PLHXZ9OQGMqxde-SlgmWlCmNHroIWtujBw
►LAPLACE TRANSFORM: youtube.com/playlist?list=PLHXZ9OQGMqxcJXnLr08cyNaup4RDsbAl1
►GAME THEORY: youtube.com/playlist?list=PLHXZ9OQGMqxdzD8KpTHz6_gsw9pPxRFlX

OTHER PLAYLISTS:
►Cool Math Series:
youtube.com/playlist?list=PLHXZ9OQGMqxelE_9RzwJ-cqfUtaFBpiho
► Learning Math Series
youtube.com/watch?v=LPH2lqis3D0&list=PLHXZ9OQGMqxfSkRtlL5KPq6JqMNTh_MBw


SOCIALS:
►X/Twitter: http://X.com/treforbazett
►TikTok: tiktok.com/@drtrefor
►Instagram (photography based): instagram.com/treforphotography
How Google designed a smarter calculator than AppleThe Evolution of Cooperation // Iterated Prisoners DilemmaMy favorite LaTeX Tricks to save timeIs math research over?The Theory of 2nd Order ODEs // Existence & Uniqueness, Superposition, & Linear IndependenceParsevals Identity, Fourier Series, and Solving this Classic Pi FormulaThis Infinitely Differentiable Function Breaks Taylor SeriesDoes Assembly Theory Explain Life? Lets do the math.Will math ever be completely solved?Math News: The Fish Bone Conjecture has been deboned!!MATH PROF vs TRICKY INTEGRALSMy favorite use of factorials
Dr. Trefor Bazett |

How Google designed a smarter calculator than Apple

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER