e_hypotf.c (23397) | e_hypotf.c (23579) |
---|---|
1/* e_hypotf.c -- float version of e_hypot.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5/* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * 9 * Developed at SunPro, a Sun Microsystems, Inc. business. 10 * Permission to use, copy, modify, and distribute this 11 * software is freely granted, provided that this notice 12 * is preserved. 13 * ==================================================== 14 */ 15 16#ifndef lint | 1/* e_hypotf.c -- float version of e_hypot.c. 2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. 3 */ 4 5/* 6 * ==================================================== 7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. 8 * 9 * Developed at SunPro, a Sun Microsystems, Inc. business. 10 * Permission to use, copy, modify, and distribute this 11 * software is freely granted, provided that this notice 12 * is preserved. 13 * ==================================================== 14 */ 15 16#ifndef lint |
17static char rcsid[] = "$Id: e_hypotf.c,v 1.4 1997/02/22 15:10:13 peter Exp $"; | 17static char rcsid[] = "$Id: e_hypotf.c,v 1.5 1997/03/05 11:54:00 bde Exp $"; |
18#endif 19 20#include "math.h" 21#include "math_private.h" 22 23#ifdef __STDC__ 24 float __ieee754_hypotf(float x, float y) 25#else --- 40 unchanged lines hidden (view full) --- 66 SET_FLOAT_WORD(b,hb); 67 } 68 } 69 /* medium size a and b */ 70 w = a-b; 71 if (w>b) { 72 SET_FLOAT_WORD(t1,ha&0xfffff000); 73 t2 = a-t1; | 18#endif 19 20#include "math.h" 21#include "math_private.h" 22 23#ifdef __STDC__ 24 float __ieee754_hypotf(float x, float y) 25#else --- 40 unchanged lines hidden (view full) --- 66 SET_FLOAT_WORD(b,hb); 67 } 68 } 69 /* medium size a and b */ 70 w = a-b; 71 if (w>b) { 72 SET_FLOAT_WORD(t1,ha&0xfffff000); 73 t2 = a-t1; |
74 w = sqrtf(t1*t1-(b*(-b)-t2*(a+t1))); | 74 w = __ieee754_sqrtf(t1*t1-(b*(-b)-t2*(a+t1))); |
75 } else { 76 a = a+a; 77 SET_FLOAT_WORD(y1,hb&0xfffff000); 78 y2 = b - y1; 79 SET_FLOAT_WORD(t1,ha+0x00800000); 80 t2 = a - t1; | 75 } else { 76 a = a+a; 77 SET_FLOAT_WORD(y1,hb&0xfffff000); 78 y2 = b - y1; 79 SET_FLOAT_WORD(t1,ha+0x00800000); 80 t2 = a - t1; |
81 w = sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); | 81 w = __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); |
82 } 83 if(k!=0) { 84 SET_FLOAT_WORD(t1,0x3f800000+(k<<23)); 85 return t1*w; 86 } else return w; 87} | 82 } 83 if(k!=0) { 84 SET_FLOAT_WORD(t1,0x3f800000+(k<<23)); 85 return t1*w; 86 } else return w; 87} |