\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(x, \log y, z \cdot \left(\log 1 - \mathsf{fma}\left(1, y, \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - tdouble f(double x, double y, double z, double t) {
double r351648 = x;
double r351649 = y;
double r351650 = log(r351649);
double r351651 = r351648 * r351650;
double r351652 = z;
double r351653 = 1.0;
double r351654 = r351653 - r351649;
double r351655 = log(r351654);
double r351656 = r351652 * r351655;
double r351657 = r351651 + r351656;
double r351658 = t;
double r351659 = r351657 - r351658;
return r351659;
}
double f(double x, double y, double z, double t) {
double r351660 = x;
double r351661 = y;
double r351662 = log(r351661);
double r351663 = z;
double r351664 = 1.0;
double r351665 = log(r351664);
double r351666 = 0.5;
double r351667 = 2.0;
double r351668 = pow(r351661, r351667);
double r351669 = pow(r351664, r351667);
double r351670 = r351668 / r351669;
double r351671 = r351666 * r351670;
double r351672 = fma(r351664, r351661, r351671);
double r351673 = r351665 - r351672;
double r351674 = r351663 * r351673;
double r351675 = fma(r351660, r351662, r351674);
double r351676 = t;
double r351677 = r351675 - r351676;
return r351677;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 9.4
Simplified9.4
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:herbie-target
(- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))