Skip to main content

cosh

Function cosh 

Source
pub fn cosh<T: CordicNumber>(x: T) -> T
Expand description

Hyperbolic cosine. Always ≥ 1.

§Saturation Behavior

cosh(x) grows exponentially: cosh(x) ≈ e^|x|/2 for large |x|. This function saturates for extreme inputs:

ConditionResultExample (I16F16)
|x| > acosh(T::MAX)T::MAX|x| > ~11.1 → 32767.99

Unlike sinh, cosh is always positive, so it only saturates to T::MAX.

The exact thresholds:

  • I16F16: Saturates for |x| > ~11.1
  • I32F32: Saturates for |x| > ~22.2