The tanh native AI script function returns the hyperbolic tangent of the input value.
(y: f)tanh(x: f) // tanh_f_f
x
.(y)tanh(0.5);
This example code calculates the hyperbolic tangent of 0.5
and stores the result in the variable y
.
The hyperbolic tangent is defined as tanh(x) = (e^x - e^-x) / (e^x + e^-x)
. The tanh
function is a mathematical function that is commonly used in statistics, signal processing, and other fields.
This function can be used in combination with other native AI script functions to perform complex mathematical calculations.