Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Hyperbolic Functions

Many routines in the Intel® oneAPI DPC++/C++ Compiler Math Library are more optimized for Intel® microprocessors than for non-Intel microprocessors.

The mathimf.h header file includes prototypes for Intel® oneAPI DPC++/C++ Compiler Math Library functions.

The math library supports the following hyperbolic functions:

NOTE:

FP16 Math Functions have the following requirements:

  • Version 2021.4 or higher of the Intel® oneAPI DPC++/C++ Compiler.

  • A next-generation Intel® Xeon® Scalable processor, code name Sapphire Rapids.

acosh

Description: The acosh function returns the inverse hyperbolic cosine of x.

errno: EDOM, for x < 1

Calling interface:
double acosh(double x);
long double acoshl(long double x);
float acoshf(float x);
_Float16 acoshf16(_Float16 x);

asinh

Description: The asinh function returns the inverse hyperbolic sine of x.

Calling interface:
double asinh(double x);
long double asinhl(long double x);
float asinhf(float x);
_Float16 asinhf16(_Float16 x);

atanh

Description: The atanh function returns the inverse hyperbolic tangent of x.

errno:

EDOM, for |x| > 1

ERANGE, for x = 1

Calling interface:
double atanh(double x);
long double atanhl(long double x);
float atanhf(float x);
_Float16 atanhf16(_Float16 x);

cosh

Description: The cosh function returns the hyperbolic cosine of x, (ex + e-x)/2.

errno: ERANGE, for overflow conditions

Calling interface:
double cosh(double x);
long double coshl(long double x);
float coshf(float x);
_Float16 coshf16(_Float16 x);

sinh

Description: The sinh function returns the hyperbolic sine of x, (ex - e-x)/2.

errno: ERANGE, for overflow conditions

Calling interface:
double sinh(double x);
long double sinhl(long double x);
float sinhf(float x);
_Float16 sinhf16(_Float16 x);

sinhcosh

Description: The sinhcosh function returns both the hyperbolic sine and hyperbolic cosine of x.

errno: ERANGE, for overflow conditions

Calling interface:
void sinhcosh(double x, double *sinval, double *cosval);
void sinhcoshl(long double x, long double *sinval, long double *cosval);
void sinhcoshf(float x, float *sinval, float *cosval);
void sinhcoshf16(_Float16 x, _Float16 *sinval, _Float16 *cosval);

tanh

Description: The tanh function returns the hyperbolic tangent of x, (ex - e-x) / (ex + e-x).

Calling interface:
double tanh(double x);
long double tanhl(long double x);
float tanhf(float x);
_Float16 tanhf16(_Float16 x);