2
$\begingroup$

When screwing around with the Dirac-delta function in Desmos i noticed that when i multiply it by a really low-degree rational function

$$f(x)=\frac{1}{x^i}$$

, the resulting function has the domain

$$D\supset\mathbb{R}\setminus[-\varepsilon,\varepsilon]$$ where $\varepsilon$ is a positive real number.

Now of course this has to be false because $f(x)$ only has roots at $0$, so having only one asymptote.

Is this a computational/floating point error?I checked it and Geogebra has the same kind of error.

Why does the function $\frac{1}{x^{2222}}$ seem to have two asymptotes at around $\pm0.744$?

enter image description here

$\endgroup$

1 Answer 1

4
$\begingroup$

You can see the answer in any standard programming language. Here is what we see in Python, which uses 64-bit floats (sys.getsizeof(1.0) returns 24 == 16 (Python bloat) + 8 (bytes to represent float)):

In[1]: 1/(.73 ** 2222)
Out[1]: 4.972843735306971e+303
In[2]: 1/(.72 ** 2222)
Out[2]: inf

Somewhere between .73 and .72 is exactly the point at which $\frac{1}{x^{2222}}$ exceeds the largest representable floating point number, triggering it to be "inf" (infinity).

$\endgroup$
4
  • $\begingroup$ I see, my understanding of floating may be wrong because on Wikipedia i found Python's floating point to be only 64 bits, which is much smaller than this number. Did i miss something? $\endgroup$ Mar 17, 2021 at 22:02
  • 2
    $\begingroup$ You should read up on how floating point numbers are represented in memory. There is a standards paper called IEEE-754 that defines it. en.wikipedia.org/wiki/IEEE_754, a digestible video explanation is here: youtube.com/watch?v=PZRI1IfStY0 $\endgroup$
    – nullUser
    Mar 17, 2021 at 22:10
  • $\begingroup$ @LordCommander, Python floats use 64 bits, with 53 bits for the mantissa and a sign bit, leaving 10 exponent bits, which makes the range go up to about $2^{2^{10}} \approx 1.8 \cdot 10^{308}$. Remember floats are stored very differently to ints! If this doesn't make any sense to you, I'd encourage you to read a little more about how floating point numbers are stored! Wikipedia is OK but there are plenty of other places. $\endgroup$ Mar 17, 2021 at 22:10
  • 1
    $\begingroup$ @IzaakvanDongen Oh, it's $2^{2^{10}}$ i understand now, thank you! $\endgroup$ Mar 17, 2021 at 22:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .