Gamma implementation. \param arg function argument \return function value stored in single-preicision
| 1614 | /// \param arg function argument |
| 1615 | /// \return function value stored in single-preicision |
| 1616 | static expr tgamma(float arg) |
| 1617 | { |
| 1618 | #if HALF_ENABLE_CPP11_CMATH |
| 1619 | return expr(std::tgamma(arg)); |
| 1620 | #else |
| 1621 | if(arg == 0.0f) |
| 1622 | return builtin_signbit(arg) ? expr(-std::numeric_limits<float>::infinity()) : expr(std::numeric_limits<float>::infinity()); |
| 1623 | if(arg < 0.0f) |
| 1624 | { |
| 1625 | float i, f = std::modf(-arg, &i); |
| 1626 | if(f == 0.0f) |
| 1627 | return expr(std::numeric_limits<float>::quiet_NaN()); |
| 1628 | double value = 3.1415926535897932384626433832795 / (std::sin(3.1415926535897932384626433832795*f)*std::exp(lgamma(1.0-arg))); |
| 1629 | return expr(static_cast<float>((std::fmod(i, 2.0f)==0.0f) ? -value : value)); |
| 1630 | } |
| 1631 | if(builtin_isinf(arg)) |
| 1632 | return expr(arg); |
| 1633 | return expr(static_cast<float>(std::exp(lgamma(static_cast<double>(arg))))); |
| 1634 | #endif |
| 1635 | } |
| 1636 | |
| 1637 | /// Floor implementation. |
| 1638 | /// \param arg value to round |
nothing calls this directly
no test coverage detected