GLSL built-in function

atanh()

Returns inverse hyperbolic tangent for absolute input below one.

Demo version: GLSL ES 3.00 / WebGL 2Demo stage: Fragment

Syntax

genType atanh(genType x)

genType means float / vec2 / vec3 / vec4; matching placeholders use the same type.

Parameters

x
Input value or left-hand vector

Return value

The inverse hyperbolic tangent of each component; defined only for abs(x) < 1.

Live example

Edit the code and the preview updates as you type.

What atanh does

Returns inverse hyperbolic tangent for absolute input below one.

Read the preview

atanh(x*0.9)*0.5 stays inside the valid open input range (-1, 1). Lower 0.9 to 0.5 to flatten the rapidly rising ends.

Core call

atanh(x*0.9)*0.5;

Plus and minus one are excluded; magnitude increases sharply near the endpoints.

Experiment

Try atanh(x*0.99)*0.5 instead of the 0.9 input scale. The ends rise beyond the visible vertical range as the input approaches the function's limits.

Specification

GLSL ES 3.00 built-in functions, chapter 8

Related functions