x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
x \cdot 0.5 + \left(y \cdot \mathsf{fma}\left(2, \log \left(\sqrt[3]{z}\right), 1 - z\right) + y \cdot \log \left(\sqrt[3]{{z}^{\frac{2}{3}}} \cdot \sqrt[3]{\sqrt[3]{z}}\right)\right)double f(double x, double y, double z) {
double r249105 = x;
double r249106 = 0.5;
double r249107 = r249105 * r249106;
double r249108 = y;
double r249109 = 1.0;
double r249110 = z;
double r249111 = r249109 - r249110;
double r249112 = log(r249110);
double r249113 = r249111 + r249112;
double r249114 = r249108 * r249113;
double r249115 = r249107 + r249114;
return r249115;
}
double f(double x, double y, double z) {
double r249116 = x;
double r249117 = 0.5;
double r249118 = r249116 * r249117;
double r249119 = y;
double r249120 = 2.0;
double r249121 = z;
double r249122 = cbrt(r249121);
double r249123 = log(r249122);
double r249124 = 1.0;
double r249125 = r249124 - r249121;
double r249126 = fma(r249120, r249123, r249125);
double r249127 = r249119 * r249126;
double r249128 = 0.6666666666666666;
double r249129 = pow(r249121, r249128);
double r249130 = cbrt(r249129);
double r249131 = cbrt(r249122);
double r249132 = r249130 * r249131;
double r249133 = log(r249132);
double r249134 = r249119 * r249133;
double r249135 = r249127 + r249134;
double r249136 = r249118 + r249135;
return r249136;
}




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