Rate This Document
Findability
Accuracy
Completeness
Readability

v?acosh

Compute inverse hyperbolic cosine value of the input. The input is a vector.

Interface Definition

C interface:

void vsacosh(const int len, const float* src, float* dst);

void vdacosh(const int len, const double* src, double* dst);

Fortran interface:

CALL VSACOSH(LEN, SRC, DST);

CALL VDACOSH(LEN, SRC, DST);

Parameters

Parameter

Type

Description

Input/Output

len

Integer

Number of elements in the input vector.

If len ≤ 0, the system displays a message indicating that the value of len is invalid.

Input

src

  • For vsacosh, src is of single-precision floating-point type.
  • For vdacosh, src is of double-precision floating-point type.

Input vector src with length len.

If the pointer is null, the system prompts a null pointer error.

Input

dst

  • For vsacosh, dst is of single-precision floating-point type.
  • For vdacosh, dst is of double-precision floating-point type.

Output vector dst with length len.

If the pointer is null, the system prompts a null pointer error.

Output

Return Value

  • Each operation value returns the hyperbolic arc cosine function value y of the radian angle x. x ∈ [1, +∞).
  • If the input is +1, the return value is +0.
  • If the input x is less than +1, NaN is returned.
  • If the input is +∞, the return value is +∞.
  • If the input is -∞, the return value is NaN.
  • If the input is NaN, the return value is NaN.

Dependencies

C: "kvml.h"

Fortran: "kvml.f03"

Examples

C interface:

    int i, len = 4; 
    float src[len] = {0.0f, 2.0f, inf, nan}; 
    float* dst = (float*)malloc(sizeof(float) * len); 
    if (dst == NULL) { 
        printf("Malloc Failed!\n"); 
        return 0; 
    } 
    vsacosh(len, src, dst); 
    /** 
     *  Output dst: 
     *     nan  1.316957896924817  inf  nan 
     * 
     */

Fortran interface:

    INTEGER :: LEN = 4 
    REAL(4) SRC(4)  
    REAL(4) DST(4) 
    DATA SRC /1, 2, 3, 4/ 
    CALL VSACOSH(LEN, SRC, DST) 
    !  
    ! OUTPUT DST: 
    !     0, 1.316957897, 1.762747174, 2.063437069
    !