Skip to main content

oxilean_std/complex/
complex_sinh_group.rs

1//! # Complex - sinh_group Methods
2//!
3//! This module contains method implementations for `Complex`.
4//!
5//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
6
7use super::complex_type::Complex;
8
9impl Complex {
10    /// Hyperbolic sine: sinh(z) = (e^z - e^(-z)) / 2.
11    pub fn sinh(self) -> Self {
12        let ep = self.exp();
13        let em = self.neg().exp();
14        ep.sub(em).scale(0.5)
15    }
16    /// Hyperbolic tangent: tanh(z) = sinh(z)/cosh(z).
17    pub fn tanh(self) -> Option<Self> {
18        self.sinh().div(self.cosh())
19    }
20}