(in)exactness of complex numbers

Bengt Richter bokr at accessone.com
Fri Aug 3 03:07:10 EDT 2001


On Thu, 2 Aug 2001 11:55:02 -0400, "Steve Holden" <sholden at holdenweb.com> wrote:
[...]
>
>What has not so far been explicitly stated (although several posts have
>implied it) is that complex numbers are in fact points on a two-dimensional
>plane. If we choose to represent those points as distances along two
>orthogonal axes then the concept of exactness might be said to have some
>meaning for the points at the intersections of two integral values. But if
>we choose to represent an "exact" complex number (by the previous
>definition) in polar coordinates (angle & magnitude) then the same complex
>number would become inexact. Even though there is a strict mathematical
>relationship between polar and orthogonal representations (which is many to
>one, BTW), the transformations would render exactness a less than useful
>concept. A similarly "exact" polar representation would become inexact in
>orthogonal representations.
>
>Hence I now believe exactness is not useful for complex values. Not that it
>couldn't be implemented if somebody perverse enough chose to. Simply that it
>wouldn't be useful.
>
I am perverse enough to think it could be useful, but maybe not perverse
enough to implement it ;-)

My thought is that what the computer can usefully tell us about exactness
is how well it succeeds in preserving it through some operation(s). It needs
to be told that the inputs are exact, but it can tell us whether the result
is exact. Programmed operations are always on representations, resulting in
representations, obviously.

Representation in polar or cartesian form would lose exactness through
different operations, but e.g., multiplying by (2+0j) could presumably
be exact either way. Either way you'd have a pair of numbers, but the
operations on the components would be different, though related in result
through the point they identify (identify differently, which I guess was
Greg's first point, though the rest was about other uses of number pairs,
which was beside the point w.r.t. the uses of having accurate representations
for the numbers *in* number pairs representing complex values, whichever
kind of pair it might be).

If angles were represented as rational coefficients for pi radians instead
of one radian, a fair number of angles could be represented exactly.

The criterion for exactness here would be that operating on the finite-precision
representations of the inputs would result in a finite-precision output equal
in mathematical value to what would have been the case if all the representations
had been infinite precision. If there are two components to the representation,
then the criterion applies to each separately.

This would require two separate representations of complex, both in literals and
internally, and conversions between could only be exact in a few trivial cases.

You would want exactness attributes for both components in either representation,
I think. Sometimes a conversion could produce one exact component, which if carried
as such might be the one of most interest in the end. E.g., sin(pi/6) = 1/2 exactly.
Of course, you'd have to be pretty perverse and check exact lookups for some of these
before sending them through IEEE754 functions ;-)

I've never done anything with exact complex numbers, so I don't know how it could
really be used. I guess you could say the angles in an FFT are implicitly exact,
but I don't know how you could do the whole thing exactly, except maybe a trivial case.

IIRC, Henry Baker(?) wrote something about exact integer cartesian-represented complex
in some ACM SIG article, but I don't remember much more than that.




More information about the Python-list mailing list