Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cmucl
cmucl
Commits
36403a83
Commit
36403a83
authored
Dec 14, 2013
by
Raymond Toy
Browse files
Correct bug in tan.
* code/irrat.lisp * Fix typo in kernel-tan. * tests/trig.lisp * Add test case.
parent
7069ef9d
Changes
2
Show whitespace changes
Inline
Side-by-side
src/code/irrat.lisp
View file @
36403a83
...
...
@@ -489,11 +489,11 @@
r
))))))))
(
when
(
=
iy
1
)
(
return-from
kernel-tan
w
))
;;
;;
Compute 1/w=1/(x+r) carefully
(
let
((
a
0d0
)
(
tt
0d0
))
(
setf
z
(
kernel:make-double-float
(
kernel:double-float-high-bits
w
)
0
))
(
setf
v
(
-
r
(
-
r
x
)))
; z + v = r + x
(
setf
v
(
-
r
(
-
z
x
)))
; z + v = r + x
(
setf
a
(
/
-1
w
))
(
setf
tt
(
kernel:make-double-float
(
kernel:double-float-high-bits
a
)
0
))
(
setf
s
(
+
1
(
*
tt
z
)))
...
...
src/tests/trig.lisp
View file @
36403a83
...
...
@@ -127,6 +127,12 @@
(
tan
(
float
11/16
1d0
))
8.21141801589894121911423965374711700875371645309d-1
)
(
rt:deftest
tan.6
;; This was found by maxima's testsuite. A bug in kernel-tan when
;; returning cot(x).
(
tan
1.107148717794091d0
)
2.0000000000000028604455051971538975562294147582d0
)
(
rt:deftest
tan.red.0
;; Test for argument reduction with n even
(
tan
(
*
7/4
pi
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment