IEEE 754 requires that conforming implementations provide square root and operations to convert from decimal to floating-point that are correctly rounded:
All conforming implementations of this standard shall provide the operations listed in this clause for all supported arithmetic formats, except as stated below. Each of the computational operations that return a numeric result specified by this standard shall be performed as if it first produced an intermediate result correct to infinite precision and with unbounded range, and then rounded that intermediate result, if necessary, to fit in the destination’s format…
The rounding mode used most commonly rounds to the nearest representable value. In case of a tie, it rounds to the value with the even low bit. A variant on that rounds ties away from zero.
Regarding question 1, suppose x
< y
but sqrt(x)
> sqrt(y)
. Since square root is monotonic, then either sqrt(x)
must be closer to the mathematical square root of y
than sqrt(y)
is or sqrt(y)
must be closer to the mathematical square root of x
than sqrt(x)
is. So this would violate the rounding rules.
Other rounding rules rounding to the nearest number in a particular direction, one of toward +infinity, toward −infinity, or toward zero. Disordered sqrt
results would violate those rounding rules too.
Note that many platforms will claim to use IEEE 754 format, but that does not mean they conform to IEEE 754 rules for operations, including square root and conversion from decimal to floating-point.
Question 2 is identical.
Question 3 holds with identical reasoning (applied twice: op
is weakly monotonic, and sqrt
is weakly monotonic) subject to the proviso that a and b are non-negative (or are so small in magnitude that x
[or y
] zero even though a [or b] is negative, due to rounding during the conversion). Otherwise, you could have a < b, but sqrt(x) <= sqrt(y)
does not hold because x
is a NaN, which is not less than or equal to anything.
Question 4 holds, now with weak monotonicity applied three times.
sqrt
is an operation that compresses the entire floating-point range into approximately half of that range, so you're bound to end up with some cases wherex != y
butsqrt(x) = sqrt(y)
. – Antonomasia