Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
tanh

Language Guide / Functions · Generated namespace reference

tanh

klang::tanh

Hyperbolic tangent.

Approaches −1 and 1 as the input moves away from zero. For example, it can soft-limit a driven sample.

-2.5-0.987-1.25-0.493001.250.4932.50.987ResultInput x
tanh(x)

Based on std::tanh.

Direct call

const signal shaped = tanh(sample * 4);

Signal flow

const signal shaped = sample * 4 >> tanh;