I'm trying to optimize some Common Lisp code. I have a function called "get-prob", which should return a float number. I use the following declaration:
Code: Select all
(declaim (single-float get-prob))
Code: Select all
(defun get-final-prob (x)
(let ((prob (get-prob model str)))
(declare (single-float prob) (optimize (speed 3) (safety 0)))
(incf prob (get-prob2 ...)))
Unable to optimize due to type uncertainty. The second argument is a NUMBER not a RATIONAL.
Unable to optimize due to type uncertainty. The second argument is a NUMBER not a SINGLE-FLOAT.
Forced to do GENERIC+ (cost 10)
unable to do inline float arithmetic (cost 2) because:
The second argument is a NUMBER not a SINGLE-FLOAT
I have a similar error message when using "double-float".
Does someone know how what I'm doing wrong?
Thanks in advance.
Regards,
Luis.