Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
6aafca7d
Commit
6aafca7d
authored
18 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Oops. The argument reduction routine doesn't like negative numbers,
so make dd-%sin, dd-%cos, dd-%tan handle that.
parent
33d88f10
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/irrat-dd.lisp
+38
-29
38 additions, 29 deletions
code/irrat-dd.lisp
with
38 additions
and
29 deletions
code/irrat-dd.lisp
+
38
−
29
View file @
6aafca7d
...
...
@@ -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/code/irrat-dd.lisp,v 1.
5
2006/07/19 15:
0
2:00 rtoy Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/irrat-dd.lisp,v 1.
6
2006/07/19 15:2
9
:00 rtoy Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -1246,40 +1246,49 @@ pi/4 11001001000011111101101010100010001000010110100011000 010001101001100010
(
defun
dd-%sin
(
x
)
(
declare
(
double-double-float
x
))
(
if
(
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%sin
x
)
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
case
(
logand
n
3
)
(
0
(
dd-%%sin
reduced
))
(
1
(
dd-%%cos
reduced
))
(
2
(
-
(
dd-%%sin
reduced
)))
(
3
(
-
(
dd-%%cos
reduced
)))))))
(
cond
((
minusp
x
)
(
-
(
dd-%sin
(
-
x
))))
((
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%sin
x
))
(
t
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
case
(
logand
n
3
)
(
0
(
dd-%%sin
reduced
))
(
1
(
dd-%%cos
reduced
))
(
2
(
-
(
dd-%%sin
reduced
)))
(
3
(
-
(
dd-%%cos
reduced
))))))))
(
defun
dd-%cos
(
x
)
(
declare
(
double-double-float
x
))
(
if
(
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%cos
x
)
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
case
(
logand
n
3
)
(
0
(
dd-%%cos
reduced
))
(
1
(
-
(
dd-%%sin
reduced
)))
(
2
(
-
(
dd-%%cos
reduced
)))
(
3
(
dd-%%sin
reduced
))))))
(
cond
((
minusp
x
)
(
dd-%cos
(
-
x
)))
((
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%cos
x
))
(
t
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
case
(
logand
n
3
)
(
0
(
dd-%%cos
reduced
))
(
1
(
-
(
dd-%%sin
reduced
)))
(
2
(
-
(
dd-%%cos
reduced
)))
(
3
(
dd-%%sin
reduced
)))))))
(
defun
dd-%tan
(
x
)
(
declare
(
double-double-float
x
))
(
if
(
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%tan
x
)
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
if
(
evenp
n
)
(
dd-%%tan
reduced
)
(
-
(
/
(
dd-%%tan
reduced
)))))))
(
cond
((
minusp
x
)
(
-
(
dd-%tan
(
-
x
))))
((
<
(
abs
x
)
(
/
pi
4
))
(
dd-%%tan
x
))
(
t
;; Argument reduction needed
(
multiple-value-bind
(
n
reduced
)
(
reduce-arg
x
)
(
if
(
evenp
n
)
(
dd-%%tan
reduced
)
(
-
(
/
(
dd-%%tan
reduced
))))))))
;;; dd-%log2
;;; Base 2 logarithm.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment