\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -0.0334556813538067696:\\
\;\;\;\;\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}\\
\mathbf{elif}\;x \le 1.025572474839032 \cdot 10^{-44}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{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 ((x <= -0.03345568135380677)) {
temp = ((x * (sin(y) / y)) * (1.0 / z));
} else {
double temp_1;
if ((x <= 1.0255724748390319e-44)) {
temp_1 = (1.0 / ((z / x) / (sin(y) / y)));
} else {
temp_1 = (((sin(y) * x) / y) / z);
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if x < -0.03345568135380677Initial program 0.2
rmApplied div-inv0.4
if -0.03345568135380677 < x < 1.0255724748390319e-44Initial program 5.0
rmApplied div-inv5.0
rmApplied clear-num5.6
Simplified0.9
if 1.0255724748390319e-44 < x Initial program 0.3
rmApplied div-inv0.4
rmApplied un-div-inv0.3
Applied associate-*r/0.6
Simplified0.6
Final simplification0.7
herbie shell --seed 2020049 +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))