Commit 7b81dc8b authored by Daniel Kochmański's avatar Daniel Kochmański

numbers: atan: remove extra map nesting

previously we had two map, which were appended, now we have one lambda
function, so there is no need for it.
parent 61b33de4
...@@ -134,8 +134,7 @@ ...@@ -134,8 +134,7 @@
;; (atan +-0 +(anything-but-nan)) -> +-0 ;; (atan +-0 +(anything-but-nan)) -> +-0
;; (atan +-0 -(anything-but-nan)) -> +-pi ;; (atan +-0 -(anything-but-nan)) -> +-pi
;; (atan +-(anything-but-0/nan) 0) -> +-pi/2 ;; (atan +-(anything-but-0/nan) 0) -> +-pi/2
(every #'identity (every (lambda (n)
(map 'list (lambda (n)
;; notice, that we don't test a case, where ;; notice, that we don't test a case, where
;; both arguments are 0.0, because if ;; both arguments are 0.0, because if
;; implementation doesn't support signed 0 ;; implementation doesn't support signed 0
...@@ -144,7 +143,7 @@ ...@@ -144,7 +143,7 @@
(+pi-p (atan 0.0 (- n))) (+pi-p (atan 0.0 (- n)))
(+pi/2-p (atan n 0.0)) (+pi/2-p (atan n 0.0))
(-pi/2-p (atan (- n) 0.0)))) (-pi/2-p (atan (- n) 0.0))))
(remove-if-not #'plusp *floats*)))) (remove-if-not #'plusp *floats*)))
T) T)
(deftest atan.ieee.2 :description "Verify ATAN handling signed zero" (deftest atan.ieee.2 :description "Verify ATAN handling signed zero"
...@@ -162,13 +161,12 @@ ...@@ -162,13 +161,12 @@
(-zerop (atan -0.0 +0.0)) (-zerop (atan -0.0 +0.0))
(+pi-p (atan +0.0 -0.0)) (+pi-p (atan +0.0 -0.0))
(-pi-p (atan -0.0 -0.0)) (-pi-p (atan -0.0 -0.0))
(every #'identity (every (lambda (n)
(map 'list (lambda (n)
(and (-zerop (atan -0.0 n)) (and (-zerop (atan -0.0 n))
(+zerop (atan +0.0 n)) (+zerop (atan +0.0 n))
(+pi-p (atan +0.0 (- n))) (+pi-p (atan +0.0 (- n)))
(-pi-p (atan -0.0 (- n))))) (-pi-p (atan -0.0 (- n)))))
(remove-if-not #'plusp *floats*)))))) (remove-if-not #'plusp *floats*)))))
T) T)
;;; We could have tested also for infinities and nan's, but there is ;;; We could have tested also for infinities and nan's, but there is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment