\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 r331992 = x;
double r331993 = y;
double r331994 = log(r331993);
double r331995 = r331992 * r331994;
double r331996 = z;
double r331997 = 1.0;
double r331998 = r331997 - r331993;
double r331999 = log(r331998);
double r332000 = r331996 * r331999;
double r332001 = r331995 + r332000;
double r332002 = t;
double r332003 = r332001 - r332002;
return r332003;
}
double f(double x, double y, double z, double t) {
double r332004 = x;
double r332005 = y;
double r332006 = log(r332005);
double r332007 = z;
double r332008 = 1.0;
double r332009 = log(r332008);
double r332010 = 0.5;
double r332011 = 2.0;
double r332012 = pow(r332005, r332011);
double r332013 = pow(r332008, r332011);
double r332014 = r332012 / r332013;
double r332015 = r332010 * r332014;
double r332016 = fma(r332008, r332005, r332015);
double r332017 = r332009 - r332016;
double r332018 = r332007 * r332017;
double r332019 = fma(r332004, r332006, r332018);
double r332020 = t;
double r332021 = r332019 - r332020;
return r332021;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
Initial program 9.3
Simplified9.3
Taylor expanded around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019199 +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))