(The article's original title -- "To compute a constant of calculus: A treatise on multiple ways" -- described its purpose better than the truncated one submitted here on HN. I see posters suggesting various solutions. Perhaps someone will create a public repo based on the article and then folk can add solutions.)
> did not see the extremely easy and quite efficient method of calculating e through continued fractions.
(That could be misinterpreted by readers of this thread who have not read the OP. The OP includes several continued fractions, including ones that seem simpler to me than the one you've shown, though that might be because I'm no expert.)
I'm curious what name is normally given to the fraction you showed? And are you saying it is more efficient than the Brother series?
You made me curious. It's easy to see that the Maclaurin series converges quickly by the nature of the terms.
Since e ≈ 2.7 1828 1828 459, it is very close to the rational number 271,801/99,990 = 2.7(1828) . A continued fraction expansion should pick up on that approximation quite quickly, which will make the expansion look efficient. Will the continued fraction continue converging as quickly if you keep going after you reach that particular rational approximation?
The code in this post is in Raku[0] — pretty much the perfect language for expressing something in "multiple ways". There's More Than One Way To Do It, as we like to say.
I just skimmed through, but I didn’t see the method I expected to find: Use the Taylor series for f(x) = e^x around f(0) to compute e = f(1). Should be pretty efficient and straightforward, right?
Yes, the Taylor series converges very quickly, but for some reason the author insists on only using the problem that originally introduced Bernoulli and Euler to the number e.
Reading this reminds me of Leibniz's formula for pi:
Although it computes the value correctly, it is almost completely useless on a computer. All the elements of the series are reciprocals of odd numbers, hence you will get errors on every term.
Are you saying that because (typically) arbitrary precision rationals are too slow, and floating point yields errors, or for some other reason?
(Raku supports arbitrary precision rationals, and they're normalized to minimize the denominator size, and remain pretty performant until the denominator exceeds 64 bits, so I'm thinking they might do OK for correctly computing transcendentals to maybe 15 decimal digits or so.)
[+] [-] clangcmp|4 years ago|reply
[+] [-] raiph|4 years ago|reply
(The article's original title -- "To compute a constant of calculus: A treatise on multiple ways" -- described its purpose better than the truncated one submitted here on HN. I see posters suggesting various solutions. Perhaps someone will create a public repo based on the article and then folk can add solutions.)
> did not see the extremely easy and quite efficient method of calculating e through continued fractions.
(That could be misinterpreted by readers of this thread who have not read the OP. The OP includes several continued fractions, including ones that seem simpler to me than the one you've shown, though that might be because I'm no expert.)
I'm curious what name is normally given to the fraction you showed? And are you saying it is more efficient than the Brother series?
[+] [-] thaumasiotes|4 years ago|reply
Since e ≈ 2.7 1828 1828 459, it is very close to the rational number 271,801/99,990 = 2.7(1828) . A continued fraction expansion should pick up on that approximation quite quickly, which will make the expansion look efficient. Will the continued fraction continue converging as quickly if you keep going after you reach that particular rational approximation?
[+] [-] miguelmurca|4 years ago|reply
[+] [-] codesections|4 years ago|reply
[0]: https://docs.raku.org
[+] [-] bjornsing|4 years ago|reply
[+] [-] phkahler|4 years ago|reply
Is that the one where e = 1 + 1/1! + 1/2! + 1/3! + ... ?
Steve Wozniak used that method to compute several thousand digits of e on an Apple II back in the day. I think Byte ran an article on it.
Super easy because each term is just the previous term divided by N.
[+] [-] raiph|4 years ago|reply
[+] [-] not2b|4 years ago|reply
[+] [-] clangcmp|4 years ago|reply
[+] [-] self_buddliea|4 years ago|reply
Although it computes the value correctly, it is almost completely useless on a computer. All the elements of the series are reciprocals of odd numbers, hence you will get errors on every term.
[+] [-] raiph|4 years ago|reply
(Raku supports arbitrary precision rationals, and they're normalized to minimize the denominator size, and remain pretty performant until the denominator exceeds 64 bits, so I'm thinking they might do OK for correctly computing transcendentals to maybe 15 decimal digits or so.)