This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

Single Precision Floating-point Mathematical Functions

Single Precision Floating-point Mathematical Functions#

HIP Runtime API Reference: Single Precision Floating-point Mathematical Functions
Single Precision Floating-point Mathematical Functions
Collaboration diagram for Single Precision Floating-point Mathematical Functions:

Functions

__DEVICE__ float acosf (float __x)
 Returns the arc cosine of x. More...
 
__DEVICE__ float acoshf (float __x)
 Returns the nonnegative arc hyperbolic cosine of x. More...
 
__DEVICE__ float asinf (float __x)
 Returns the arc sine of x. More...
 
__DEVICE__ float asinhf (float __x)
 Returns the arc hyperbolic sine of x. More...
 
__DEVICE__ float atan2f (float __x, float __y)
 Returns the arc tangent of the ratio of x and y. More...
 
__DEVICE__ float atanf (float __x)
 Returns the arc tangent of x. More...
 
__DEVICE__ float atanhf (float __x)
 Returns the arc hyperbolic tangent of x. More...
 
__DEVICE__ float cbrtf (float __x)
 Returns the cube root of x. More...
 
__DEVICE__ float ceilf (float __x)
 Returns ceiling of x. More...
 
__DEVICE__ float copysignf (float __x, float __y)
 Create value with given magnitude, copying sign of second value. More...
 
__DEVICE__ float cosf (float __x)
 Returns the cosine of x. More...
 
__DEVICE__ float coshf (float __x)
 Returns the hyperbolic cosine of x. More...
 
__DEVICE__ float cospif (float __x)
 Returns the cosine of \( \pi x\). More...
 
__DEVICE__ float cyl_bessel_i0f (float __x)
 Returns the value of the regular modified cylindrical Bessel function of order 0 for x. More...
 
__DEVICE__ float cyl_bessel_i1f (float __x)
 Returns the value of the regular modified cylindrical Bessel function of order 1 for x. More...
 
__DEVICE__ float erfcf (float __x)
 Returns the complementary error function of x. More...
 
__DEVICE__ float erfcinvf (float __x)
 Returns the inverse complementary function of x. More...
 
__DEVICE__ float erfcxf (float __x)
 Returns the scaled complementary error function of x. More...
 
__DEVICE__ float erff (float __x)
 Returns the error function of x. More...
 
__DEVICE__ float erfinvf (float __x)
 Returns the inverse error function of x. More...
 
__DEVICE__ float exp10f (float __x)
 Returns \( 10^x \). More...
 
__DEVICE__ float exp2f (float __x)
 Returns \( 2^x \). More...
 
__DEVICE__ float expf (float __x)
 Returns \( e^x \). More...
 
__DEVICE__ float expm1f (float __x)
 Returns \( \ln x - 1 \). More...
 
__DEVICE__ float fabsf (float __x)
 Returns the absolute value of x More...
 
__DEVICE__ float fdimf (float __x, float __y)
 Returns the positive difference between x and y. More...
 
__DEVICE__ float fdividef (float __x, float __y)
 Divide two floating point values. More...
 
__DEVICE__ float floorf (float __x)
 Returns the largest integer less than or equal to x. More...
 
__DEVICE__ float fmaf (float __x, float __y, float __z)
 Returns \(x \cdot y + z\) as a single operation. More...
 
__DEVICE__ float fmaxf (float __x, float __y)
 Determine the maximum numeric value of x and y. More...
 
__DEVICE__ float fminf (float __x, float __y)
 Determine the minimum numeric value of x and y. More...
 
__DEVICE__ float fmodf (float __x, float __y)
 Returns the floating-point remainder of x / y. More...
 
__DEVICE__ float frexpf (float __x, int *__nptr)
 Extract mantissa and exponent of x. More...
 
__DEVICE__ float hypotf (float __x, float __y)
 Returns the square root of the sum of squares of x and y. More...
 
__DEVICE__ int ilogbf (float __x)
 Returns the unbiased integer exponent of x. More...
 
__DEVICE__ __RETURN_TYPE __finitef (float __x)
 Determine whether x is finite. More...
 
__DEVICE__ __RETURN_TYPE __isinff (float __x)
 Determine whether x is infinite. More...
 
__DEVICE__ __RETURN_TYPE __isnanf (float __x)
 Determine whether x is a NaN. More...
 
__DEVICE__ float j0f (float __x)
 Returns the value of the Bessel function of the first kind of order 0 for x. More...
 
__DEVICE__ float j1f (float __x)
 Returns the value of the Bessel function of the first kind of order 1 for x. More...
 
__DEVICE__ float jnf (int __n, float __x)
 Returns the value of the Bessel function of the first kind of order n for x. More...
 
__DEVICE__ float ldexpf (float __x, int __e)
 Returns the value of \(x \cdot 2^{e}\) for x and e. More...
 
__DEVICE__ float lgammaf (float __x)
 Returns the natural logarithm of the absolute value of the gamma function of x. More...
 
__DEVICE__ long long int llrintf (float __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long long int llroundf (float __x)
 Round to nearest integer value. More...
 
__DEVICE__ float log10f (float __x)
 Returns the base 10 logarithm of x. More...
 
__DEVICE__ float log1pf (float __x)
 Returns the natural logarithm of x + 1. More...
 
__DEVICE__ float log2f (float __x)
 Returns the base 2 logarithm of x. More...
 
__DEVICE__ float logbf (float __x)
 Returns the floating point representation of the exponent of x. More...
 
__DEVICE__ float logf (float __x)
 Returns the natural logarithm of x. More...
 
__DEVICE__ long int lrintf (float __x)
 Round x to nearest integer value. More...
 
__DEVICE__ long int lroundf (float __x)
 Round to nearest integer value. More...
 
__DEVICE__ float modff (float __x, float *__iptr)
 Break down x into fractional and integral parts. More...
 
__DEVICE__ float nanf (const char *__tagp __attribute__((nonnull)))
 Returns "Not a Number" value. More...
 
__DEVICE__ float nearbyintf (float __x)
 Round x to the nearest integer. More...
 
__DEVICE__ float nextafterf (float __x, float __y)
 Returns next representable single-precision floating-point value after x. More...
 
__DEVICE__ float norm3df (float __x, float __y, float __z)
 Returns the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ float norm4df (float __x, float __y, float __z, float __w)
 Returns the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ float normcdff (float __x)
 Returns the standard normal cumulative distribution function. More...
 
__DEVICE__ float normcdfinvf (float __x)
 Returns the inverse of the standard normal cumulative distribution function. More...
 
__DEVICE__ float normf (int __dim, const float *__a)
 Returns the square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ float powf (float __x, float __y)
 Returns \( x^y \). More...
 
__DEVICE__ float powif (float __x, int __y)
 Returns the value of first argument to the power of second argument. More...
 
__DEVICE__ float rcbrtf (float __x)
 Returns the reciprocal cube root function. More...
 
__DEVICE__ float remainderf (float __x, float __y)
 Returns single-precision floating-point remainder. More...
 
__DEVICE__ float remquof (float __x, float __y, int *__quo)
 Returns single-precision floating-point remainder and part of quotient. More...
 
__DEVICE__ float rhypotf (float __x, float __y)
 Returns one over the square root of the sum of squares of x and y. More...
 
__DEVICE__ float rintf (float __x)
 Round x to nearest integer value in floating-point. More...
 
__DEVICE__ float rnorm3df (float __x, float __y, float __z)
 Returns one over the square root of the sum of squares of x, y and z. More...
 
__DEVICE__ float rnorm4df (float __x, float __y, float __z, float __w)
 Returns one over the square root of the sum of squares of x, y, z and w. More...
 
__DEVICE__ float rnormf (int __dim, const float *__a)
 Returns the reciprocal of square root of the sum of squares of any number of coordinates. More...
 
__DEVICE__ float roundf (float __x)
 Round to nearest integer value in floating-point. More...
 
__DEVICE__ float rsqrtf (float __x)
 Returns the reciprocal of the square root of x. More...
 
__DEVICE__ float scalblnf (float __x, long int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ float scalbnf (float __x, int __n)
 Scale x by \( 2^n \). More...
 
__DEVICE__ __RETURN_TYPE __signbitf (float __x)
 Return the sign bit of x. More...
 
__DEVICE__ void sincosf (float __x, float *__sinptr, float *__cosptr)
 Returns the sine and cosine of x. More...
 
__DEVICE__ void sincospif (float __x, float *__sinptr, float *__cosptr)
 Returns the sine and cosine of \( \pi x\). More...
 
__DEVICE__ float sinf (float __x)
 Returns the sine of x. More...
 
__DEVICE__ float sinhf (float __x)
 Returns the hyperbolic sine of x. More...
 
__DEVICE__ float sinpif (float __x)
 Returns the hyperbolic sine of \( \pi x\). More...
 
__DEVICE__ float sqrtf (float __x)
 Returns the square root of x. More...
 
__DEVICE__ float tanf (float __x)
 Returns the tangent of x. More...
 
__DEVICE__ float tanhf (float __x)
 Returns the hyperbolic tangent of x. More...
 
__DEVICE__ float tgammaf (float __x)
 Returns the gamma function of x. More...
 
__DEVICE__ float truncf (float __x)
 Truncate x to the integral part. More...
 
__DEVICE__ float y0f (float __x)
 Returns the value of the Bessel function of the second kind of order 0 for x. More...
 
__DEVICE__ float y1f (float __x)
 Returns the value of the Bessel function of the second kind of order 1 for x. More...
 
__DEVICE__ float ynf (int __n, float __x)
 Returns the value of the Bessel function of the second kind of order n for x. More...
 

Detailed Description

Single Precision Floating-point Mathematical Functions

Function Documentation

◆ __finitef()

__DEVICE__ __RETURN_TYPE __finitef ( float  __x)

Determine whether x is finite.

◆ __isinff()

__DEVICE__ __RETURN_TYPE __isinff ( float  __x)

Determine whether x is infinite.

◆ __isnanf()

__DEVICE__ __RETURN_TYPE __isnanf ( float  __x)

Determine whether x is a NaN.

◆ __signbitf()

__DEVICE__ __RETURN_TYPE __signbitf ( float  __x)

Return the sign bit of x.

◆ acosf()

__DEVICE__ float acosf ( float  __x)

Returns the arc cosine of x.

◆ acoshf()

__DEVICE__ float acoshf ( float  __x)

Returns the nonnegative arc hyperbolic cosine of x.

◆ asinf()

__DEVICE__ float asinf ( float  __x)

Returns the arc sine of x.

◆ asinhf()

__DEVICE__ float asinhf ( float  __x)

Returns the arc hyperbolic sine of x.

◆ atan2f()

__DEVICE__ float atan2f ( float  __x,
float  __y 
)

Returns the arc tangent of the ratio of x and y.

◆ atanf()

__DEVICE__ float atanf ( float  __x)

Returns the arc tangent of x.

◆ atanhf()

__DEVICE__ float atanhf ( float  __x)

Returns the arc hyperbolic tangent of x.

◆ cbrtf()

__DEVICE__ float cbrtf ( float  __x)

Returns the cube root of x.

◆ ceilf()

__DEVICE__ float ceilf ( float  __x)

Returns ceiling of x.

◆ copysignf()

__DEVICE__ float copysignf ( float  __x,
float  __y 
)

Create value with given magnitude, copying sign of second value.

◆ cosf()

__DEVICE__ float cosf ( float  __x)

Returns the cosine of x.

◆ coshf()

__DEVICE__ float coshf ( float  __x)

Returns the hyperbolic cosine of x.

◆ cospif()

__DEVICE__ float cospif ( float  __x)

Returns the cosine of \( \pi x\).

◆ cyl_bessel_i0f()

__DEVICE__ float cyl_bessel_i0f ( float  __x)

Returns the value of the regular modified cylindrical Bessel function of order 0 for x.

◆ cyl_bessel_i1f()

__DEVICE__ float cyl_bessel_i1f ( float  __x)

Returns the value of the regular modified cylindrical Bessel function of order 1 for x.

◆ erfcf()

__DEVICE__ float erfcf ( float  __x)

Returns the complementary error function of x.

◆ erfcinvf()

__DEVICE__ float erfcinvf ( float  __x)

Returns the inverse complementary function of x.

◆ erfcxf()

__DEVICE__ float erfcxf ( float  __x)

Returns the scaled complementary error function of x.

◆ erff()

__DEVICE__ float erff ( float  __x)

Returns the error function of x.

◆ erfinvf()

__DEVICE__ float erfinvf ( float  __x)

Returns the inverse error function of x.

◆ exp10f()

__DEVICE__ float exp10f ( float  __x)

Returns \( 10^x \).

◆ exp2f()

__DEVICE__ float exp2f ( float  __x)

Returns \( 2^x \).

◆ expf()

__DEVICE__ float expf ( float  __x)

Returns \( e^x \).

◆ expm1f()

__DEVICE__ float expm1f ( float  __x)

Returns \( \ln x - 1 \).

◆ fabsf()

__DEVICE__ float fabsf ( float  __x)

Returns the absolute value of x

◆ fdimf()

__DEVICE__ float fdimf ( float  __x,
float  __y 
)

Returns the positive difference between x and y.

◆ fdividef()

__DEVICE__ float fdividef ( float  __x,
float  __y 
)

Divide two floating point values.

◆ floorf()

__DEVICE__ float floorf ( float  __x)

Returns the largest integer less than or equal to x.

◆ fmaf()

__DEVICE__ float fmaf ( float  __x,
float  __y,
float  __z 
)

Returns \(x \cdot y + z\) as a single operation.

◆ fmaxf()

__DEVICE__ float fmaxf ( float  __x,
float  __y 
)

Determine the maximum numeric value of x and y.

◆ fminf()

__DEVICE__ float fminf ( float  __x,
float  __y 
)

Determine the minimum numeric value of x and y.

◆ fmodf()

__DEVICE__ float fmodf ( float  __x,
float  __y 
)

Returns the floating-point remainder of x / y.

◆ frexpf()

__DEVICE__ float frexpf ( float  __x,
int *  __nptr 
)

Extract mantissa and exponent of x.

◆ hypotf()

__DEVICE__ float hypotf ( float  __x,
float  __y 
)

Returns the square root of the sum of squares of x and y.

◆ ilogbf()

__DEVICE__ int ilogbf ( float  __x)

Returns the unbiased integer exponent of x.

◆ j0f()

__DEVICE__ float j0f ( float  __x)

Returns the value of the Bessel function of the first kind of order 0 for x.

◆ j1f()

__DEVICE__ float j1f ( float  __x)

Returns the value of the Bessel function of the first kind of order 1 for x.

◆ jnf()

__DEVICE__ float jnf ( int  __n,
float  __x 
)

Returns the value of the Bessel function of the first kind of order n for x.

◆ ldexpf()

__DEVICE__ float ldexpf ( float  __x,
int  __e 
)

Returns the value of \(x \cdot 2^{e}\) for x and e.

◆ lgammaf()

__DEVICE__ float lgammaf ( float  __x)

Returns the natural logarithm of the absolute value of the gamma function of x.

◆ llrintf()

__DEVICE__ long long int llrintf ( float  __x)

Round x to nearest integer value.

◆ llroundf()

__DEVICE__ long long int llroundf ( float  __x)

Round to nearest integer value.

◆ log10f()

__DEVICE__ float log10f ( float  __x)

Returns the base 10 logarithm of x.

◆ log1pf()

__DEVICE__ float log1pf ( float  __x)

Returns the natural logarithm of x + 1.

◆ log2f()

__DEVICE__ float log2f ( float  __x)

Returns the base 2 logarithm of x.

◆ logbf()

__DEVICE__ float logbf ( float  __x)

Returns the floating point representation of the exponent of x.

◆ logf()

__DEVICE__ float logf ( float  __x)

Returns the natural logarithm of x.

◆ lrintf()

__DEVICE__ long int lrintf ( float  __x)

Round x to nearest integer value.

◆ lroundf()

__DEVICE__ long int lroundf ( float  __x)

Round to nearest integer value.

◆ modff()

__DEVICE__ float modff ( float  __x,
float *  __iptr 
)

Break down x into fractional and integral parts.

◆ nanf()

__DEVICE__ float nanf ( const char *__tagp   __attribute__(nonnull))

Returns "Not a Number" value.

◆ nearbyintf()

__DEVICE__ float nearbyintf ( float  __x)

Round x to the nearest integer.

◆ nextafterf()

__DEVICE__ float nextafterf ( float  __x,
float  __y 
)

Returns next representable single-precision floating-point value after x.

◆ norm3df()

__DEVICE__ float norm3df ( float  __x,
float  __y,
float  __z 
)

Returns the square root of the sum of squares of x, y and z.

◆ norm4df()

__DEVICE__ float norm4df ( float  __x,
float  __y,
float  __z,
float  __w 
)

Returns the square root of the sum of squares of x, y, z and w.

◆ normcdff()

__DEVICE__ float normcdff ( float  __x)

Returns the standard normal cumulative distribution function.

◆ normcdfinvf()

__DEVICE__ float normcdfinvf ( float  __x)

Returns the inverse of the standard normal cumulative distribution function.

◆ normf()

__DEVICE__ float normf ( int  __dim,
const float *  __a 
)

Returns the square root of the sum of squares of any number of coordinates.

◆ powf()

__DEVICE__ float powf ( float  __x,
float  __y 
)

Returns \( x^y \).

◆ powif()

__DEVICE__ float powif ( float  __x,
int  __y 
)

Returns the value of first argument to the power of second argument.

◆ rcbrtf()

__DEVICE__ float rcbrtf ( float  __x)

Returns the reciprocal cube root function.

◆ remainderf()

__DEVICE__ float remainderf ( float  __x,
float  __y 
)

Returns single-precision floating-point remainder.

◆ remquof()

__DEVICE__ float remquof ( float  __x,
float  __y,
int *  __quo 
)

Returns single-precision floating-point remainder and part of quotient.

◆ rhypotf()

__DEVICE__ float rhypotf ( float  __x,
float  __y 
)

Returns one over the square root of the sum of squares of x and y.

◆ rintf()

__DEVICE__ float rintf ( float  __x)

Round x to nearest integer value in floating-point.

◆ rnorm3df()

__DEVICE__ float rnorm3df ( float  __x,
float  __y,
float  __z 
)

Returns one over the square root of the sum of squares of x, y and z.

◆ rnorm4df()

__DEVICE__ float rnorm4df ( float  __x,
float  __y,
float  __z,
float  __w 
)

Returns one over the square root of the sum of squares of x, y, z and w.

◆ rnormf()

__DEVICE__ float rnormf ( int  __dim,
const float *  __a 
)

Returns the reciprocal of square root of the sum of squares of any number of coordinates.

◆ roundf()

__DEVICE__ float roundf ( float  __x)

Round to nearest integer value in floating-point.

◆ rsqrtf()

__DEVICE__ float rsqrtf ( float  __x)

Returns the reciprocal of the square root of x.

◆ scalblnf()

__DEVICE__ float scalblnf ( float  __x,
long int  __n 
)

Scale x by \( 2^n \).

◆ scalbnf()

__DEVICE__ float scalbnf ( float  __x,
int  __n 
)

Scale x by \( 2^n \).

◆ sincosf()

__DEVICE__ void sincosf ( float  __x,
float *  __sinptr,
float *  __cosptr 
)

Returns the sine and cosine of x.

◆ sincospif()

__DEVICE__ void sincospif ( float  __x,
float *  __sinptr,
float *  __cosptr 
)

Returns the sine and cosine of \( \pi x\).

◆ sinf()

__DEVICE__ float sinf ( float  __x)

Returns the sine of x.

◆ sinhf()

__DEVICE__ float sinhf ( float  __x)

Returns the hyperbolic sine of x.

◆ sinpif()

__DEVICE__ float sinpif ( float  __x)

Returns the hyperbolic sine of \( \pi x\).

◆ sqrtf()

__DEVICE__ float sqrtf ( float  __x)

Returns the square root of x.

◆ tanf()

__DEVICE__ float tanf ( float  __x)

Returns the tangent of x.

◆ tanhf()

__DEVICE__ float tanhf ( float  __x)

Returns the hyperbolic tangent of x.

◆ tgammaf()

__DEVICE__ float tgammaf ( float  __x)

Returns the gamma function of x.

◆ truncf()

__DEVICE__ float truncf ( float  __x)

Truncate x to the integral part.

◆ y0f()

__DEVICE__ float y0f ( float  __x)

Returns the value of the Bessel function of the second kind of order 0 for x.

◆ y1f()

__DEVICE__ float y1f ( float  __x)

Returns the value of the Bessel function of the second kind of order 1 for x.

◆ ynf()

__DEVICE__ float ynf ( int  __n,
float  __x 
)

Returns the value of the Bessel function of the second kind of order n for x.