\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -2.631506410722672164338420206087803523502 \cdot 10^{-268} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 3.806735042526462495596402093270349111849 \cdot 10^{-223}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{\sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r507378 = x;
double r507379 = y;
double r507380 = sin(r507379);
double r507381 = r507380 / r507379;
double r507382 = r507378 * r507381;
double r507383 = z;
double r507384 = r507382 / r507383;
return r507384;
}
double f(double x, double y, double z) {
double r507385 = x;
double r507386 = y;
double r507387 = sin(r507386);
double r507388 = r507387 / r507386;
double r507389 = r507385 * r507388;
double r507390 = -2.631506410722672e-268;
bool r507391 = r507389 <= r507390;
double r507392 = 3.8067350425264625e-223;
bool r507393 = r507389 <= r507392;
double r507394 = !r507393;
bool r507395 = r507391 || r507394;
double r507396 = z;
double r507397 = r507389 / r507396;
double r507398 = r507385 / r507396;
double r507399 = r507398 * r507388;
double r507400 = r507395 ? r507397 : r507399;
return r507400;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
if (* x (/ (sin y) y)) < -2.631506410722672e-268 or 3.8067350425264625e-223 < (* x (/ (sin y) y)) Initial program 0.2
if -2.631506410722672e-268 < (* x (/ (sin y) y)) < 3.8067350425264625e-223Initial program 10.7
rmApplied associate-/l*0.3
rmApplied associate-/r/0.2
Final simplification0.2
herbie shell --seed 2019322
(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))