\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \frac{\sin y}{y}}{z} \le -7.27792199657957297 \cdot 10^{48}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r501827 = x;
double r501828 = y;
double r501829 = sin(r501828);
double r501830 = r501829 / r501828;
double r501831 = r501827 * r501830;
double r501832 = z;
double r501833 = r501831 / r501832;
return r501833;
}
double f(double x, double y, double z) {
double r501834 = x;
double r501835 = y;
double r501836 = sin(r501835);
double r501837 = r501836 / r501835;
double r501838 = r501834 * r501837;
double r501839 = z;
double r501840 = r501838 / r501839;
double r501841 = -7.277921996579573e+48;
bool r501842 = r501840 <= r501841;
double r501843 = r501835 / r501836;
double r501844 = r501839 * r501843;
double r501845 = r501834 / r501844;
double r501846 = r501834 / r501839;
double r501847 = r501846 / r501843;
double r501848 = r501842 ? r501845 : r501847;
return r501848;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.9 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if (/ (* x (/ (sin y) y)) z) < -7.277921996579573e+48Initial program 0.2
rmApplied associate-/l*0.2
Simplified0.2
if -7.277921996579573e+48 < (/ (* x (/ (sin y) y)) z) Initial program 3.3
rmApplied associate-/l*3.2
Simplified3.3
rmApplied associate-/r*1.7
Final simplification1.5
herbie shell --seed 2020045
(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))