#65: Different results for {{{expt}}} between compiled and interpreted code --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2012-12 Keywords: | --------------------+------------------------------------------------------- Consider {{{ (defun sqr (x) (declare (type (complex double-float) x)) (expt x 2)) }}}
Compare the results: {{{ * (sqr #c(0d0 1d0)) #C(-1d0 0d0)
* (expt #c(0d0 1d0)) #C(-1.0d0 1.2246467991473532d-16) }}}
The difference is caused by a deftransform for {{{expt}}} that converts {{{(expt x 2)}}} to {{{(* x x)}}}.
Perhaps the {{{expt}}} should be modified to do the same transformation when the power is one of the special values in the deftransform? (The deftransform handles 2, 3, 4, and 1/2.)