\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 r450143 = x;
double r450144 = y;
double r450145 = sin(r450144);
double r450146 = r450145 / r450144;
double r450147 = r450143 * r450146;
double r450148 = z;
double r450149 = r450147 / r450148;
return r450149;
}
double f(double x, double y, double z) {
double r450150 = x;
double r450151 = y;
double r450152 = sin(r450151);
double r450153 = r450152 / r450151;
double r450154 = r450150 * r450153;
double r450155 = -2.242008253632477e-303;
bool r450156 = r450154 <= r450155;
double r450157 = 2.5337014362254e-314;
bool r450158 = r450154 <= r450157;
double r450159 = !r450158;
bool r450160 = r450156 || r450159;
double r450161 = z;
double r450162 = r450154 / r450161;
double r450163 = r450150 * r450152;
double r450164 = r450163 / r450161;
double r450165 = r450164 / r450151;
double r450166 = r450160 ? r450162 : r450165;
return r450166;
}




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 +o rules:numerics
(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))