llvm-capstone/libc/utils/MPFRWrapper
lntue bc7a3bd864
[libc][math] Implement powf function correctly rounded to all rounding modes. (#71188)
We compute `pow(x, y)` using the formula
```
  pow(x, y) = x^y = 2^(y * log2(x))
```
We follow similar steps as in `log2f(x)` and `exp2f(x)`, by breaking
down into `hi + mid + lo` parts, in which `hi` parts are computed using
the exponent field directly, `mid` parts will use look-up tables, and
`lo` parts are approximated by polynomials.

We add some speedup for common use-cases:
```
  pow(2, y) = exp2(y)
  pow(10, y) = exp10(y)
  pow(x, 2) = x * x
  pow(x, 1/2) = sqrt(x)
  pow(x, -1/2) = rsqrt(x) - to be added
```
2023-11-06 16:54:25 -05:00
..
check_mpfr.cpp
CMakeLists.txt [libc] fix MPFR rounding problems in fuzz test 2023-07-05 10:53:40 -07:00
mpfr_inc.h [libc] Use MPFR for strtofloat fuzzing 2023-05-22 11:04:53 -07:00
MPFRUtils.cpp [libc][math] Implement powf function correctly rounded to all rounding modes. (#71188) 2023-11-06 16:54:25 -05:00
MPFRUtils.h [libc][math] Implement powf function correctly rounded to all rounding modes. (#71188) 2023-11-06 16:54:25 -05:00