5
$\begingroup$

Assume all numbers and operations below are in floating-point arithmetic with finite precision, bounded exponent, and rounding to the nearest integer.

Are there $x,y$ positive such that $$\begin{align}(x+y)-x&>y\\(x+y)-s(x)&>y\end{align}$$ where $s(x)$ denotes the successor of $x$?


This question appeared while designing a test for a software.

It is easy to write a program that searches for such an example, but it is unfeasible to test all possibilities and show that the example doesn't exist. So far my code hasn't got any example.

Example: In case seeing an example of $(x+y)-x>y$ helps somehow, take $$ \begin{align} x&=1.1234567891234568\\ y&=1e-5\text{ ( denoting }10^{-5}) \end{align} $$ Then $(x+y)-x=1.0000000000065512e-05 > y$. There are many examples of the first inequality.


Link to scicomp.stackexchange's copy of this post in case a solution appears there first. There is already a solution there.

$\endgroup$
  • $\begingroup$ I don't see this question as being about mathematics. $\endgroup$ – 5xum Oct 3 '17 at 12:10
  • 3
    $\begingroup$ @5xum There is a field of mathematics called Numerical Analysis that studies floating point arithmetic. The question explores the magnitude of the failure of asociativity in floating point arithmetic. $\endgroup$ – EEE Oct 3 '17 at 12:14
  • 2
    $\begingroup$ @5xum And not only mathematics, it belongs to the far narrower scope that this website handles. Observe how the tag (floating-point) exists here. $\endgroup$ – EEE Oct 3 '17 at 12:28
  • $\begingroup$ Try also scicomp.stackexchange.com $\endgroup$ – lhf Oct 3 '17 at 14:04
  • $\begingroup$ I guess you want to work with rounding-to-nearest mode. For round-up mode there are examples for both. $\endgroup$ – gammatester Oct 3 '17 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.