Ticket #65 (closed defect: fixed)
Different results for EXPT between compiled and interpreted code
| Reported by: | rtoy | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Core | Version: | 2012-12 |
| Keywords: | Cc: |
Description (last modified by rtoy) (diff)
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) 2) #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 and their negatives.)
Change History
Note: See
TracTickets for help on using
tickets.
