Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun left-hand (a b n f)
- (declare (type double-float a b n)
- (ftype (function (double-float) double-float) f)
- (optimize (speed 3) (safety 1)))
- (do* ((dt (/ (- b a) n))
- (time a (+ time dt))
- (suma 0d0 (+ suma (the double-float (funcall f time))))
- (end (- b (/ dt 2))))
- ((> time end) (* dt suma)) (declare (type double-float suma dt))))
- vs
- (defun left-hand (a b n)
- (declare (type double-float a b n)
- (optimize (speed 3) (safety 1)))
- (do* ((dt (/ (- b a) n))
- (time a (+ time dt))
- (suma 0d0 (+ suma (the double-float (sin time))))
- (end (- b (/ dt 2))))
- ((> time end) (* dt suma)) (declare (type double-float suma dt))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement