\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\left(x + \mathsf{fma}\left(-\log y, y + 0.5, y\right)\right) - zdouble f(double x, double y, double z) {
double r250949 = x;
double r250950 = y;
double r250951 = 0.5;
double r250952 = r250950 + r250951;
double r250953 = log(r250950);
double r250954 = r250952 * r250953;
double r250955 = r250949 - r250954;
double r250956 = r250955 + r250950;
double r250957 = z;
double r250958 = r250956 - r250957;
return r250958;
}
double f(double x, double y, double z) {
double r250959 = x;
double r250960 = y;
double r250961 = log(r250960);
double r250962 = -r250961;
double r250963 = 0.5;
double r250964 = r250960 + r250963;
double r250965 = fma(r250962, r250964, r250960);
double r250966 = r250959 + r250965;
double r250967 = z;
double r250968 = r250966 - r250967;
return r250968;
}




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 sub-neg0.1
Applied associate-+l+0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019350 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))