x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\mathsf{fma}\left(x, 0.5, y \cdot \mathsf{fma}\left(\frac{2}{3}, \log z, 1 - z\right) + \left(\log \left(\sqrt[3]{{z}^{\frac{2}{3}}}\right) \cdot y + \log \left(\sqrt[3]{\sqrt[3]{z}}\right) \cdot y\right)\right)double f(double x, double y, double z) {
double r163644 = x;
double r163645 = 0.5;
double r163646 = r163644 * r163645;
double r163647 = y;
double r163648 = 1.0;
double r163649 = z;
double r163650 = r163648 - r163649;
double r163651 = log(r163649);
double r163652 = r163650 + r163651;
double r163653 = r163647 * r163652;
double r163654 = r163646 + r163653;
return r163654;
}
double f(double x, double y, double z) {
double r163655 = x;
double r163656 = 0.5;
double r163657 = y;
double r163658 = 0.6666666666666666;
double r163659 = z;
double r163660 = log(r163659);
double r163661 = 1.0;
double r163662 = r163661 - r163659;
double r163663 = fma(r163658, r163660, r163662);
double r163664 = r163657 * r163663;
double r163665 = pow(r163659, r163658);
double r163666 = cbrt(r163665);
double r163667 = log(r163666);
double r163668 = r163667 * r163657;
double r163669 = cbrt(r163659);
double r163670 = cbrt(r163669);
double r163671 = log(r163670);
double r163672 = r163671 * r163657;
double r163673 = r163668 + r163672;
double r163674 = r163664 + r163673;
double r163675 = fma(r163655, r163656, r163674);
return r163675;
}




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
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Applied associate-+r+0.1
Simplified0.1
rmApplied distribute-lft-in0.1
Simplified0.1
rmApplied add-cube-cbrt0.1
Applied cbrt-prod0.1
Applied log-prod0.1
Applied distribute-lft-in0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019347 +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)))))