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(-z, 1, z\right) + y \cdot \left(1 - \left(z - \log z\right)\right)\right)double f(double x, double y, double z) {
double r362648 = x;
double r362649 = 0.5;
double r362650 = r362648 * r362649;
double r362651 = y;
double r362652 = 1.0;
double r362653 = z;
double r362654 = r362652 - r362653;
double r362655 = log(r362653);
double r362656 = r362654 + r362655;
double r362657 = r362651 * r362656;
double r362658 = r362650 + r362657;
return r362658;
}
double f(double x, double y, double z) {
double r362659 = x;
double r362660 = 0.5;
double r362661 = y;
double r362662 = z;
double r362663 = -r362662;
double r362664 = 1.0;
double r362665 = fma(r362663, r362664, r362662);
double r362666 = r362661 * r362665;
double r362667 = 1.0;
double r362668 = log(r362662);
double r362669 = r362662 - r362668;
double r362670 = r362667 - r362669;
double r362671 = r362661 * r362670;
double r362672 = r362666 + r362671;
double r362673 = fma(r362659, r362660, r362672);
return r362673;
}




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 sub-neg0.1
Applied distribute-rgt-in0.1
Applied associate-+l+0.1
Simplified0.1
rmApplied *-un-lft-identity0.1
Applied pow10.1
Applied log-pow0.1
Applied prod-diff0.1
Applied distribute-lft-in0.1
Applied associate-+r+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020047 +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)))))