\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(x, 2 \cdot \log \left(\sqrt[3]{y}\right), x \cdot \log \left(\sqrt[3]{y}\right)\right) + z \cdot \left(\log 1 - \left(1 \cdot y + \frac{1}{2} \cdot \frac{{y}^{2}}{{1}^{2}}\right)\right)\right) - tdouble f(double x, double y, double z, double t) {
double r343730 = x;
double r343731 = y;
double r343732 = log(r343731);
double r343733 = r343730 * r343732;
double r343734 = z;
double r343735 = 1.0;
double r343736 = r343735 - r343731;
double r343737 = log(r343736);
double r343738 = r343734 * r343737;
double r343739 = r343733 + r343738;
double r343740 = t;
double r343741 = r343739 - r343740;
return r343741;
}
double f(double x, double y, double z, double t) {
double r343742 = x;
double r343743 = 2.0;
double r343744 = y;
double r343745 = cbrt(r343744);
double r343746 = log(r343745);
double r343747 = r343743 * r343746;
double r343748 = r343742 * r343746;
double r343749 = fma(r343742, r343747, r343748);
double r343750 = z;
double r343751 = 1.0;
double r343752 = log(r343751);
double r343753 = r343751 * r343744;
double r343754 = 0.5;
double r343755 = pow(r343744, r343743);
double r343756 = pow(r343751, r343743);
double r343757 = r343755 / r343756;
double r343758 = r343754 * r343757;
double r343759 = r343753 + r343758;
double r343760 = r343752 - r343759;
double r343761 = r343750 * r343760;
double r343762 = r343749 + r343761;
double r343763 = t;
double r343764 = r343762 - r343763;
return r343764;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 9.2
Taylor expanded around 0 0.3
rmApplied add-cube-cbrt0.3
Applied log-prod0.4
Applied distribute-lft-in0.4
Simplified0.4
rmApplied fma-def0.3
Final simplification0.3
herbie shell --seed 2020027 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1 y)))) t))