1 /* 2 * Written by Michael Shalayeff. Public Domain 3 */ 4 5 #if defined(LIBM_SCCS) && !defined(lint) 6 static char rcsid[] = "$OpenBSD: e_sqrt.c,v 1.4 2008/12/10 01:08:24 martynas Exp $"; 7 #endif 8 9 #include <sys/cdefs.h> 10 #include <float.h> 11 #include <math.h> 12 13 double 14 sqrt(double x) 15 { 16 __asm__ __volatile__ ("fsqrt,dbl %0, %0" : "+f" (x)); 17 return (x); 18 } 19 20 #if LDBL_MANT_DIG == 53 21 #ifdef __weak_alias 22 __weak_alias(sqrtl, sqrt); 23 #endif /* __weak_alias */ 24 #endif /* LDBL_MANT_DIG == 53 */ 25