\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -7.6968499414713735 \cdot 10^{55} \lor \neg \left(z \le 2.90888923951512518 \cdot 10^{83}\right):\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\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 <= -7.696849941471373e+55) || !(z <= 2.908889239515125e+83))) {
VAR = (1.0 / ((z / x) / (sin(y) / y)));
} else {
VAR = (x * ((sin(y) / y) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.5 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if z < -7.696849941471373e+55 or 2.908889239515125e+83 < z Initial program 0.1
rmApplied div-inv0.2
rmApplied clear-num0.9
Simplified0.9
if -7.696849941471373e+55 < z < 2.908889239515125e+83Initial program 4.3
rmApplied *-un-lft-identity4.3
Applied times-frac0.5
Simplified0.5
Final simplification0.7
herbie shell --seed 2020079
(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))