\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(2 \cdot \log \left(\sqrt[3]{y}\right), x, \log \left(\sqrt[3]{y}\right) \cdot x\right) + \mathsf{fma}\left(\frac{-1}{2}, \frac{z \cdot {y}^{2}}{{1}^{2}}, z \cdot \left(\log 1 - 1 \cdot y\right)\right)\right) - tdouble f(double x, double y, double z, double t) {
double r607510 = x;
double r607511 = y;
double r607512 = log(r607511);
double r607513 = r607510 * r607512;
double r607514 = z;
double r607515 = 1.0;
double r607516 = r607515 - r607511;
double r607517 = log(r607516);
double r607518 = r607514 * r607517;
double r607519 = r607513 + r607518;
double r607520 = t;
double r607521 = r607519 - r607520;
return r607521;
}
double f(double x, double y, double z, double t) {
double r607522 = 2.0;
double r607523 = y;
double r607524 = cbrt(r607523);
double r607525 = log(r607524);
double r607526 = r607522 * r607525;
double r607527 = x;
double r607528 = r607525 * r607527;
double r607529 = fma(r607526, r607527, r607528);
double r607530 = -0.5;
double r607531 = z;
double r607532 = pow(r607523, r607522);
double r607533 = r607531 * r607532;
double r607534 = 1.0;
double r607535 = pow(r607534, r607522);
double r607536 = r607533 / r607535;
double r607537 = log(r607534);
double r607538 = r607534 * r607523;
double r607539 = r607537 - r607538;
double r607540 = r607531 * r607539;
double r607541 = fma(r607530, r607536, r607540);
double r607542 = r607529 + r607541;
double r607543 = t;
double r607544 = r607542 - r607543;
return r607544;
}




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
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-cube-cbrt0.4
Applied log-prod0.4
Applied distribute-lft-in0.4
Simplified0.4
Simplified0.4
rmApplied fma-def0.4
Final simplification0.4
herbie shell --seed 2019351 +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))