\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({y}^{\frac{1}{3}}\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 r292201 = x;
double r292202 = y;
double r292203 = log(r292202);
double r292204 = r292201 * r292203;
double r292205 = z;
double r292206 = 1.0;
double r292207 = r292206 - r292202;
double r292208 = log(r292207);
double r292209 = r292205 * r292208;
double r292210 = r292204 + r292209;
double r292211 = t;
double r292212 = r292210 - r292211;
return r292212;
}
double f(double x, double y, double z, double t) {
double r292213 = 2.0;
double r292214 = y;
double r292215 = cbrt(r292214);
double r292216 = log(r292215);
double r292217 = r292213 * r292216;
double r292218 = x;
double r292219 = 0.3333333333333333;
double r292220 = pow(r292214, r292219);
double r292221 = log(r292220);
double r292222 = r292221 * r292218;
double r292223 = fma(r292217, r292218, r292222);
double r292224 = -0.5;
double r292225 = z;
double r292226 = pow(r292214, r292213);
double r292227 = r292225 * r292226;
double r292228 = 1.0;
double r292229 = pow(r292228, r292213);
double r292230 = r292227 / r292229;
double r292231 = log(r292228);
double r292232 = r292228 * r292214;
double r292233 = r292231 - r292232;
double r292234 = r292225 * r292233;
double r292235 = fma(r292224, r292230, r292234);
double r292236 = r292223 + r292235;
double r292237 = t;
double r292238 = r292236 - r292237;
return r292238;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 9.6
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-cube-cbrt0.3
Applied log-prod0.4
Applied distribute-lft-in0.4
Simplified0.4
Simplified0.4
rmApplied fma-def0.3
rmApplied pow1/30.3
Final simplification0.3
herbie shell --seed 2019304 +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.333333333333333315 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1 y)))) t))