Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    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.

    Visit blogRSSHN submissions
    MathProgramming
    What HN says

    Commenters call Calcium amazing for treating constants like pi and e as first-class numbers, and link his Arb integration post as interesting reading.

    Stats for nerds
    29HN people shared it
    25linked in comments
    540story points
    Jun 2024last shared
    2014people per year2024

    Top posts on HN

    1. 1
      A Grimoire of Functions
      2 people · 150 points · first shared 2019 · 21 comments on HN
    2. 2
      Things I would like to see in a computer algebra system
      1 person · 130 points · first shared 2022 · 19 comments on HN
    3. 3
      New partition function record: p(10^20) computed
      1 person · 105 points · first shared 2014 · 23 comments on HN
    4. 4
      Printing Algebraic Numbers
      1 person · 87 points · first shared 2021 · 6 comments on HN
    5. 5
      Developing mathematical software in C (2021)
      3 people · 18 points · first shared 2021 · 2 comments on HN
    6. 6
      Computing Bell numbers
      1 person · 17 points · first shared 2015 · Discussion on HN
    7. 7
      High-Precision Linear Algebra in Julia: BigFloat vs. Arb
      3 people · 9 points · first shared 2018 · 1 comments on HN
    8. 8
      Calcium: Exact real and complex numbers in C
      2 people · 4 points · first shared 2020 · Discussion on HN
    9. 9
      Computing with Metavalues
      1 person · 3 points · first shared 2021 · Discussion on HN
    10. 10
      Rigorous Numerical Integration in Arb (2017)
      3 people · 2 points · first shared 2021 · Discussion on HN

    What HN people wrote when they linked it

    • peter_d_shermanJan 2024

      >"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_hypergeometric_series

      Which leads to Gauss' continued fraction:

      https://wikimedia.org/api/rest_v1/media/math/render/svg/4d54114465d858bd4de8e8bb87818d19d9e2da38

      https://en.wikipedia.org/wiki/Hypergeometric_function#:~:text=Gauss%27%20continued%20fraction

      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-higher-functions/

      Which leads to my brain hurting ("Put down…

    • smasher164Mar 2022

      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.

    • zokierJan 2022

      > 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/ExactCalculator/+/7265aa3a922a7e7c0389dae4b26cca562aa777a6/src/com/android/calculator2/UnifiedReal.java . 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/

    • fdejApr 2022

      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/

    • wblMar 2014

      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.

    • panicFeb 2023

      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.

    Related

    Oleg Kiselyovokmij.org251 people

    How the OCaml type checker works (2022)

    Oleg Kiselyov
    Personal · last shared 2026
    Landon Curt Nollisthe.com19 people

    On becoming an expert C programmer

    Landon Curt Noll
    Personal · last shared 2021
    Alan Wolfeblog.demofox.org54 people

    Derivatives, Gradients, Jacobians and Hessians

    Alan Wolfe
    Personal · last shared 2026
    Paul Khuongpvk.ca106 people

    SBCL: The Ultimate Assembly Code Breadboard

    Paul Khuong
    Personal · last shared 2026
    Jeremy Kunjeremykun.com194 people

    A Programmer's Introduction to Mathematics

    Jeremy Kun
    Personal · last shared 2026
    Bryan O'Sullivanserpentine.com49 people

    Github is making me feel stupid(er)

    Bryan O'Sullivan
    Personal · last shared 2021
    Keith Schwarzkeithschwarz.com50 people

    Darts, Dice, and Coins: A beautiful article on a beautiful algorithm

    Keith Schwarz
    Personal · last shared 2026
    Tomas Petricektomasp.net152 people

    Write your own Excel in F# (2018)

    Tomas Petricek
    Personal · last shared 2026