\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\left(x + \mathsf{fma}\left(y + 0.5, -\log y, e^{\log \left(\left(\left(-\log y\right) + \log y\right) \cdot \left(y + 0.5\right) + y\right)}\right)\right) - zdouble f(double x, double y, double z) {
double r199935 = x;
double r199936 = y;
double r199937 = 0.5;
double r199938 = r199936 + r199937;
double r199939 = log(r199936);
double r199940 = r199938 * r199939;
double r199941 = r199935 - r199940;
double r199942 = r199941 + r199936;
double r199943 = z;
double r199944 = r199942 - r199943;
return r199944;
}
double f(double x, double y, double z) {
double r199945 = x;
double r199946 = y;
double r199947 = 0.5;
double r199948 = r199946 + r199947;
double r199949 = log(r199946);
double r199950 = -r199949;
double r199951 = r199950 + r199949;
double r199952 = r199951 * r199948;
double r199953 = r199952 + r199946;
double r199954 = log(r199953);
double r199955 = exp(r199954);
double r199956 = fma(r199948, r199950, r199955);
double r199957 = r199945 + r199956;
double r199958 = z;
double r199959 = r199957 - r199958;
return r199959;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied prod-diff0.1
Applied associate-+l+0.1
Simplified0.2
rmApplied fma-udef0.2
Applied associate-+l+0.2
Simplified0.1
rmApplied add-exp-log0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))