x \cdot 0.5 + y \cdot \left(\left(1 - z\right) + \log z\right)
\mathsf{fma}\left(x, 0.5, y \cdot \left(1 - \left(z - \log z\right)\right)\right)double f(double x, double y, double z) {
double r279831 = x;
double r279832 = 0.5;
double r279833 = r279831 * r279832;
double r279834 = y;
double r279835 = 1.0;
double r279836 = z;
double r279837 = r279835 - r279836;
double r279838 = log(r279836);
double r279839 = r279837 + r279838;
double r279840 = r279834 * r279839;
double r279841 = r279833 + r279840;
return r279841;
}
double f(double x, double y, double z) {
double r279842 = x;
double r279843 = 0.5;
double r279844 = y;
double r279845 = 1.0;
double r279846 = z;
double r279847 = log(r279846);
double r279848 = r279846 - r279847;
double r279849 = r279845 - r279848;
double r279850 = r279844 * r279849;
double r279851 = fma(r279842, r279843, r279850);
return r279851;
}




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-lft-in0.1
Applied associate-+l+0.1
Simplified0.1
Taylor expanded around 0 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)))))