From a4cd0145b5c68aaf34db94ef7f39d4a68bf377bd Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Sun, 14 Dec 1997 15:28:27 +0000
Subject: [PATCH] Fix the log and sqrt derive type optimizers which I broken in
 the prior commit, also make them a little smart about the handling of a lower
 limit of 0 as only a float could be -0.0.

---
 compiler/float-tran.lisp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/compiler/float-tran.lisp b/compiler/float-tran.lisp
index ad6cecfc9..b3e487b6b 100644
--- a/compiler/float-tran.lisp
+++ b/compiler/float-tran.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.48 1997/12/14 14:10:27 dtc Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.49 1997/12/14 15:28:27 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -645,7 +645,10 @@
   ;; return value of (OR FLOAT (COMPLEX FLOAT)) is ok as the default.
   (frob sqrt #'(lambda (lo hi)
 		 (declare (ignore hi))
-		 (and lo (> (bound-value lo) 0)))
+		 (typecase lo
+		   (cons (>= (car lo) 0))
+		   (rational (>= lo 0))
+		   (float (> lo 0))))
 	0 nil)
   (frob asin #'(lambda (lo hi)
 		 (and lo hi
@@ -884,7 +887,11 @@
   (elfun-derive-type-simple
    arg #'log #'(lambda (lo hi)
 		 (declare (ignore hi))
-		 (and lo (> (bound-value lo) 0)))
+		 (format t "*D1 ~s~%"  lo)
+		 (typecase lo
+		   (cons (>= (car lo) 0))
+		   (rational (>= lo 0))
+		   (float (> lo 0))))
    nil nil))
 
 (defun log-derive-type-aux (x y same-arg)
-- 
GitLab