\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 r282861 = x;
double r282862 = y;
double r282863 = 0.5;
double r282864 = r282862 + r282863;
double r282865 = log(r282862);
double r282866 = r282864 * r282865;
double r282867 = r282861 - r282866;
double r282868 = r282867 + r282862;
double r282869 = z;
double r282870 = r282868 - r282869;
return r282870;
}
double f(double x, double y, double z) {
double r282871 = x;
double r282872 = y;
double r282873 = log(r282872);
double r282874 = -r282873;
double r282875 = 0.5;
double r282876 = r282872 + r282875;
double r282877 = fma(r282874, r282876, r282872);
double r282878 = r282871 + r282877;
double r282879 = z;
double r282880 = r282878 - r282879;
return r282880;
}




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 2019212 +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))