tanh - ryzom/ryzomcore GitHub Wiki


title: Tanh description: published: true date: 2023-03-13T15:49:33.894Z tags: editor: markdown dateCreated: 2023-03-13T15:49:33.894Z

tanh

The tanh native AI script function returns the hyperbolic tangent of the input value.

Syntax

(y: f)tanh(x: f) // tanh_f_f

Arguments

  • x (float): A real value.

Return value

  • y (float): The hyperbolic tangent of x.

Examples

(y)tanh(0.5);

This example code calculates the hyperbolic tangent of 0.5 and stores the result in the variable y.

Notes

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.

⚠️ **GitHub.com Fallback** ⚠️