F
Fredrik Johansson
fredrikj.net · Personal blog · on HN since 2012
Fredrik Johansson writes about arbitrary-precision numerical software, including the Arb and Calcium C libraries and rigorous numerical computation.
What HN saysCommenters call Calcium amazing for treating constants like pi and e as first-class numbers, and link his Arb integration post as interesting reading.
29HN people shared it
9linked it in comments
25stories submitted
540story points
2 years agolast shared
2012people per year2026
Most-shared posts
- 1Developing mathematical software in C (2021)3 people · 18 points · first shared 2021 · 2 comments on HN
- 2High-Precision Linear Algebra in Julia: BigFloat vs. Arb3 people · 9 points · first shared 2018 · 1 comments on HN
- 3Rigorous Numerical Integration in Arb (2017)3 people · 2 points · first shared 2021 · discussion on HN
- 4A Grimoire of Functions2 people · 150 points · first shared 2019 · 21 comments on HN
- 5Calcium: Exact real and complex numbers in C2 people · 4 points · first shared 2020 · discussion on HN
- 6Arb: a C library for arbitrary-precision floating-point ball arithmetic2 people · 2 points · first shared 2013 · discussion on HN
- 7Index2 people · first shared 2023
- 8Things I would like to see in a computer algebra system1 people · 130 points · first shared 2022 · 19 comments on HN
- 9New partition function record: p(10^20) computed1 people · 105 points · first shared 2014 · 23 comments on HN
- 10Printing Algebraic Numbers1 people · 87 points · first shared 2021 · 6 comments on HN
- 11Computing Bell numbers1 people · 17 points · first shared 2015 · discussion on HN
- 12Computing with Metavalues1 people · 3 points · first shared 2021 · discussion on HN
- 13Factorials mod n and Wilson’s theorem1 people · 2 points · first shared 2012 · discussion on HN
- 14Citing Papers in Software (2021)1 people · 2 points · first shared 2024 · discussion on HN
- 15Mpmath 1.0, and a ten-year retrospective [Python arbitrary precision numerics]1 people · 2 points · first shared 2017 · discussion on HN
What HN people wrote when they linked it
jfoutz · 2023-02-08
just yesterday someone commented about https://fredrikj.net/calcium/index.html
which is pretty darn amazing. pi and e are essentially first class, but a lot of transcendentals aren't. seems like a really neat approach.
smasher164 · 2022-03-07
Great work! I like how well considered the design is. This calculator takes a point in the design space with text input, equation rendering, a grapher, and Big Int/Floats for number representation.
I wonder if the author considered an input method where keypresses translate directly into a rendered equation? Symbolab kind of does this, so instead of writing an expression in some functional style and seeing its rendered output, I can directly manipulate the rendered equation with the keyboard.
The other point the author makes about discoverability of operators like sqrt and cbrt, I feel that you could circumvent it by introducing a semantic search feature for operators. For example, typing "square root" would display a list of suggestions for operators that match that, like an IDE.
The last question I have is if the author has looked at libraries like Calcium (https://fredrikj.net/calcium/) or the work that went into the Android calculator recently (https://dl.acm.org/doi/pdf/10.1145/3385412.3386037). They use exact arithmetic with computable real/complex numbers. It might serve as a cleaner abstraction that switching between different BigNum representations yourself.
zokier · 2022-01-28
> When I started working on this I thought that I might want to switch to "binary coded decimal"[0] to avoid issues with inputs like (0.1 + 0.2 - 0.3).
If you want to go this route, there are standardized decimal floating points, e.g. https://en.wikipedia.org/wiki/Decimal64_floating-point_format (or the 128 bit version).
> And is there an implementation I could use?
Afaik Boehms implementation lived only in the Android source tree, i.e. https://android.googlesource.com/platform/packages/apps/ExactCalculato… . So to use that you'd need to extract and port them, which might be some effort.
There are all sorts of different approaches for doing calculations on real numbers. I think Johanssons work is particularly impressive in this domain, but I'm not sure if that is much use for a calculator like this: https://fredrikj.net/
moonchild · 2024-06-26
you may find this interesting if you haven't seen it already: https://fredrikj.net/blog/2017/11/new-rigorous-numerical-integration-i…
panic · 2023-02-07
Hey, that's me! Though I mention it in the post, I also want to give a shoutout here to libcalcium, which handles the somewhat magical task of representing and comparing exact algebraic numbers: https://fredrikj.net/calcium/index.html.
fdej · 2022-04-27
There is an algorithm by Richardson to prove equality of real and complex numbers composed from exponentials and logarithms. (It doesn't have a complete proof of correctness, but it never returns a wrong result: it will loop forever iff it encounters a counterexample to Schanuel's conjecture.)
It can also be extended to higher transcendental functions, but it gets harder to guarantee termination.
I have a library for exact reals/complexes with an incomplete implementation of Richardson's algorithm: https://fredrikj.net/calcium/
wbhart · 2015-09-29
There's a little bit more information in Fredrik J's blog post: http://fredrikj.net/blog/2015/09/finding-nemo/
wbl · 2014-03-27
That's called ball arithmetic, and there are many libraries for it, such as arb. http://fredrikj.net/arb/ It's useful in mathematical calculation, but usually with floating point calculations you have some error bounds coming from your algorithm which are "good enough" if the result is going to be the value of something with 5% tolerance.
peter_d_sherman · 2024-01-28
>"When computers revealed all those smaller copies of the Mandelbrot set within itself, Douady and Hubbard wanted to explain their presence. They ended up turning to what’s known as renormalization theory, a technique that physicists use to tame infinities in the study of quantum field theories, and to connect different scales in the study of phase transitions."
https://en.wikipedia.org/wiki/Renormalization
Rampant conjecture/speculation: In the future, perhaps some Mathematician might discover a link between Renormalization Theory -- and the Digits Of Pi... since they seem related...
More specifically, between Renormalization Theory -- and algorithms for the Digits of Pi.
Of which, one notable one is The Chudnovsky algorithm:
https://en.wikipedia.org/wiki/Chudnovsky_algorithm
Which leads to Binary Splitting:
https://en.wikipedia.org/wiki/Binary_splitting
Which leads to Hypergeometric Series:
https://en.wikipedia.org/wiki/Hypergeometric_function#The_hypergeometr…
Which leads to Gauss' continued fraction:
https://wikimedia.org/api/rest_v1/media/math/render/svg/4d54114465d858…
https://en.wikipedia.org/wiki/Hypergeometric_function#:~:text=Gauss%27…
https://en.wikipedia.org/wiki/Gauss%27s_continued_fraction
Which leads to Analytic continuation of 3F2, 4F3 and higher functions:
https://fredrikj.net/blog/2009/12/analytic-continuation-of-3f2-4f3-and…
Which leads to my brain hurting ("Put down…