\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \leq -3.883112101818342 \cdot 10^{-249} \lor \neg \left(x \cdot \frac{\sin y}{y} \leq 5.772637197898606 \cdot 10^{-277}\right):\\
\;\;\;\;\frac{x \cdot \frac{1}{\frac{y}{\sin y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * (((double) sin(y)) / y))) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (x * (((double) sin(y)) / y))) <= -3.883112101818342e-249) || !(((double) (x * (((double) sin(y)) / y))) <= 5.772637197898606e-277))) {
VAR = (((double) (x * (1.0 / (y / ((double) sin(y)))))) / z);
} else {
VAR = ((double) (x * ((((double) sin(y)) / y) / z)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if (* x (/ (sin y) y)) < -3.88311210181834197e-249 or 5.7726371978986063e-277 < (* x (/ (sin y) y)) Initial program 0.2
rmApplied clear-num0.2
if -3.88311210181834197e-249 < (* x (/ (sin y) y)) < 5.7726371978986063e-277Initial program 12.4
rmApplied clear-num12.4
rmApplied *-un-lft-identity12.4
Applied times-frac0.2
Simplified0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020196
(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.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))