United StatesEnglish 


HPUX Reference > Rrsqrt(3M)HP Integrity Server OnlyHPUX 11i Version 3: February 2007 

NAMErsqrt(), rsqrtf(), rsqrtl(), rsqrtw(), rsqrtq() — reciprocal square root functions SYNOPSIS#include <math.h> double rsqrt(double x); float rsqrtf(float x); long double rsqrtl(long double x); extended rsqrtw(extended x); quad rsqrtq(quad x); DESCRIPTIONThese functions are available only for Integrity servers. rsqrt() returns the reciprocal of the nonnegative square root of x. The expression a*rsqrt(b) is intended as a higher performance alternative to a/sqrt(b). The two expressions are comparably accurate, but do not compute exactly the same value in every case. For example, a*rsqrt(a*a + b*b) can be just slightly greater than 1, in rare cases. rsqrtf() is a float version of rsqrt(); it takes a float argument and returns a float result. USAGETo use these functions compile either with the default Ae option or with the Aa and the D_HPUX_SOURCE options. To use (for Integrity servers) rsqrtw() or rsqrtq(), compile also with the fpwidetypes option. To use any of these functions, make sure your program includes <math.h>, and link in the math library by specifying lm on the compiler or linker command line. RETURN VALUEIf x is ±0, rsqrt() returns ±INFINITY and raises the dividebyzero exception. If x is +INFINITY, rsqrt() returns +0. If x is NaN, rsqrt() returns NaN. If x is less than zero, rsqrt() returns NaN and raises the invalid floatingpoint exception. rsqrt() raises the inexact exception whenever a rounded result does not equal the mathematical result. 
Printable version  
