\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -6.319714735762894040261866058671149783272 \cdot 10^{-124} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 6.641146027642848148772445195187677057815 \cdot 10^{-283}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r343439 = x;
double r343440 = y;
double r343441 = sin(r343440);
double r343442 = r343441 / r343440;
double r343443 = r343439 * r343442;
double r343444 = z;
double r343445 = r343443 / r343444;
return r343445;
}
double f(double x, double y, double z) {
double r343446 = x;
double r343447 = y;
double r343448 = sin(r343447);
double r343449 = r343448 / r343447;
double r343450 = r343446 * r343449;
double r343451 = -6.319714735762894e-124;
bool r343452 = r343450 <= r343451;
double r343453 = 6.641146027642848e-283;
bool r343454 = r343450 <= r343453;
double r343455 = !r343454;
bool r343456 = r343452 || r343455;
double r343457 = z;
double r343458 = r343450 / r343457;
double r343459 = r343446 / r343457;
double r343460 = r343447 / r343448;
double r343461 = r343459 / r343460;
double r343462 = r343456 ? r343458 : r343461;
return r343462;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if (* x (/ (sin y) y)) < -6.319714735762894e-124 or 6.641146027642848e-283 < (* x (/ (sin y) y)) Initial program 0.2
if -6.319714735762894e-124 < (* x (/ (sin y) y)) < 6.641146027642848e-283Initial program 8.0
rmApplied associate-/l*0.7
Simplified0.7
rmApplied associate-/r*0.5
Final simplification0.3
herbie shell --seed 2019325 +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))