[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comparison operators and *typos
| Date: Thu, 07 Jul 2005 10:46:31 -0400
| From: Paul Schlie <schlie@xxxxxxxxxxx>
| > | Date: Wed, 06 Jul 2005 13:55:40 -0400
| > | From: Paul Schlie <schlie@xxxxxxxxxxx>
| > |
| > | Where absolute zero is designated as 0, and who's reciprocal is 0, as
| > | the average value of it's -1/0 and +1/0 limits would be 0; as would 0/0,
| > Then the FINITE? predicate becomes useless.
| - so?
This SRFI attempts to strike a balance between tolerance and
signaling of range errors. Having #i+/0 and #i-/0 allows one level
of calculation to be executed before bounds checking.
That detection is via the FINITE? procedure.
Subsequent numerical calculations on infinities can signal an error
or return a non-real infinity: #i0/0. #i0/0 can be considered an
error waiting to happen.
I'm sorry that SRFI-70 can't accommodate your proposals. They are
complicated and nonuniform; they don't significantly improve upon the
capabilities of SRFI-70; and you have not grounded them in terms of
standard mathematical constructs.
| > | (limit (lambda (x) (tan x)) (pi/2 -0/1)) => +1/0
| > | (limit (lambda (x) (tan x)) (pi/2 +0/1)) => -1/0
| > |
| > | (+ 4. (/ (abs 0) 0)) => 4.0
| > | (limit (lambda (x) (+ 4. (/ (abs x) x))) (0 -0/1)) => 3.0
| > | (limit (lambda (x) (+ 4. (/ (abs x) x))) (0 +0/1)) => 5.0
| > LIMIT already handles these cases correctly. But I am unconvinced
| > that a procedure can automatically pick the evaluation points given no
| > information about the test function.
| - it seems fairly straight foreword to for +-0/1 to imply the use
| of the smallest value representable by an implementation as the
| delta value in it's calculation of a limit value its argument's
That doesn't work in general. Intermediate quantities in a
calculation can overflow or underflow if the delta is too small.
(define (func x) (expt (+ (/ x) (exp (/ x)) (exp (/ 2 x))) x))
;;The mathematically correct answer is e^2 = 7.3890560989306504:
(limit func 0 1/40) ==> 7.3890560989306504
(limit func 0 1/41) ==> #i0/0
(limit func 0 1/42) ==> #f
(limit func 0 1/43) ==> #i+/0
(limit func 0 1/444) ==> #i+/0
(limit func 0 1e-323) ==> #i+/0