PHP atanh() Function

The atanh() function in PHP returns the inverse hyperbolic tangent of a number.
It takes a float value between -1 and 1 (excluding -1 and 1) as input.
The result is returned in radians as a floating-point number.
Commonly used in mathematics, engineering, and signal processing.
Internally, it uses the formula: atanh(x) = 0.5 * log((1 + x) / (1 - x)).

Syntax


atanh(float $number): float
  • Parameter:
    number must be between -1 and 1 (exclusive)
  • Returns:
    The inverse hyperbolic tangent of the number, in radians

File Name: atanh-example.php


<?php
echo atanh(0);     // ➤ 0
echo "\n";
echo atanh(0.5);   // ➤ 0.54930614433405
echo "\n";
echo atanh(-0.5);  // ➤ -0.54930614433405
?>W

Formula Behind the Scenes

Mathematically:


atanh(x) = 0.5 * log((1 + x) / (1 - x))

Use Cases

Use Case Description
Engineering/Mathematics Used in calculus, physics, signal processing
Inverse of tanh() Recover original value from hyperbolic tan
Complex systems modeling Waveforms, data transformation

Summary

Function Description
atanh() Returns inverse hyperbolic tangent
Input Must be between -1 and 1 (exclusive)
Output Float (radians)