\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -8.39776791459329182580218143042860438466 \cdot 10^{-25} \lor \neg \left(x \le 8.137178980191325763102082751642143028499 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r580345 = x;
double r580346 = y;
double r580347 = sin(r580346);
double r580348 = r580347 / r580346;
double r580349 = r580345 * r580348;
double r580350 = z;
double r580351 = r580349 / r580350;
return r580351;
}
double f(double x, double y, double z) {
double r580352 = x;
double r580353 = -8.397767914593292e-25;
bool r580354 = r580352 <= r580353;
double r580355 = 8.137178980191326e-53;
bool r580356 = r580352 <= r580355;
double r580357 = !r580356;
bool r580358 = r580354 || r580357;
double r580359 = y;
double r580360 = sin(r580359);
double r580361 = r580352 * r580360;
double r580362 = r580361 / r580359;
double r580363 = z;
double r580364 = r580362 / r580363;
double r580365 = r580360 / r580359;
double r580366 = r580363 / r580365;
double r580367 = r580352 / r580366;
double r580368 = r580358 ? r580364 : r580367;
return r580368;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.3 |
if x < -8.397767914593292e-25 or 8.137178980191326e-53 < x Initial program 0.2
rmApplied associate-*r/0.5
if -8.397767914593292e-25 < x < 8.137178980191326e-53Initial program 5.1
rmApplied associate-/l*0.1
Final simplification0.3
herbie shell --seed 2019362 +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))