\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -1.667800433775549790266656174829587494332 \cdot 10^{-292} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 0.0\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \sin y}{z \cdot y}\\
\end{array}double f(double x, double y, double z) {
double r318464 = x;
double r318465 = y;
double r318466 = sin(r318465);
double r318467 = r318466 / r318465;
double r318468 = r318464 * r318467;
double r318469 = z;
double r318470 = r318468 / r318469;
return r318470;
}
double f(double x, double y, double z) {
double r318471 = x;
double r318472 = y;
double r318473 = sin(r318472);
double r318474 = r318473 / r318472;
double r318475 = r318471 * r318474;
double r318476 = -1.6678004337755498e-292;
bool r318477 = r318475 <= r318476;
double r318478 = 0.0;
bool r318479 = r318475 <= r318478;
double r318480 = !r318479;
bool r318481 = r318477 || r318480;
double r318482 = z;
double r318483 = r318475 / r318482;
double r318484 = r318471 * r318473;
double r318485 = r318482 * r318472;
double r318486 = r318484 / r318485;
double r318487 = r318481 ? r318483 : r318486;
return r318487;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if (* x (/ (sin y) y)) < -1.6678004337755498e-292 or 0.0 < (* x (/ (sin y) y)) Initial program 1.5
rmApplied add-cube-cbrt2.4
Applied times-frac3.2
rmApplied frac-times2.4
Simplified1.5
if -1.6678004337755498e-292 < (* x (/ (sin y) y)) < 0.0Initial program 14.5
rmApplied add-cube-cbrt14.6
Applied times-frac0.5
rmApplied frac-times14.6
Simplified14.5
rmApplied associate-*r/17.9
Applied associate-/l/3.6
Final simplification0.5
herbie shell --seed 2019303
(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))