\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 3.883506706037952 \cdot 10^{-64}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r25886652 = x;
double r25886653 = y;
double r25886654 = sin(r25886653);
double r25886655 = r25886654 / r25886653;
double r25886656 = r25886652 * r25886655;
double r25886657 = z;
double r25886658 = r25886656 / r25886657;
return r25886658;
}
double f(double x, double y, double z) {
double r25886659 = x;
double r25886660 = 3.883506706037952e-64;
bool r25886661 = r25886659 <= r25886660;
double r25886662 = z;
double r25886663 = y;
double r25886664 = sin(r25886663);
double r25886665 = r25886664 / r25886663;
double r25886666 = r25886662 / r25886665;
double r25886667 = r25886659 / r25886666;
double r25886668 = 1.0;
double r25886669 = r25886659 * r25886665;
double r25886670 = r25886662 / r25886669;
double r25886671 = r25886668 / r25886670;
double r25886672 = r25886661 ? r25886667 : r25886671;
return r25886672;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.8 |
if x < 3.883506706037952e-64Initial program 3.7
rmApplied associate-/l*2.1
if 3.883506706037952e-64 < x Initial program 0.5
rmApplied clear-num0.9
Final simplification1.8
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
: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))