\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.8061860642039018 \cdot 10^{-50} \lor \neg \left(z \le 8.6210839703151076 \cdot 10^{-91}\right):\\
\;\;\;\;\frac{1}{\frac{y}{\sin y}} \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z \cdot \frac{y}{\sin y}}{x}}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (((double) sin(y)) / y)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -6.806186064203902e-50) || !(z <= 8.621083970315108e-91))) {
VAR = ((double) (((double) (1.0 / ((double) (y / ((double) sin(y)))))) * ((double) (x / z))));
} else {
VAR = ((double) (1.0 / ((double) (((double) (z * ((double) (y / ((double) sin(y)))))) / x))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.5 |
if z < -6.806186064203902e-50 or 8.621083970315108e-91 < z Initial program 0.4
rmApplied *-un-lft-identity0.4
Applied associate-*r*0.4
Applied associate-/l*4.1
Simplified4.1
rmApplied clear-num4.6
Simplified4.6
rmApplied *-un-lft-identity4.6
Applied *-commutative4.6
Applied times-frac1.0
Applied add-sqr-sqrt1.0
Applied times-frac0.8
Simplified0.8
Simplified0.5
if -6.806186064203902e-50 < z < 8.621083970315108e-91Initial program 7.3
rmApplied *-un-lft-identity7.3
Applied associate-*r*7.3
Applied associate-/l*0.2
Simplified0.2
rmApplied clear-num0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2020113 +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))