\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.5650005924154194 \cdot 10^{57}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{elif}\;z \le 5.6950970084071335 \cdot 10^{37}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \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 temp;
if ((z <= -4.5650005924154194e+57)) {
temp = ((x / z) / (1.0 / (sin(y) / y)));
} else {
double temp_1;
if ((z <= 5.695097008407134e+37)) {
temp_1 = (x * ((sin(y) / y) / z));
} else {
temp_1 = (((x * sin(y)) / y) / z);
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.8 |
if z < -4.5650005924154194e+57Initial program 0.1
rmApplied associate-/l*6.6
rmApplied div-inv6.7
Applied associate-/r*0.1
if -4.5650005924154194e+57 < z < 5.695097008407134e+37Initial program 4.9
rmApplied *-un-lft-identity4.9
Applied times-frac0.4
Simplified0.4
if 5.695097008407134e+37 < z Initial program 0.1
rmApplied associate-*r/2.5
Final simplification0.8
herbie shell --seed 2020053
(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))