\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -87678001982141.2969 \lor \neg \left(z \le 4.87378218103819904 \cdot 10^{-93}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{\sin y} \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r441859 = x;
double r441860 = y;
double r441861 = sin(r441860);
double r441862 = r441861 / r441860;
double r441863 = r441859 * r441862;
double r441864 = z;
double r441865 = r441863 / r441864;
return r441865;
}
double f(double x, double y, double z) {
double r441866 = z;
double r441867 = -87678001982141.3;
bool r441868 = r441866 <= r441867;
double r441869 = 4.873782181038199e-93;
bool r441870 = r441866 <= r441869;
double r441871 = !r441870;
bool r441872 = r441868 || r441871;
double r441873 = x;
double r441874 = r441873 / r441866;
double r441875 = y;
double r441876 = sin(r441875);
double r441877 = r441875 / r441876;
double r441878 = r441874 / r441877;
double r441879 = r441877 * r441866;
double r441880 = r441873 / r441879;
double r441881 = r441872 ? r441878 : r441880;
return r441881;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if z < -87678001982141.3 or 4.873782181038199e-93 < z Initial program 0.4
rmApplied clear-num0.4
rmApplied div-inv0.5
rmApplied un-div-inv0.5
Applied associate-*l/0.4
Simplified0.3
if -87678001982141.3 < z < 4.873782181038199e-93Initial program 6.6
rmApplied clear-num6.6
rmApplied div-inv6.8
rmApplied un-div-inv6.7
Applied frac-times0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020064
(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))