\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, z - y\right)\right) + \mathsf{fma}\left(-\left(z - y\right), 1, z - y\right)double f(double x, double y, double z) {
double r347825 = x;
double r347826 = y;
double r347827 = 0.5;
double r347828 = r347826 + r347827;
double r347829 = log(r347826);
double r347830 = r347828 * r347829;
double r347831 = r347825 - r347830;
double r347832 = r347831 + r347826;
double r347833 = z;
double r347834 = r347832 - r347833;
return r347834;
}
double f(double x, double y, double z) {
double r347835 = x;
double r347836 = y;
double r347837 = log(r347836);
double r347838 = 0.5;
double r347839 = r347836 + r347838;
double r347840 = z;
double r347841 = r347840 - r347836;
double r347842 = fma(r347837, r347839, r347841);
double r347843 = r347835 - r347842;
double r347844 = -r347841;
double r347845 = 1.0;
double r347846 = fma(r347844, r347845, r347841);
double r347847 = r347843 + r347846;
return r347847;
}




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 fma-udef0.1
Applied associate--l+0.1
Applied associate--r+0.1
rmApplied add-cube-cbrt0.5
Applied add-sqr-sqrt36.6
Applied prod-diff36.6
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019354 +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))