Namespaces
Variants

atanh, atanhf, atanhl

From cppreference.net
< c ‎ | numeric ‎ | math
Common mathematical functions
Functions
Basic operations
(C99)
(C99)
(C99)
(C99) (C99) (C99) (C23)
Maximum/minimum operations
Exponential functions
Power functions
Trigonometric and hyperbolic functions
Nearest integer floating-point
(C99) (C99) (C99)
(C23) (C23) (C23) (C23)
Floating-point manipulation
Narrowing operations
(C23)
(C23)
(C23)
(C23)
(C23)
(C23)
Quantum and quantum exponent
Decimal re-encoding functions
Total order and payload functions
Classification
Error and gamma functions
(C99)
(C99)
(C99)
(C99)
Types
Macro constants
Special floating-point values
Arguments and return values
Error handling
Fast operation indicators
Definiert im Header <math.h>
float atanhf ( float arg ) ;
(1) (seit C99)
double atanh ( double arg ) ;
(2) (seit C99)
long double atanhl ( long double arg ) ;
(3) (seit C99)
Definiert im Header <tgmath.h>
#define atanh( arg )
(4) (seit C99)
1-3) Berechnet den inversen hyperbolischen Tangens von arg .
4) Typgenerisches Makro: Wenn das Argument den Typ long double hat, wird atanhl aufgerufen. Andernfalls, wenn das Argument einen Ganzzahltyp oder den Typ double hat, wird atanh aufgerufen. Andernfalls wird atanhf aufgerufen. Wenn das Argument komplex ist, ruft das Makro die entsprechende komplexe Funktion auf ( catanhf , catanh , catanhl ).

Inhaltsverzeichnis

Parameter

arg - Fließkommawert, der den Flächeninhalt eines hyperbolischen Sektors darstellt

Rückgabewert

Wenn keine Fehler auftreten, wird der inverse hyperbolische Tangens von arg ( tanh -1
(arg)
, oder artanh(arg) ), zurückgegeben.

Wenn ein Domänenfehler auftritt, wird ein implementierungsdefinierter Wert zurückgegeben (NaN, sofern unterstützt).

Wenn ein Polfehler auftritt, ± HUGE_VAL , ±HUGE_VALF , oder ±HUGE_VALL wird zurückgegeben (mit korrektem Vorzeichen).

Wenn ein Bereichsfehler aufgrund von Unterlauf auftritt, wird das korrekte Ergebnis (nach Rundung) zurückgegeben.

Fehlerbehandlung

Fehler werden gemeldet, wie in math_errhandling spezifiziert.

Wenn das Argument nicht im Intervall [ - 1 , + 1 ] liegt, tritt ein Bereichsfehler auf.

Wenn das Argument ±1 ist, tritt ein Polfehler auf.

Wenn die Implementierung IEEE-Gleitkommaarithmetik (IEC 60559) unterstützt,

  • Wenn das Argument ±0 ist, wird es unverändert zurückgegeben.
  • Wenn das Argument ±1 ist, wird ±∞ zurückgegeben und FE_DIVBYZERO wird ausgelöst.
  • Wenn |arg|>1 , wird NaN zurückgegeben und FE_INVALID wird ausgelöst.
  • Wenn das Argument NaN ist, wird NaN zurückgegeben.

Hinweise

Obwohl der C-Standard diese Funktion als "Areakosinus Hyperbolicus" bezeichnet, sind die Umkehrfunktionen der hyperbolischen Funktionen die Areafunktionen. Ihr Argument ist die Fläche eines hyperbolischen Sektors, kein Bogen. Die korrekte Bezeichnung ist "inverse hyperbolische Tangensfunktion" (von POSIX verwendet) oder "Areatangens Hyperbolicus".

POSIX spezifiziert , dass im Fall eines Unterlaufs arg unverändert zurückgegeben wird, und falls dies nicht unterstützt wird, ein implementierungsdefinierter Wert zurückgegeben wird, der nicht größer als DBL_MIN , FLT_MIN , und LDBL_MIN ist.

Beispiel

#include <errno.h>
#include <fenv.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
// #pragma STDC FENV_ACCESS ON
int main(void)
{
    printf("atanh(0) = %f\natanh(-0) = %f\n", atanh(0), atanh(-0.0));
    printf("atanh(0.9) = %f\n", atanh(0.9));
    // error handling
    errno = 0; feclearexcept(FE_ALL_EXCEPT);
    printf("atanh(-1) = %f\n", atanh(-1));
    if (errno == ERANGE)
        perror("    errno == ERANGE");
    if (fetestexcept(FE_DIVBYZERO))
        puts("    FE_DIVBYZERO raised");
}

Mögliche Ausgabe:

atanh(0) = 0.000000
atanh(-0) = -0.000000
atanh(0.9) = 1.472219
atanh(-1) = -inf
    errno == ERANGE: Numerical result out of range
    FE_DIVBYZERO raised

Referenzen

  • C23-Standard (ISO/IEC 9899:2024):
  • 7.12.5.3 Die atanh-Funktionen (S: 241)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S: 373-375)
  • F.10.2.3 Die atanh-Funktionen (S: 520)
  • C17-Standard (ISO/IEC 9899:2018):
  • 7.12.5.3 Die atanh-Funktionen (S.: TBD)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S.: TBD)
  • F.10.2.3 Die atanh-Funktionen (S.: TBD)
  • C11-Standard (ISO/IEC 9899:2011):
  • 7.12.5.3 Die atanh-Funktionen (S. 241)
  • 7.25 Typgenerische Mathematik <tgmath.h> (S. 373-375)
  • F.10.2.3 Die atanh-Funktionen (S. 520)
  • C99-Standard (ISO/IEC 9899:1999):
  • 7.12.5.3 Die atanh-Funktionen (S. 221-222)
  • 7.22 Typgenerische Mathematik <tgmath.h> (S. 335-337)
  • F.9.2.3 Die atanh-Funktionen (S. 457)

Siehe auch

(C99) (C99) (C99)
berechnet den Areahyperbelsinus ( arsinh(x) )
(Funktion)
(C99) (C99) (C99)
berechnet den Areahyperbelkosinus ( arcosh(x) )
(Funktion)
(C99) (C99)
berechnet den hyperbolischen Tangens ( tanh(x) )
(Funktion)
(C99) (C99) (C99)
berechnet den komplexen Areahyperbeltangens
(Funktion)

Externe Links

Weisstein, Eric W. "Inverse Hyperbolic Tangent." Von MathWorld — Eine Wolfram Web Resource.