tanh

From DavinciWiki
Jump to: navigation, search

Description

Computes the hyperbolic tangent of the input value.

Arguments and Return Values

Parameters: An array of numeric data

Return Value: A float (or double) array of the same dimensions as the input containing the hyperbolic tangent of the input

Usage

Syntax: tanh(x)

'x' is any numeric array

tanh(x) = sinh(x)/cosh(x) = (exp(x) - exp(-x))/(exp(x) + exp(-x)) = (exp(2*x) - 1)/(exp(2*x) + 1)

Return format is double if input is double, float otherwise

When tanh() is entered without any arguments, it prints its description, as shown below.

Examples

dv> tanh()

Hyperbolic tangent
tanh(x) = sinh(x)/cosh(x)
        = (exp(x) - exp(-x))/(exp(x) + exp(-x))
        = (exp(2*x) - 1)/(exp(2*x) + 1)
Works for arrays
S.Marshall 01-25-2008

0
dv> tanh(-1//0//1)
3x1x1 array of float, bsq format [12 bytes]
-0.761594       0.00000 0.761594

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 02-26-2008
Modified On: 02-26-2008

Personal tools