\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.3341519654404754 \cdot 10^{-26}:\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{elif}\;z \le 90893168842109888:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r550346 = x;
double r550347 = y;
double r550348 = sin(r550347);
double r550349 = r550348 / r550347;
double r550350 = r550346 * r550349;
double r550351 = z;
double r550352 = r550350 / r550351;
return r550352;
}
double f(double x, double y, double z) {
double r550353 = z;
double r550354 = -3.3341519654404754e-26;
bool r550355 = r550353 <= r550354;
double r550356 = x;
double r550357 = y;
double r550358 = sin(r550357);
double r550359 = r550358 / r550357;
double r550360 = r550356 * r550359;
double r550361 = r550360 / r550353;
double r550362 = 9.089316884210989e+16;
bool r550363 = r550353 <= r550362;
double r550364 = r550357 / r550358;
double r550365 = r550353 * r550364;
double r550366 = r550356 / r550365;
double r550367 = r550356 / r550364;
double r550368 = r550367 / r550353;
double r550369 = r550363 ? r550366 : r550368;
double r550370 = r550355 ? r550361 : r550369;
return r550370;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -3.3341519654404754e-26Initial program 0.1
if -3.3341519654404754e-26 < z < 9.089316884210989e+16Initial program 5.9
rmApplied clear-num5.9
rmApplied *-un-lft-identity5.9
Applied associate-/r*5.9
Simplified5.9
rmApplied div-inv5.9
Applied associate-/l*0.3
Simplified0.2
if 9.089316884210989e+16 < z Initial program 0.1
rmApplied clear-num0.2
rmApplied *-un-lft-identity0.2
Applied associate-/r*0.2
Simplified0.1
Final simplification0.2
herbie shell --seed 2020036
(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))