[Git][cmucl/cmucl][issue-459-more-accurate-dd-complex-div] Multiply by 0.5 instead of dividing by 2
Raymond Toy pushed to branch issue-459-more-accurate-dd-complex-div at cmucl / cmucl Commits: 7fc4e1cb by Raymond Toy at 2026-01-10T19:13:14-08:00 Multiply by 0.5 instead of dividing by 2 For double-floats, we have transforms to convert division by 2 to multiplication by 0.5. No change in precision since this is exact. However, we don't have this for double-double-floats. (We probably should, but that's a different issue.) Instead, just multiply by 0.5d0. This means we can use the faster `mul-dd-d` routine instead of `mul-dd` if we multiplied by 0.5w0. - - - - - 1 changed file: - src/code/numbers.lisp Changes: ===================================== src/code/numbers.lisp ===================================== @@ -789,12 +789,12 @@ (declare (,type s)) ;; If a or b is big, scale down a and b. (when (>= ab ,+rbig+) - (setf x (/ x 2) + (setf x (* x 0.5d0) s (* s 2))) ;; If c or d is big, scale down c and d. (when (>= cd ,+rbig+) - (setf y (/ y 2) - s (/ s 2))) + (setf y (* y 0.5d0) + s (* s 0.5d0))) ;; If a or b is tiny, scale up a and b. (when (<= ab (* ,+rmin+ ,+2/eps+)) (setf x (* x ,+be+) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/7fc4e1cb7963bc79c697f969... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/7fc4e1cb7963bc79c697f969... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)