\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -8.39776791459329182580218143042860438466 \cdot 10^{-25} \lor \neg \left(x \le 8.137178980191325763102082751642143028499 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r383635 = x;
double r383636 = y;
double r383637 = sin(r383636);
double r383638 = r383637 / r383636;
double r383639 = r383635 * r383638;
double r383640 = z;
double r383641 = r383639 / r383640;
return r383641;
}
double f(double x, double y, double z) {
double r383642 = x;
double r383643 = -8.397767914593292e-25;
bool r383644 = r383642 <= r383643;
double r383645 = 8.137178980191326e-53;
bool r383646 = r383642 <= r383645;
double r383647 = !r383646;
bool r383648 = r383644 || r383647;
double r383649 = y;
double r383650 = sin(r383649);
double r383651 = r383642 * r383650;
double r383652 = r383651 / r383649;
double r383653 = z;
double r383654 = r383652 / r383653;
double r383655 = r383650 / r383649;
double r383656 = r383653 / r383655;
double r383657 = r383642 / r383656;
double r383658 = r383648 ? r383654 : r383657;
return r383658;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if x < -8.397767914593292e-25 or 8.137178980191326e-53 < x Initial program 0.2
rmApplied associate-*r/0.5
if -8.397767914593292e-25 < x < 8.137178980191326e-53Initial program 5.1
rmApplied associate-/l*0.1
Final simplification0.3
herbie shell --seed 2019362
(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))