\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \frac{\sin y}{y}}{z} \le -7.501794388521635 \cdot 10^{67} \lor \neg \left(\frac{x \cdot \frac{\sin y}{y}}{z} \le 6.13088843254250892 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\sin y \cdot \frac{\frac{x}{z}}{y}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (((double) sin(y)) / y)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (((double) (x * ((double) (((double) sin(y)) / y)))) / z)) <= -7.501794388521635e+67) || !(((double) (((double) (x * ((double) (((double) sin(y)) / y)))) / z)) <= 6.130888432542509e-167))) {
VAR = ((double) (x / ((double) (z / ((double) (((double) sin(y)) / y))))));
} else {
VAR = ((double) (((double) sin(y)) * ((double) (((double) (x / z)) / y))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.9 |
if (/ (* x (/ (sin y) y)) z) < -7.501794388521635e67 or 6.13088843254250892e-167 < (/ (* x (/ (sin y) y)) z) Initial program 0.4
rmApplied associate-/l*1.4
if -7.501794388521635e67 < (/ (* x (/ (sin y) y)) z) < 6.13088843254250892e-167Initial program 4.4
rmApplied associate-/l*4.5
rmApplied div-inv4.5
Applied *-un-lft-identity4.5
Applied times-frac6.4
Applied *-un-lft-identity6.4
Applied times-frac6.7
Simplified6.7
Simplified0.6
Final simplification0.9
herbie shell --seed 2020149
(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.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))