cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
acos.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_COMPLEX_FUNCTIONS_ACOS_H
4#define pRC_CORE_COMPLEX_FUNCTIONS_ACOS_H
5
8
9namespace pRC
10{
11 template<IsComplex T>
12 static inline constexpr auto acos(T const &a)
13 {
14 using R = typename T::Type;
15
16 auto const t = asin(a);
17 auto const real = pi<R>() / identity<R>(2) - t.real();
18 auto const imag = t.imag();
19
20 return Complex(real, imag);
21 }
22}
23#endif // pRC_CORE_COMPLEX_FUNCTIONS_ACOS_H
Definition value.hpp:12
Definition cholesky.hpp:10
static constexpr T pi()
Definition pi.hpp:12
Complex(T const &) -> Complex< T >
static constexpr auto asin(T const &a)
Definition asin.hpp:11
static constexpr decltype(auto) real(X &&a)
Definition real.hpp:12
static constexpr decltype(auto) imag(X &&a)
Definition imag.hpp:12
static constexpr auto identity()
Definition identity.hpp:13
static constexpr auto acos(T const &a)
Definition acos.hpp:12