\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -685445088654725504 \lor \neg \left(z \le 9.777982240122365731670702998885673597927 \cdot 10^{44}\right):\\
\;\;\;\;\frac{\frac{1}{\frac{z}{x}}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r434963 = x;
double r434964 = y;
double r434965 = sin(r434964);
double r434966 = r434965 / r434964;
double r434967 = r434963 * r434966;
double r434968 = z;
double r434969 = r434967 / r434968;
return r434969;
}
double f(double x, double y, double z) {
double r434970 = z;
double r434971 = -6.854450886547255e+17;
bool r434972 = r434970 <= r434971;
double r434973 = 9.777982240122366e+44;
bool r434974 = r434970 <= r434973;
double r434975 = !r434974;
bool r434976 = r434972 || r434975;
double r434977 = 1.0;
double r434978 = x;
double r434979 = r434970 / r434978;
double r434980 = r434977 / r434979;
double r434981 = y;
double r434982 = sin(r434981);
double r434983 = r434982 / r434981;
double r434984 = r434977 / r434983;
double r434985 = r434980 / r434984;
double r434986 = r434983 / r434970;
double r434987 = r434978 * r434986;
double r434988 = r434976 ? r434985 : r434987;
return r434988;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if z < -6.854450886547255e+17 or 9.777982240122366e+44 < z Initial program 0.1
rmApplied add-cube-cbrt0.9
Applied add-cube-cbrt0.4
Applied times-frac0.4
rmApplied clear-num1.2
Simplified0.9
rmApplied div-inv0.9
Applied associate-/r*0.5
if -6.854450886547255e+17 < z < 9.777982240122366e+44Initial program 4.9
rmApplied *-un-lft-identity4.9
Applied times-frac0.4
Simplified0.4
Final simplification0.5
herbie shell --seed 2019326 +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))