\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.155566547691587058014765982566123084784 \cdot 10^{-290} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.212547594237189431415383106313707223784 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{1 \cdot \left(x \cdot \frac{1}{\frac{y}{\sin y}}\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r474670 = x;
double r474671 = y;
double r474672 = sin(r474671);
double r474673 = r474672 / r474671;
double r474674 = r474670 * r474673;
double r474675 = z;
double r474676 = r474674 / r474675;
return r474676;
}
double f(double x, double y, double z) {
double r474677 = x;
double r474678 = y;
double r474679 = sin(r474678);
double r474680 = r474679 / r474678;
double r474681 = r474677 * r474680;
double r474682 = -2.155566547691587e-290;
bool r474683 = r474681 <= r474682;
double r474684 = 2.2125475942371894e-152;
bool r474685 = r474681 <= r474684;
double r474686 = !r474685;
bool r474687 = r474683 || r474686;
double r474688 = 1.0;
double r474689 = r474678 / r474679;
double r474690 = r474688 / r474689;
double r474691 = r474677 * r474690;
double r474692 = r474688 * r474691;
double r474693 = z;
double r474694 = r474692 / r474693;
double r474695 = r474693 / r474680;
double r474696 = r474677 / r474695;
double r474697 = r474687 ? r474694 : r474696;
return r474697;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if (* x (/ (sin y) y)) < -2.155566547691587e-290 or 2.2125475942371894e-152 < (* x (/ (sin y) y)) Initial program 0.2
rmApplied clear-num0.2
rmApplied *-un-lft-identity0.2
Applied associate-*l*0.2
Simplified0.2
rmApplied div-inv0.2
if -2.155566547691587e-290 < (* x (/ (sin y) y)) < 2.2125475942371894e-152Initial program 8.7
rmApplied associate-/l*0.6
Final simplification0.3
herbie shell --seed 2019354
(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))