mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +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
|
@ -23,27 +23,27 @@ namespace sprout {
|
|||
return x == 0
|
||||
? y < 0 ? std::numeric_limits<FloatType>::infinity()
|
||||
: y > 0 ? FloatType(0)
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
: x == -1 && (y == std::numeric_limits<FloatType>::infinity() || y == -std::numeric_limits<FloatType>::infinity()) ? FloatType(1)
|
||||
: x == 1 ? FloatType(1)
|
||||
: y == 0 ? FloatType(1)
|
||||
: y == -std::numeric_limits<FloatType>::infinity()
|
||||
? x < 1 && x > -1 ? std::numeric_limits<FloatType>::infinity()
|
||||
: x > 1 || x < -1 ? FloatType(0)
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
: y == std::numeric_limits<FloatType>::infinity()
|
||||
? x < 1 && x > -1 ? FloatType(0)
|
||||
: x > 1 || x < -1 ? std::numeric_limits<FloatType>::infinity()
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
: x == -std::numeric_limits<FloatType>::infinity()
|
||||
? y < 0 ? FloatType(0)
|
||||
: y > 0 ? std::numeric_limits<FloatType>::infinity()
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
: x == std::numeric_limits<FloatType>::infinity()
|
||||
? y < 0 ? FloatType(0)
|
||||
: y > 0 ? std::numeric_limits<FloatType>::infinity()
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::exp(y * sprout::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
: sprout::math::exp(y * sprout::math::log(x))
|
||||
;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue