x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(\mathsf{fma}\left(2, \log \left(\sqrt[3]{z}\right), 1 - z\right) \cdot y + \log \left(\sqrt[3]{{\left({z}^{\frac{2}{3}}\right)}^{\frac{2}{3}} \cdot {\left(\sqrt[3]{z}\right)}^{\frac{2}{3}}} \cdot \sqrt[3]{\sqrt[3]{z}}\right) \cdot y\right)double f(double x, double y, double z) {
double r262351 = x;
double r262352 = 0.5;
double r262353 = r262351 * r262352;
double r262354 = y;
double r262355 = 1.0;
double r262356 = z;
double r262357 = r262355 - r262356;
double r262358 = log(r262356);
double r262359 = r262357 + r262358;
double r262360 = r262354 * r262359;
double r262361 = r262353 + r262360;
return r262361;
}
double f(double x, double y, double z) {
double r262362 = x;
double r262363 = 0.5;
double r262364 = r262362 * r262363;
double r262365 = 2.0;
double r262366 = z;
double r262367 = cbrt(r262366);
double r262368 = log(r262367);
double r262369 = 1.0;
double r262370 = r262369 - r262366;
double r262371 = fma(r262365, r262368, r262370);
double r262372 = y;
double r262373 = r262371 * r262372;
double r262374 = 0.6666666666666666;
double r262375 = pow(r262366, r262374);
double r262376 = pow(r262375, r262374);
double r262377 = pow(r262367, r262374);
double r262378 = r262376 * r262377;
double r262379 = cbrt(r262378);
double r262380 = cbrt(r262367);
double r262381 = r262379 * r262380;
double r262382 = log(r262381);
double r262383 = r262382 * r262372;
double r262384 = r262373 + r262383;
double r262385 = r262364 + r262384;
return r262385;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied distribute-lft-in0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Applied distribute-rgt-in0.1
Applied associate-+r+0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied cbrt-prod0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied unpow-prod-down0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019326 +o rules:numerics
(FPCore (x y z)
:name "System.Random.MWC.Distributions:gamma from mwc-random-0.13.3.2"
:precision binary64
:herbie-target
(- (+ y (* 0.5 x)) (* y (- z (log z))))
(+ (* x 0.5) (* y (+ (- 1 z) (log z)))))