x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\mathsf{fma}\left(x, 0.5, \log \left(\sqrt[3]{z}\right) \cdot y + \mathsf{fma}\left(2, \log \left(\sqrt[3]{z}\right), 1 - z\right) \cdot y\right)double f(double x, double y, double z) {
double r302981 = x;
double r302982 = 0.5;
double r302983 = r302981 * r302982;
double r302984 = y;
double r302985 = 1.0;
double r302986 = z;
double r302987 = r302985 - r302986;
double r302988 = log(r302986);
double r302989 = r302987 + r302988;
double r302990 = r302984 * r302989;
double r302991 = r302983 + r302990;
return r302991;
}
double f(double x, double y, double z) {
double r302992 = x;
double r302993 = 0.5;
double r302994 = z;
double r302995 = cbrt(r302994);
double r302996 = log(r302995);
double r302997 = y;
double r302998 = r302996 * r302997;
double r302999 = 2.0;
double r303000 = 1.0;
double r303001 = r303000 - r302994;
double r303002 = fma(r302999, r302996, r303001);
double r303003 = r303002 * r302997;
double r303004 = r302998 + r303003;
double r303005 = fma(r302992, r302993, r303004);
return r303005;
}




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 distribute-lft-in0.1
rmApplied add-cube-cbrt0.1
Applied log-prod0.1
Applied distribute-rgt-in0.1
Applied associate-+r+0.1
Simplified0.1
Taylor expanded around inf 0.1
rmApplied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020043 +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)))))