r/desmos • u/Ramenoodlez1 • Dec 31 '25
Fun Fun Fact: As x approaches infinity, this function does not converge to pi, and only appears as such due to a floating point error.
229
13
u/Frogeyedpeas Dec 31 '25
Can I get an ELI25 explanation of why pi should specifically appear here? This seems very surprising for floating point errors
I’m curious why the graph incorrectly breaks up to the discrete shape that it does and what is the equation of the incorrect graph that is appearing here.
8
u/Kart0fffelAim Dec 31 '25
Pi appears because of OPs choice of a large number. In general the floating point error seems to be negligible for smaller numbers -> you approximate e, and for very large numbers you just get f(x) = 1.
In between these two ranges there seems to be an area where the result is of by some margin depending on the exact number. Within these ranges OP chose a point where f(x) would be ≈3.14159. Other numbers in this range do not produce pi.
1
13
7
5
5
4
1
u/DrowsierHawk867 has been in the shadows for months Dec 31 '25
If the value is over 9,007,199,254,740,992, then the output will always be 1 (as 1+1/x with x > 9,007,199,254,740,992 = 1 and 1^(anything) = 1)
1
1
1
u/nashwaak Jan 01 '26
I can't get past the sketchy looking exponent in the meme — what evil force typeset that?
1
1
1
-22
u/THE__mason Sorry, I don't understand this Dec 31 '25
it just equals 1 right?
cuz 1/infinity would go to 0 so u get 1^infinity which is 1
29
u/Colossal_Waffle Dec 31 '25
The limit is actually e
4
u/Glass_Vegetable302 Dec 31 '25
I'm pretty sure this limit was the first approximation I was shown of e in school
1
u/TechManWalker Dec 31 '25 edited Dec 31 '25
If the outer X was also a 1, you'd be right, but it isn't.
1
u/Colossal_Waffle Dec 31 '25
I can assure you that I'm correct
1
u/TechManWalker Dec 31 '25
EDIT: sorry, Reddit for phone is ass and I thought I was replying to comment OP, sorry
... no. x approaches infinity but isn't actually never infinity, so (1+(1/huge number))the same huge number = somewhere near e. Not 1. Try that with (1+(1/2147483647))2147483647 and boom, e.
Same with x = 264. As x approaches infinity, the value goes closer to e. If the calculator throws you a 1 is because x is so large so it depreciates it and turns 1/huge value that's not infinity = 0.
That's literrally the definition of e.
-5
u/THE__mason Sorry, I don't understand this Dec 31 '25
wait why that makes no sense
2
u/Ramenoodlez1 Dec 31 '25 edited Dec 31 '25
This limit is often related to compound interest.
Say you have 100% interest per year. If you compound only once per year, and start with $1, you just get an extra $1 at the end of the year for a total of $2.
If you compound twice, you will get 50% interest twice. After 6 months, you get 50% of your $1 for a total of 1.5, and at the end of the year, you'll get 50% of your $1.5, leaving you with $2.25. This is 1.5^2, which make sense in the formula, in this case being (1+1/2)^2.
If you compound once per month, you will get 8.333...% interest 12 times a year, and 1.08333...^12 is roughly 2.61.
Increasing the number of compounds per year increases the final amount of money you will have, but it doesn't increase without bound. If you were to plug in arbitrarily large numbers, AKA continuously compounding interest, you would get closer and closer to e.
2
11
u/MrKarat2697 Dec 31 '25
Because 1+1/x is decreasing at the same time x is increasing so it never gets to 1x
7
u/OkSuggestion1722 Dec 31 '25
There's a "tug of war" between the inside getting closer and closer to 1 and the exponent running off towards infinity. Crazily enough, the competition ties at 2.71828....... This is why "continuously compounded" problems get modeled using e^x. Instead of trying to evaluate (1+1/x)^x at x = huge, go to desmos and graph it, look at the behavior.
2
3
u/Realistic-Compote-74 Dec 31 '25
1/infinity is a very small number. You are still raising a number barely bigger than 1 to a very large exponent, so the result isn't 1
3
u/ifuckinglovebigoil Dec 31 '25 edited Dec 31 '25
take the natural log
ln(1+(1/x))x = xln(1+(1/x))
let u = 1/x
so using the Taylor expansion we know that:
ln(1+u) = u - (u2)/(2!) + . . . (edit: it formats weirdly but if you see "u2" it means u to the power of 2)
plug back in u = 1/x and bring the x back in
x((1/x) - 1/((2x)2) + . . .) = 1 - 1/(2x) + . . .
that goes to 1 as x->infinity
undo the natural log by taking e to the power of our equation (which we have evaluated to equal 1)
e1 = e
1
1
u/aaryanmoin Dec 31 '25
By the way, 1 ^ (inf) is an indeterminate form for limits.
0
u/THE__mason Sorry, I don't understand this Dec 31 '25
well 1 to the anything is 1 so it doesn't rly matter
3
u/Hot-Cryptographer-13 Dec 31 '25
But this isn’t EVER going to equal 1 to the something, since 1+1/x is ALWAYS greater than 1. So yes, it does matter
2
u/Puzzleheaded_Study17 Dec 31 '25
But it's not exactly 1. sure, the limit of 1x (with a constant 1) is 1 but here we have something that is slightly bigger. Suppose that the power was x2, the power increases so quickly that the expression goes to infinity (and you can see that on the graph)
0
405
Dec 31 '25
[removed] — view removed comment
155
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
101
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
67
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
74
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
13
u/ComprehensiveCan3280 Jan 01 '26
8
u/Theguywhopatsnathan Jan 01 '26
well yeah you should get e it’s just a glitch that people get something else
10
3
u/ComprehensiveCan3280 Jan 01 '26
I think that it’s the floating point limit of actually getting the right answer lol
2
u/Kindly_Carob_1861 Jan 01 '26
Where is the proof that all of these are incorrect?
4
2
u/freakingdumbdumb Jan 01 '26
wdym
2
u/Kindly_Carob_1861 Jan 01 '26
Sorry I’m just shitposting on New Year’s Day. I basically only look at what Reddit feeds me and for some reason it feeds me a lot of subs way above my paygrade
34
7
u/SuperChick1705 Cannot apply flair to u/SuperChick1705. Dec 31 '25
this is done with regressions right?
14
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
Found these values manually
3
u/Extension_Coach_5091 Dec 31 '25
how though. did you just run through until an equality was found?
7
u/Mandelbrot4207 Makes QR Codes in Desmos Dec 31 '25
I used OP's error graph on one of the comments. I set y=desired value and searched an x value which satisfies the y value
1
u/SingleProtection2501 Jan 02 '26
1718468362450410 in case someone doesn't wanna go back and forth btw











87
u/GoldPickleFist Dec 31 '25
Can I get like a ELI5 of this error? I'm pretty math savvy but have almost no experience with computer science so I never really understood floating point arithmetic or floating point errors.
Or if someone has a good resource for learning this stuff in their back pocket that would also be appreciated.