Hyperbolic functions v0.1.0
ArcSinh
pub func ArcSinh(x: float64) -> float64
pub func ArcSinh(x: float32) -> float32
The inverse hyperbolic sine: the value whose hyperbolic sine is x.
Defined for every real argument, odd, and unbounded in both directions. A NaN propagates and an infinity gives an
infinity of the same sign.
| Overload | Summary |
|---|---|
pub func ArcSinh(x: float64) -> float64 | The inverse hyperbolic sine: the value whose hyperbolic sine is x. |
pub func ArcSinh(x: float32) -> float32 | Computes the inverse hyperbolic sine of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic sine value to invert |
Returns: the inverse hyperbolic sine of x
ArcCosh
pub func ArcCosh(x: float64) -> float64
pub func ArcCosh(x: float32) -> float32
The inverse hyperbolic cosine: the non-negative value whose hyperbolic cosine is x.
Defined only for arguments of one and above; anything below has no real answer and gives a NaN. The result is never
negative, since the hyperbolic cosine is even and this returns the branch above zero.
| Overload | Summary |
|---|---|
pub func ArcCosh(x: float64) -> float64 | The inverse hyperbolic cosine: the non-negative value whose hyperbolic cosine is x. |
pub func ArcCosh(x: float32) -> float32 | Computes the inverse hyperbolic cosine of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic cosine value to invert |
Returns: the non-negative inverse hyperbolic cosine of x, or a NaN when x < 1
ArcTanh
pub func ArcTanh(x: float64) -> float64
pub func ArcTanh(x: float32) -> float32
The inverse hyperbolic tangent: the value whose hyperbolic tangent is x.
Defined strictly inside the unit interval. The endpoints are the poles and give infinities of the matching sign;
anything beyond them has no real answer and gives a NaN.
| Overload | Summary |
|---|---|
pub func ArcTanh(x: float64) -> float64 | The inverse hyperbolic tangent: the value whose hyperbolic tangent is x. |
pub func ArcTanh(x: float32) -> float32 | Computes the inverse hyperbolic tangent of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic tangent value to invert |
Returns: the inverse hyperbolic tangent of x, an infinity at either endpoint, or a NaN outside [-1, 1]
Cosh
pub func Cosh(x: float64) -> float64
pub func Cosh(x: float32) -> float32
Computes the hyperbolic cosine of x.
The result is at least one. Either infinity returns positive infinity, and a NaN remains a NaN.
| Overload | Summary |
|---|---|
pub func Cosh(x: float64) -> float64 | Computes the hyperbolic cosine of x. |
pub func Cosh(x: float32) -> float32 | Computes the hyperbolic cosine of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic angle |
Returns: the hyperbolic cosine of x
Cotanh
pub func Cotanh(x: float64) -> float64
pub func Cotanh(x: float32) -> float32
Computes the hyperbolic cotangent of x.
A signed zero maps to an infinity with the same sign, infinities map to -1 or 1, and a NaN remains a NaN.
| Overload | Summary |
|---|---|
pub func Cotanh(x: float64) -> float64 | Computes the hyperbolic cotangent of x. |
pub func Cotanh(x: float32) -> float32 | Computes the hyperbolic cotangent of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic angle |
Returns: the hyperbolic cotangent of x
Sinh
pub func Sinh(x: float64) -> float64
pub func Sinh(x: float32) -> float32
Computes the hyperbolic sine of x.
A signed zero or infinity returns itself, and a NaN remains a NaN.
| Overload | Summary |
|---|---|
pub func Sinh(x: float64) -> float64 | Computes the hyperbolic sine of x. |
pub func Sinh(x: float32) -> float32 | Computes the hyperbolic sine of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic angle |
Returns: the hyperbolic sine of x
Tanh
pub func Tanh(x: float64) -> float64
pub func Tanh(x: float32) -> float32
Computes the hyperbolic tangent of x.
The result lies in [-1, 1]. A signed zero returns itself, infinities map to the matching endpoint, and a NaN
remains a NaN.
| Overload | Summary |
|---|---|
pub func Tanh(x: float64) -> float64 | Computes the hyperbolic tangent of x. |
pub func Tanh(x: float32) -> float32 | Computes the hyperbolic tangent of x at float32 precision. |
Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | hyperbolic angle |
Returns: the hyperbolic tangent of x