From 528f857892781a7352980f81e303d95348417b62 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 27 Oct 2018 02:11:14 +0000 Subject: [PATCH] log1pexp(x) is never exactly x even if that's the best approximation. --- src/runtime/arith.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/arith.scm b/src/runtime/arith.scm index ebe1e0ac4..ee2d0471f 100644 --- a/src/runtime/arith.scm +++ b/src/runtime/arith.scm @@ -2029,7 +2029,7 @@ USA. ((<= x flo:log-epsilon) (exp x)) ((<= x 18) (log1p (exp x))) ((<= x 33.3) (+ x (exp (- x)))) - (else x))) + (else (exact->inexact x)))) ;;; Lemma 1. If |d'| < 1/2, then |(d' - d)/(1 + d')| <= 2|d' - d|. ;;; -- 2.25.1