\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.8941292308796897 \cdot 10^{-61} \lor \neg \left(z \le 1.6470200371492856 \cdot 10^{-93}\right):\\
\;\;\;\;\frac{x \cdot \left(\sin y \cdot \frac{1}{y}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double code(double x, double y, double z) {
return ((x * (sin(y) / y)) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -9.89412923087969e-61) || !(z <= 1.6470200371492856e-93))) {
VAR = ((x * (sin(y) * (1.0 / y))) / z);
} else {
VAR = (x * ((sin(y) / y) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
if z < -9.89412923087969e-61 or 1.6470200371492856e-93 < z Initial program 0.3
rmApplied div-inv0.4
if -9.89412923087969e-61 < z < 1.6470200371492856e-93Initial program 7.6
rmApplied *-un-lft-identity7.6
Applied times-frac0.3
Simplified0.3
Final simplification0.4
herbie shell --seed 2020075 +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))