Desmos not plotting the obvious inequality correctly?

78 Views Asked by At

I was checking the subadditivity of the function $f\colon x\mapsto \min(1, x)$, i.e., whether $f(x + y)\le f(x) + f(y)$ and was expecting that the entire first quadrant would be colored. However, the following was outputted:

enter image description here

But clearly, for nonnegative $x, y$ satisfying $x + y < 1$, $f(x + y) \le f(x) + f(y)$ reduces to $x + y\le x + y$, which is true! So, what is Desmos doing here? (Interested in knowing "what went wrong" in Desmos' plotting alog's (of which I have no knowledge of, and would be delighted to be enlightened about!).)

To investigate, I also tried plotting $x + y\le x + y$ (or simply $x\le x$ for that matter), and Desmos showed no shaded region!


Edit

The correct plot should have been the first and the third quadrants translated by $(1, 1)$. It turns out that the region that Desmos has wrongly omitted to plot is precisely where the equality holds, that is, where $f(x + y) = f(x) + f(y)$, and as Kurt G. points out, this might be due to having x == y for floats x, y instead of demanding that abs(x - y) be smaller than a small positive precision. And indeed, plotting $|f(x + y) - f(x) - f(y)| < 0.0001$ gives the (approximate) remaining portion:

enter image description here