On Monday, 17 April 2023 at 16:39:01 UTC-7 aw wrote: If properly implemented, it can emulate exact computation followed by a truncation to finite precision.
When I say a very high precision environment is for doing exact computation, I don't mean that it should handling infinite digit strings. I mean that the input-output function for such an environment should be identical to the input-output function of a hypothetical environment that *does* do the full exact computation and then truncates the answer to the requested precision. In other words, a very high precision environment should emulate an environment that does the full exact computation and truncates the result to finite precision before giving it to the user. And, this emulation should be perfect. Unfortunately, not for a fixed precision. If you're working with 200 bits precision, then you cannot express the roots of x^2-3 and x^2-(3+2^-200) as different floating point numbers. They are too close for that. If you know that two numbers are roots of polynomials with integer coefficients, you can compute a lower bound (in terms of the coefficients) on their difference if they are distinct at all. With such a bound you can indeed conclude the numbers are equal if their approximations to the required accuracy agree. This has been implemented in AlgebraicField. So if you're interested in exact arithmetic with algebraic numbers you should use that. To some extent these techniques can be extended to certain transcendental number as well. This is more experimental, but an implementation is available in RealLazyField. Fixed precision floating point is fundamentally unable to do this: the number of real numbers it can represent in the interval [1,2] is bounded (by the set precision), whereas that interval contains infinitely many rational, algebraic, and transcendental real numbers. So there are pairs of numbers in there it won't be able to represent with distinct representations. (of course computers have only finite memory so they can only represent finitely many numbers as well, so things like AlgebraicField() will run out of memory for some computations. But the bounds floating point sets are much more rigid). -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6c707636-0c83-4162-a887-8f61f5b36e81n%40googlegroups.com.