Hacker News new | past | comments | ask | show | jobs | submit | hakmem's comments login

You can see both triples are contained in one binary tree using the big diagram in section 3. The triple [3 4 5] has the "path" RR. The triple [4 3 5] the path R.


Yes, this is normal. I am sorry, I am working on a more efficient implementation.

The JavaScript of this page does a lot of number crunching.

It is actually doing arithmetic on the Stern-Brocot tree. It is all written in ClojureScript and not really optimized yet. I mention in the paper that I do not even use TCO.

Anyway, thank you - and all the people here - for the kind words! I am so happy that my article was so well received today.


A simple trick to solve nearly all freezing problems: move the computations to a background thread, aka Worker in JS terms.


Another trick — use comlink (https://github.com/GoogleChromeLabs/comlink) to make the worker thread into essentially an async API of your local methods.


Until July 17 we only knew the first five numbers of the sequence https://oeis.org/A006052. Now we know 6.

"Using hundreds of GPUs at cloud resource rental services, it took about six months to complete the counting"

Great work by Prof emeritus Hidetoshi Mino. He's inviting interested people to check for errors.


+ - * ÷ two numbers in 3.14 decimal notation, 1RLLRRLLRRLLRR stern–brocot notation, or [1;1,2,1] something close to continued fraction notation

Milad Niqui: Exact arithmetic on the Stern-Brocot tree. https://core.ac.uk/download/pdf/82481132.pdf

HAKMEM p. 40 - ITEM 101B (Gosper): Continued Fraction Arithmetics https://w3.pppl.gov/~hammett/work/2009/AIM-239-ocr.pdf


Hey, this is quite interesting!

I vouched for your submission and your comment. Just wanted to let you know that there seems to be some issue with your account causing your comments and submissions to be automatically flagged. You may want to contact HN moderators (hn@ycombinator.com) about that.


Thank you for both vouching and the hinting on my flagging.


A couple of days ago, there also has been a disussion on reddit on this topic.

https://www.reddit.com/r/Physics/comments/gf1kbd/if_you_over...


The authors have a look at the spectral line database of the NIST and make the surprising finding, that all atomic spectral lines together approximate very well a black body spectrum at a temperature of 9000K.

The authors not yet have an explanation for this conundrum, but also note, that this temperature plays a role in the formation theory of the universe.


Don't know why you have been down-voted - thanks for the TL;DR.


There are a lot of pearls in this - I would call it lab book.

A while ago, I made a slow Clojure implementation of a generalized version of Bill Gospers continued fraction arithmetics from the HAKMEM

http://github.com/timrichardt/stern-brocot-tree


Ten years ago, I implemented Gosper's continued fraction arithmetics in Python: http://sun.aei.polsl.pl/~mciura/software/cf.py My module can also compute exp() and log() as well as trigonometric and inverse trigonometric functions. Here are slides from my presentation about it: http://sun.aei.polsl.pl/~mciura/cf.pdf


Great, I will definitely have a look at it. Did you implement exp(x) for any continued fraction x?


Yes. The key to that is approximating reals by the second Ostrogradsky series (or, more properly, Ostrogradsky-Sierpiński series): x = ⎣x⎦ + 1/q₁ − 1/q₂ + 1/q₃ - 1/q₄ + ⋯, where the denominators qₖ are greedily chosen as the largest possible. The following formulas are true: exp(1/q) = [1; q−1, 1, 1, 3q−1, 1, 1, 5q-1,…], exp(x + y) = exp(x)exp(y), and exp(x - y) = exp(x)/exp(y). The algorithm keeps two most recent partial sums of the O-S series: sₖ₋₁ and sₖ. As long as the partial quotients of exp(sₖ₋₁) and exp(sₖ) are equal, it emits them; otherwise, it computes the next partial sum sₖ₊₁. Similar formulas work for tan(x).


try the continuous logarithms now! they are very beautiful and more natural to implement in modern computers


Could you point me to a reference?


this is actually the sole appendix of HAKMEM, (and one of my favorite text files ever)

https://perl.plover.com/classes/cftalk/INFO/gosper.txt


Guessed it but you wrote "continuous" instead of "continued" :) I was excited about something new ;)

And yes, this text is gold. Bill Gosper is the Hunter S. Thompson of science.


yes, of course I meant "continued" (this is a common error by speakers of latin languages since we use the same word for both things)


Yeah, this is Hacker News.


Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: