\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le 8.643245776965942508676671190095322059719 \cdot 10^{-110}:\\
\;\;\;\;\frac{x}{\frac{z}{\sin y \cdot \frac{1}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r338450 = x;
double r338451 = y;
double r338452 = sin(r338451);
double r338453 = r338452 / r338451;
double r338454 = r338450 * r338453;
double r338455 = z;
double r338456 = r338454 / r338455;
return r338456;
}
double f(double x, double y, double z) {
double r338457 = z;
double r338458 = 8.643245776965943e-110;
bool r338459 = r338457 <= r338458;
double r338460 = x;
double r338461 = y;
double r338462 = sin(r338461);
double r338463 = 1.0;
double r338464 = r338463 / r338461;
double r338465 = r338462 * r338464;
double r338466 = r338457 / r338465;
double r338467 = r338460 / r338466;
double r338468 = r338460 / r338457;
double r338469 = r338462 / r338461;
double r338470 = r338468 * r338469;
double r338471 = r338459 ? r338467 : r338470;
return r338471;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 1.7 |
if z < 8.643245776965943e-110Initial program 3.7
rmApplied associate-/l*2.1
rmApplied div-inv2.2
if 8.643245776965943e-110 < z Initial program 0.6
rmApplied associate-/l*3.9
rmApplied associate-/r/0.7
Final simplification1.7
herbie shell --seed 2019209 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))