\frac{x \cdot \frac{\sin y}{y}}{z}\frac{\frac{x}{z}}{\frac{y}{\sin y}}double f(double x, double y, double z) {
double r641267 = x;
double r641268 = y;
double r641269 = sin(r641268);
double r641270 = r641269 / r641268;
double r641271 = r641267 * r641270;
double r641272 = z;
double r641273 = r641271 / r641272;
return r641273;
}
double f(double x, double y, double z) {
double r641274 = x;
double r641275 = z;
double r641276 = r641274 / r641275;
double r641277 = y;
double r641278 = sin(r641277);
double r641279 = r641277 / r641278;
double r641280 = r641276 / r641279;
return r641280;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 3.0 |
Initial program 2.7
rmApplied associate-/l*3.0
Simplified3.0
rmApplied associate-/r*3.0
Final simplification3.0
herbie shell --seed 2020042 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))