[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: New approach to annex D of the 754-R proposal.
Here is a possible mathematical description of when functions should
return special values and, if so, which. Please note that it is nearly
40 years since I did this sort of mathematics more than incidentally,
and I may make stupid errors and abuse terminology, but I am pretty sure
that I can get this right in principle.
A function is a mapping from a set A to a set B; both A and B are
assumed to be product spaces where the individual dimensions are
discrete sets, extended real numbers or extended complex numbers (note
that A and B need not be the same). They have norms (||) defined to be
the square root of the sum of:
For a discrete dimension, 1 if the values are different and 0
otherwise.
For a real one (extended with positive and negative infinity),
min(|x-y|^2,|1/x-1/y|^2) - note that the sign of zero has no effect.
For a complex one (extended with a single infinity), the same
as for reals.
A function f is defined at a point a in A if there is a value b in B
such that:
For all real e > 0, there is a real value d > 0, such that
there is at least one point x with |x-a| < d where it is defined
and |f(x)-b| < e for all |x-a| < d where it is defined.
[ I take the hard line here to exclude certain multi-dimensional
functions with snail-shell-like properties that you don't want to have
to map to computer arithmetic. Note that I don't require the function
to be defined everywhere, or even on a Borel set! ]
If that cannot be done, the function is not defined at point a (and
hence should return an error indication).
The above means that sqrt(0) = 0, [real] log(0) = -inf, [complex]
log(0) = NaN, but cot(0) = NaN. And 1/0 = NaN!
Now, it isn't much harder to define what computer arithmetic values
may be returned to stay within defined bounds in the simple cases
(e.g. functions returning a scalar or ones returning a multiple
where the target set is the whole space), but it gets gradually
trickier as you extend the domain.
So, for THAT aspect, you need to decide what domains are being
considered.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@xxxxxxxxx
Tel.: +44 1223 334761 Fax: +44 1223 334679