-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements trigonometric functions in PI unit
- Loading branch information
Showing
16 changed files
with
838 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright : KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
#include <kyosu/details/invoke.hpp> | ||
#include <eve/module/math.hpp> | ||
|
||
namespace kyosu::tags | ||
{ | ||
struct callable_acospi : eve::elementwise | ||
{ | ||
using callable_tag_type = callable_acospi; | ||
|
||
KYOSU_DEFERS_CALLABLE(acospi_); | ||
|
||
template<eve::ordered_value T> | ||
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept | ||
{ | ||
auto fn = callable_acospi{}; | ||
return fn(v); | ||
} | ||
|
||
template<typename T> | ||
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target)) | ||
{ | ||
return eve::tag_invoke(*this, target); | ||
} | ||
|
||
template<typename... T> | ||
eve::unsupported_call<callable_acospi(T&&...)> operator()(T&&... x) const | ||
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; | ||
}; | ||
} | ||
|
||
namespace kyosu | ||
{ | ||
//====================================================================================================================== | ||
//! @addtogroup functions | ||
//! @{ | ||
//! @var acospi | ||
//! @brief Computes the arc cosine of the argument times \f$\pi\f$. | ||
//! | ||
//! **Defined in Header** | ||
//! | ||
//! @code | ||
//! #include <kyosu/functions.hpp> | ||
//! @endcode | ||
//! | ||
//! @groupheader{Callable Signatures} | ||
//! | ||
//! @code | ||
//! namespace kyosu | ||
//! { | ||
//! template<eve::ordered_value T> constexpr auto acospi(T z) noexcept; //1 | ||
//! template<kyosu::concepts::complex T> constexpr auto acospi(T z) noexcept; //2 | ||
//! } | ||
//! @endcode | ||
//! | ||
//! **Parameters** | ||
//! | ||
//! * `z` : Value to process. | ||
//! | ||
//! **Return value** | ||
//! | ||
//! 1. a real input z is treated as if to_complex(z) was entered. | ||
//! | ||
//! 2. Returns `pi(as(z))*acos(z)` | ||
//! | ||
//! @groupheader{Example} | ||
//! | ||
//! @godbolt{doc/acospi.cpp} | ||
//! @} | ||
//====================================================================================================================== | ||
inline constexpr tags::callable_acospi acospi = {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright : KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
#include <kyosu/details/invoke.hpp> | ||
#include <eve/module/math.hpp> | ||
|
||
namespace kyosu::tags | ||
{ | ||
struct callable_acotpi : eve::elementwise | ||
{ | ||
using callable_tag_type = callable_acotpi; | ||
|
||
KYOSU_DEFERS_CALLABLE(acotpi_); | ||
|
||
template<eve::ordered_value T> | ||
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept | ||
{ | ||
auto fn = callable_acotpi{}; | ||
return fn(v); | ||
} | ||
|
||
template<typename T> | ||
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target)) | ||
{ | ||
return eve::tag_invoke(*this, target); | ||
} | ||
|
||
template<typename... T> | ||
eve::unsupported_call<callable_acotpi(T&&...)> operator()(T&&... x) const | ||
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; | ||
}; | ||
} | ||
|
||
namespace kyosu | ||
{ | ||
//====================================================================================================================== | ||
//! @addtogroup functions | ||
//! @{ | ||
//! @var acotpi | ||
//! @brief Computes the arc cotangent of the argument times \f$\pi\f$. | ||
//! | ||
//! **Defined in Header** | ||
//! | ||
//! @code | ||
//! #include <kyosu/functions.hpp> | ||
//! @endcode | ||
//! | ||
//! @groupheader{Callable Signatures} | ||
//! | ||
//! @code | ||
//! namespace kyosu | ||
//! { | ||
//! template<eve::ordered_value T> constexpr auto acotpi(T z) noexcept; //1 | ||
//! template<kyosu::concepts::complex T> constexpr auto acotpi(T z) noexcept; //2 | ||
//! } | ||
//! @endcode | ||
//! | ||
//! **Parameters** | ||
//! | ||
//! * `z` : Value to process. | ||
//! | ||
//! **Return value** | ||
//! | ||
//! 1. a real input z is treated as if to_complex(z) was entered. | ||
//! | ||
//! 2. Returns `pi(as(z))*acot(z)` | ||
//! | ||
//! @groupheader{Example} | ||
//! | ||
//! @godbolt{doc/acotpi.cpp} | ||
//! @} | ||
//====================================================================================================================== | ||
inline constexpr tags::callable_acotpi acotpi = {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright : KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
#include <kyosu/details/invoke.hpp> | ||
#include <eve/module/math.hpp> | ||
|
||
namespace kyosu::tags | ||
{ | ||
struct callable_acscpi : eve::elementwise | ||
{ | ||
using callable_tag_type = callable_acscpi; | ||
|
||
KYOSU_DEFERS_CALLABLE(acscpi_); | ||
|
||
template<eve::ordered_value T> | ||
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept | ||
{ | ||
auto fn = callable_acscpi{}; | ||
return fn(v); | ||
} | ||
|
||
template<typename T> | ||
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target)) | ||
{ | ||
return eve::tag_invoke(*this, target); | ||
} | ||
|
||
template<typename... T> | ||
eve::unsupported_call<callable_acscpi(T&&...)> operator()(T&&... x) const | ||
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; | ||
}; | ||
} | ||
|
||
namespace kyosu | ||
{ | ||
//====================================================================================================================== | ||
//! @addtogroup functions | ||
//! @{ | ||
//! @var acscpi | ||
//! @brief Computes the arc cosecant of the argument times \f$\pi\f$. | ||
//! | ||
//! **Defined in Header** | ||
//! | ||
//! @code | ||
//! #include <kyosu/functions.hpp> | ||
//! @endcode | ||
//! | ||
//! @groupheader{Callable Signatures} | ||
//! | ||
//! @code | ||
//! namespace kyosu | ||
//! { | ||
//! template<eve::ordered_value T> constexpr auto acscpi(T z) noexcept; //1 | ||
//! template<kyosu::concepts::complex T> constexpr auto acscpi(T z) noexcept; //2 | ||
//! } | ||
//! @endcode | ||
//! | ||
//! **Parameters** | ||
//! | ||
//! * `z` : Value to process. | ||
//! | ||
//! **Return value** | ||
//! | ||
//! 1. a real input z is treated as if to_complex(z) was entered. | ||
//! | ||
//! 2. Returns `pi(as(z))*acsc(z)` | ||
//! | ||
//! @groupheader{Example} | ||
//! | ||
//! @godbolt{doc/acscpi.cpp} | ||
//! @} | ||
//====================================================================================================================== | ||
inline constexpr tags::callable_acscpi acscpi = {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//====================================================================================================================== | ||
/* | ||
Kyosu - Complex Without Complexes | ||
Copyright : KYOSU Contributors & Maintainers | ||
SPDX-License-Identifier: BSL-1.0 | ||
*/ | ||
//====================================================================================================================== | ||
#pragma once | ||
|
||
#include <kyosu/details/invoke.hpp> | ||
#include <eve/module/math.hpp> | ||
|
||
namespace kyosu::tags | ||
{ | ||
struct callable_asecpi : eve::elementwise | ||
{ | ||
using callable_tag_type = callable_asecpi; | ||
|
||
KYOSU_DEFERS_CALLABLE(asecpi_); | ||
|
||
template<eve::ordered_value T> | ||
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept | ||
{ | ||
auto fn = callable_asecpi{}; | ||
return fn(v); | ||
} | ||
|
||
template<typename T> | ||
KYOSU_FORCEINLINE auto operator()(T const& target) const noexcept -> decltype(eve::tag_invoke(*this, target)) | ||
{ | ||
return eve::tag_invoke(*this, target); | ||
} | ||
|
||
template<typename... T> | ||
eve::unsupported_call<callable_asecpi(T&&...)> operator()(T&&... x) const | ||
requires(!requires { eve::tag_invoke(*this, KYOSU_FWD(x)...); }) = delete; | ||
}; | ||
} | ||
|
||
namespace kyosu | ||
{ | ||
//====================================================================================================================== | ||
//! @addtogroup functions | ||
//! @{ | ||
//! @var asecpi | ||
//! @brief Computes the arc secant of the argument times \f$\pi\f$. | ||
//! | ||
//! **Defined in Header** | ||
//! | ||
//! @code | ||
//! #include <kyosu/functions.hpp> | ||
//! @endcode | ||
//! | ||
//! @groupheader{Callable Signatures} | ||
//! | ||
//! @code | ||
//! namespace kyosu | ||
//! { | ||
//! template<eve::ordered_value T> constexpr auto asecpi(T z) noexcept; //1 | ||
//! template<kyosu::concepts::complex T> constexpr auto asecpi(T z) noexcept; //2 | ||
//! } | ||
//! @endcode | ||
//! | ||
//! **Parameters** | ||
//! | ||
//! * `z` : Value to process. | ||
//! | ||
//! **Return value** | ||
//! | ||
//! 1. a real input z is treated as if to_complex(z) was entered. | ||
//! | ||
//! 2. Returns `pi(as(z))*asec(z)` | ||
//! | ||
//! @groupheader{Example} | ||
//! | ||
//! @godbolt{doc/asecpi.cpp} | ||
//! @} | ||
//====================================================================================================================== | ||
inline constexpr tags::callable_asecpi asecpi = {}; | ||
} |
Oops, something went wrong.