kyosu v0.1.0
Complex Without Complexes
 
Loading...
Searching...
No Matches

◆ sinh

kyosu::sinh = eve::functor<sinh_t>
inlineconstexpr

Computes the hyperbolic sine of the argument.

Header file

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<eve::floating_ordered_value T> constexpr auto sinh(T z) noexcept; //1
template<kyosu::concepts::cayley_dickson T> constexpr auto sinh(T z) noexcept; //2
}
constexpr auto sinh
Computes the hyperbolic sine of the argument.
Definition: sinh.hpp:115
Main KYOSU namespace.
Definition: cinf.hpp:13

Parameters

  • z: Value to process.

Return value

  1. Returns the hyperbolic sine of the argument.
  2. Returns elementwise the complex value of the hyperbolic sine of the input.
    • for every z: eve::sinh(kyosu::conj(z)) == kyosu::conj(std::sinh(z))
    • for every z: kyosu::sinh(-z) == -kyosu::sinh(z)
    • If z is \(+0\), the result is \(+0\)
    • If z is \(i \infty\), the result is \(i \textrm{NaN}\) (the sign of the real part is unspecified)
    • If z is \(i \textrm{NaN}\), the result is \(\textrm{NaN}\)
    • If z is \(x+i \infty\) (for any positive finite x), the result is \(\textrm{NaN}+i \textrm{NaN}\)
    • If z is \(x+i \textrm{NaN}\) (for any positive finite x), the result is \(\textrm{NaN}+i \textrm{NaN}\)
    • If z is \(+\infty\), the result is \(+\infty\)
    • If z is \(+\infty+i y\) (for any positive finite y), the result is \(\infty\times e^{iy}\)
    • If z is \(+\infty+i \infty\), the result is \(\pm \infty+i \textrm{NaN}\) (the sign of the real part is unspecified)
    • If z is \(+\infty+i \textrm{NaN}\), the result is \(\pm \infty+i \textrm{NaN}\) (the sign of the real part is unspecified)
    • If z is \(\textrm{NaN}\), the result is \(\textrm{NaN}\)
    • If z is \(\textrm{NaN}+i y\) (for any finite nonzero y), the result is \(\textrm{NaN}+i \textrm{NaN}\)
  3. Is semantically equivalent to (exp(z)-exp(-z))/2.

External references

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::sinh;
std::cout << "Real: ";
std::cout << 72.9f << " -> " << sinh(72.9f) << "\n";
std::cout << "Complex: ";
std::cout << kyosu::complex_t<float>(3.5f,-2.9f) << " -> " << sinh(kyosu::complex_t<float>(3.5f,-2.9f)) << "\n";
std::cout << "Quaternion: ";
std::cout << kyosu::quaternion_t<double>(1.,2.,3.,4.) << " -> " << sinh(kyosu::quaternion_t<double>(1.,2.,3.,4.)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
std::cout << wc_t(kyosu::complex_t<double>(1.3,-3.7)) << " -> " << sinh(wc_t(kyosu::complex_t<double>(1.3,-3.7))) << "\n";
return 0;
}
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:24
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27