Developer Reference for Intel® oneAPI Math Kernel Library for C
A newer version of this document is available. Customers should click here to go to the newest version.
v?Tanh
Computes hyperbolic tangent of vector elements.
Syntax
vsTanh( n, a, y );
vsTanhI(n, a, inca, y, incy);
vmsTanh( n, a, y, mode );
vmsTanhI(n, a, inca, y, incy, mode);
vdTanh( n, a, y );
vdTanhI(n, a, inca, y, incy);
vmdTanh( n, a, y, mode );
vmdTanhI(n, a, inca, y, incy, mode);
vcTanh( n, a, y );
vcTanhI(n, a, inca, y, incy);
vmcTanh( n, a, y, mode );
vmcTanhI(n, a, inca, y, incy, mode);
vzTanh( n, a, y );
vzTanhI(n, a, inca, y, incy);
vmzTanh( n, a, y, mode );
vmzTanhI(n, a, inca, y, incy, mode);
Include Files
- mkl.h
 
Input Parameters
Name  |  
      Type  |  
      Description  |  
     
|---|---|---|
n  |  
      const MKL_INT  |  
      Specifies the number of elements to be calculated.  |  
     
a  |  
      const float* for vsTanh, vmsTanh const double* for vdTanh, vmdTanh const MKL_Complex8* for vcTanh, vmcTanh const MKL_Complex16* for vzTanh, vmzTanh  |  
      Pointer to an array that contains the input vector a.  |  
     
inca, incy  |  
      const MKL_INT  |  
      Specifies increments for the elements of a and y.  |  
     
mode  |  
      const MKL_INT64  |  
      Overrides global VM mode setting for this function call. See vmlSetMode for possible values and their description.  |  
     
Output Parameters
Name  |  
      Type  |  
      Description  |  
     
|---|---|---|
y  |  
      float* for vsTanh, vmsTanh double* for vdTanh, vmdTanh MKL_Complex8* for vcTanh, vmcTanh MKL_Complex16* for vzTanh, vmzTanh  |  
      Pointer to an array that contains the output vector y.  |  
     
Description
The v?Tanh function computes hyperbolic tangent of vector elements.
| Argument | Result | Exception | 
|---|---|---|
| +0 | +0 | |
| -0 | -0 | |
| +∞ | +1 | |
| -∞ | -1 | |
| QNAN | QNAN | |
| SNAN | QNAN | INVALID | 
See Special Value Notations for the conventions used in the table below.
RE(z) i·IM(z)  |  
        -∞ 
  |  
        -X 
  |  
        -0 
  |  
        +0 
  |  
        +X 
  |  
        +∞ 
  |  
        NAN 
  |  
       
|---|---|---|---|---|---|---|---|
| +i·∞ | -1+i·0  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        +1+i·0  |  
        QNAN+i·QNAN  |  
       
| +i·Y | -1+i·0·Tan(Y)  |  
        +1+i·0·Tan(Y)  |  
        QNAN+i·QNAN  |  
       ||||
| +i·0 | -1+i·0  |  
        -0+i·0  |  
        +0+i·0  |  
        +1+i·0  |  
        QNAN+i·0  |  
       ||
| -i·0 | -1-i·0  |  
        -0-i·0  |  
        +0-i·0  |  
        +1-i·0  |  
        QNAN-i·0  |  
       ||
| -i·Y | -1+i·0·Tan(Y)  |  
        +1+i·0·Tan(Y)  |  
        QNAN+i·QNAN  |  
       ||||
| -i·∞ | -1-i·0  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        QNAN+i·QNAN INVALID  |  
        +1-i·0  |  
        QNAN+i·QNAN  |  
       
| +i·NAN | -1+i·0  |  
        QNAN+i·QNAN  |  
        QNAN+i·QNAN  |  
        QNAN+i·QNAN  |  
        QNAN+i·QNAN  |  
        +1+i·0  |  
        QNAN+i·QNAN  |  
       
Notes:
raises INVALID exception when real or imaginary part of the argument is SNAN
Tanh(CONJ(z))=CONJ(Tanh(z))
Tanh(-z)=-Tanh(z).