mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
add math::copysign
fix hyperbolic and exponental functions: for special values
This commit is contained in:
parent
a27c83e939
commit
32c3ba02d4
50 changed files with 540 additions and 216 deletions
|
@ -21,7 +21,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR T
|
||||
cos_impl_1(T x2, std::size_t n, std::size_t last) {
|
||||
return last - n == 1
|
||||
? (n % 2 ? -1 : 1) * sprout::detail::pow_n(x2, n) / sprout::math::factorial<T>(2 * n)
|
||||
? (n % 2 ? -1 : 1) * sprout::detail::pow_n(x2, n) / sprout::math::unchecked_factorial<T>(2 * n)
|
||||
: sprout::math::detail::cos_impl_1(x2, n, n + (last - n) / 2)
|
||||
+ sprout::math::detail::cos_impl_1(x2, n + (last - n) / 2, last)
|
||||
;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue