summaryrefslogtreecommitdiffstats
path: root/root.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:26 -0800
commitf24b9140d6f74804d5599ec225717d38ca443813 (patch)
tree0da952f1a5a7c0eacfc05c296766523e32c05fe2 /root.scm
parent8ffbc2df0fde83082610149d24e594c1cd879f4a (diff)
downloadslib-f24b9140d6f74804d5599ec225717d38ca443813.tar.gz
slib-f24b9140d6f74804d5599ec225717d38ca443813.zip
Import Upstream version 2c0upstream/2c0
Diffstat (limited to 'root.scm')
-rw-r--r--root.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/root.scm b/root.scm
index 5ba78c1..3c764a6 100644
--- a/root.scm
+++ b/root.scm
@@ -1,5 +1,5 @@
;;;"root.scm" Newton's and Laguerre's methods for finding roots.
-;Copyright (C) 1996 Aubrey Jaffer
+;Copyright (C) 1996, 1997 Aubrey Jaffer
;
;Permission to copy this software, to redistribute it, and to use it
;for any purpose is granted, subject to the following restrictions and
@@ -17,6 +17,8 @@
;promotional, or sales literature without prior written consent in
;each case.
+(require 'logical)
+
;;;; Newton's Method explained in:
;;; D. E. Knuth, "The Art of Computer Programming", Vol 2 /
;;; Seminumerical Algorithms, Reading Massachusetts, Addison-Wesley
@@ -95,7 +97,7 @@
(let* ((df (df/dz z))
(ddf (ddf/dz^2 z))
(disc (sqrt (- (* df df) (* fz ddf)))))
- (print 'disc disc)
+ ;;(print 'disc disc)
(if (zero? disc)
#f
(let* ((next-z
@@ -105,9 +107,9 @@
(imag-part disc))))
(- disc) disc))))
(next-delta-z (magnitude (- next-z z))))
- (print 'next-z next-z )
- (print '(f next-z) (f next-z))
- (print 'delta-z delta-z 'next-delta-z next-delta-z)
+ ;;(print 'next-z next-z )
+ ;;(print '(f next-z) (f next-z))
+ ;;(print 'delta-z delta-z 'next-delta-z next-delta-z)
(cond ((zero? next-delta-z) z)
((and delta-z (>= next-delta-z delta-z)) z)
(else