\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.534022103388537785324346726232718774281 \cdot 10^{-197} \lor \neg \left(x \le 3.919669597540599981300396099712880953519 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{\frac{-x}{\frac{y}{\sin y}}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r434540 = x;
double r434541 = y;
double r434542 = sin(r434541);
double r434543 = r434542 / r434541;
double r434544 = r434540 * r434543;
double r434545 = z;
double r434546 = r434544 / r434545;
return r434546;
}
double f(double x, double y, double z) {
double r434547 = x;
double r434548 = -1.5340221033885378e-197;
bool r434549 = r434547 <= r434548;
double r434550 = 3.9196695975406e-124;
bool r434551 = r434547 <= r434550;
double r434552 = !r434551;
bool r434553 = r434549 || r434552;
double r434554 = -r434547;
double r434555 = y;
double r434556 = sin(r434555);
double r434557 = r434555 / r434556;
double r434558 = r434554 / r434557;
double r434559 = z;
double r434560 = -r434559;
double r434561 = r434558 / r434560;
double r434562 = r434559 * r434557;
double r434563 = r434547 / r434562;
double r434564 = r434553 ? r434561 : r434563;
return r434564;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
if x < -1.5340221033885378e-197 or 3.9196695975406e-124 < x Initial program 1.2
rmApplied clear-num1.3
rmApplied frac-2neg1.3
Simplified1.3
if -1.5340221033885378e-197 < x < 3.9196695975406e-124Initial program 6.5
rmApplied clear-num6.5
rmApplied associate-/l*0.1
Simplified0.1
Final simplification1.0
herbie shell --seed 2019294
(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))