(cons (log 2) 1.)
(cons 0.7 1.0137527074704766))
(lambda (v)
- (assert->= 1e-15 (relerr (cdr v) (expm1 (car v))))))
+ (assert-<= (relerr (cdr v) (expm1 (car v))) 1e-15)))
(define-enumerated-test 'log1p-approx
(vector
(cons (- 1 (sqrt 1/2)) 0.25688251232181475)
(cons 0.3 .26236426446749106))
(lambda (v)
- (assert->= 1e-15 (relerr (cdr v) (log1p (car v))))))
+ (assert-<= (relerr (cdr v) (log1p (car v))) 1e-15)))
(define-enumerated-test 'log1mexp
(vector
(cons -0.70 -0.686341002808385170)
(cons -708 -3.30755300363840783e-308))
(lambda (v)
- (assert->= 1e-15 (relerr (cdr v) (log1mexp (car v))))))
+ (assert-<= (relerr (cdr v) (log1mexp (car v))) 1e-15)))
(define-enumerated-test 'log1pexp
(vector
(let ((x (vector-ref v 0))
(p (vector-ref v 1))
(t (vector-ref v 2)))
- (assert->= 1e-15 (relerr p (logistic x)))
+ (assert-<= (relerr p (logistic x)) 1e-15)
(if (and (not (= p 0))
(not (= p 1)))
- (assert->= 1e-15 (relerr x (logit p))))
+ (assert-<= (relerr x (logit p)) 1e-15))
(if (< p 1)
(begin
- (assert->= 1e-15 (relerr (- 1 p) (logistic (- x))))
+ (assert-<= (relerr (- 1 p) (logistic (- x))) 1e-15)
(if (<= 1/2 p)
- (assert->= 1e-15 (relerr (- x) (logit (- 1 p))))))
- (assert->= 1e-300 (logistic (- x))))
- (assert->= 1e-15 (relerr t (log-logistic x)))
+ (assert-<= (relerr (- x) (logit (- 1 p))) 1e-15)))
+ (assert-<= (logistic (- x)) 1e-300))
+ (assert-<= (relerr t (log-logistic x)) 1e-15)
(if (<= x 709)
- (assert->= 1e-15 (relerr x (logit-exp t))))
+ (assert-<= (relerr x (logit-exp t)) 1e-15))
(if (< p 1)
- (assert->= 1e-15 (relerr (log1p (- p)) (log-logistic (- x))))))))
\ No newline at end of file
+ (assert-<= (relerr (log1p (- p)) (log-logistic (- x))) 1e-15)))))
\ No newline at end of file