Changeset 14673 for trunk/source/level0/l0numbers.lisp
 Timestamp:
 Mar 11, 2011, 7:30:08 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/level0/l0numbers.lisp
r14119 r14673 915 915 (sqrt (+ (* rx rx) (* ix ix)))) 916 916 (shortfloat 917 (%shortfloat (% hypot (%doublefloat rx)918 917 (%shortfloat (%doublefloathypot (%doublefloat rx) 918 (%doublefloat ix)))) 919 919 (doublefloat 920 (% hypot rx ix)))))))920 (%doublefloathypot rx ix))))))) 921 921 922 922 … … 2002 2002 (/ 1 n)) 2003 2003 2004 ; x & y must both be double floats 2005 (defun %hypot (x y) 2006 (withstackdoublefloats ((x**2) (y**2)) 2007 (let ((res**2 x**2)) 2008 (%doublefloat*2! x x x**2) 2009 (%doublefloat*2! y y y**2) 2010 (%doublefloat+2! x**2 y**2 res**2) 2011 (fsqrt res**2)))) 2012 2013 2004 ;; Compute (sqrt (+ (* x x) (* y y))), but 2005 ;; try to be a little more careful about it. 2006 ;; Both x and y must be doublefloats. 2007 (defun %doublefloathypot (x y) 2008 (withstackdoublefloats ((a) (b) (c)) 2009 (%%doublefloatabs! x a) 2010 (%%doublefloatabs! y b) 2011 (when (> a b) 2012 (psetq a b b a)) 2013 (if (= b 0d0) 2014 0d0 2015 (progn 2016 (%doublefloat/2! a b c) 2017 (* b (fsqrt (+ 1d0 (* c c)))))))) 2018
Note: See TracChangeset
for help on using the changeset viewer.