\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.2420082536324771 \cdot 10^{-303} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.53370143623 \cdot 10^{-314}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r658888 = x;
double r658889 = y;
double r658890 = sin(r658889);
double r658891 = r658890 / r658889;
double r658892 = r658888 * r658891;
double r658893 = z;
double r658894 = r658892 / r658893;
return r658894;
}
double f(double x, double y, double z) {
double r658895 = x;
double r658896 = y;
double r658897 = sin(r658896);
double r658898 = r658897 / r658896;
double r658899 = r658895 * r658898;
double r658900 = -2.242008253632477e-303;
bool r658901 = r658899 <= r658900;
double r658902 = 2.5337014362254e-314;
bool r658903 = r658899 <= r658902;
double r658904 = !r658903;
bool r658905 = r658901 || r658904;
double r658906 = z;
double r658907 = r658899 / r658906;
double r658908 = r658895 * r658897;
double r658909 = r658908 / r658906;
double r658910 = r658909 / r658896;
double r658911 = r658905 ? r658907 : r658910;
return r658911;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if (* x (/ (sin y) y)) < -2.242008253632477e-303 or 2.5337014362254e-314 < (* x (/ (sin y) y)) Initial program 0.2
if -2.242008253632477e-303 < (* x (/ (sin y) y)) < 2.5337014362254e-314Initial program 17.9
rmApplied div-inv17.9
rmApplied associate-*r/18.4
Applied associate-*l/0.6
Simplified0.6
Final simplification0.2
herbie shell --seed 2020089
(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))