rsqrt Subroutine

Purpose

Computes the reciprocal of the square root of a number.

Libraries

IEEE Math Library (libm.a)

System V Math Library (libmsaa.a)

Syntax

#include <math.h>

double rsqrt(double  x)

Description

The rsqrt command computes the reciprocal of the square root of a number x; that is, 1.0 divided by the square root of x (1.0/sqrt(x)). On some platforms, using the rsqrt subroutine is faster than computing 1.0 / sqrt(x). The rsqrt subroutine uses the same rounding mode used by the calling program.

When using the libm.a library, the rsqrt subroutine responds to special values of x in the following ways:

When using the libmsaa.a library, the rsqrt subroutine responds to special values of x in the following ways:

When compiled with libmsaa.a, a program can use the matherr subroutine to change these error-handling procedures.

Parameter

Item Description
x Specifies a double-precision floating-point value.

Return Values

Upon successful completion, the rsqrt subroutine returns the reciprocal of the square root of x.

Item Description
1.0 If x is 1.0.
+0.0 If x is +INF.

Error Codes

When using either the libm.a or libmsaa.a library, the rsqrt subroutine may return the following error code:

Item Description
EDOM The value of x is negative.