PI has type long-float, not double-float, so the following patch is necessary: ========================================================= diff --git a/calculus/monte-carlo.lisp b/calculus/monte-carlo.lisp index cb18bb1..32bae65 100644 --- a/calculus/monte-carlo.lisp +++ b/calculus/monte-carlo.lisp @@ -211,7 +211,8 @@ (defparameter *mc-lower* #m(0.0d0 0.0d0 0.0d0))
(defparameter *mc-upper* - (grid:make-foreign-array 'double-float :initial-contents (list pi pi pi))) + (grid:make-foreign-array 'double-float :initial-contents + (list #1=#.(float pi 0d0) #1# #1#)))
(defun random-walk-plain-example (&optional (nsamples 500000)) (monte-carlo-integrate-plain 'mcrw *mc-lower* *mc-upper* nsamples)) ========================================================= alternatively, you may need to call COERCE in grid:make-foreign-array or something.