\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -130312301642489093169348608 \lor \neg \left(z \le 1.127503885584835035756866392214263129945 \cdot 10^{69}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r621147 = x;
double r621148 = y;
double r621149 = sin(r621148);
double r621150 = r621149 / r621148;
double r621151 = r621147 * r621150;
double r621152 = z;
double r621153 = r621151 / r621152;
return r621153;
}
double f(double x, double y, double z) {
double r621154 = z;
double r621155 = -1.303123016424891e+26;
bool r621156 = r621154 <= r621155;
double r621157 = 1.127503885584835e+69;
bool r621158 = r621154 <= r621157;
double r621159 = !r621158;
bool r621160 = r621156 || r621159;
double r621161 = x;
double r621162 = r621161 / r621154;
double r621163 = y;
double r621164 = sin(r621163);
double r621165 = r621163 / r621164;
double r621166 = r621162 / r621165;
double r621167 = r621154 * r621165;
double r621168 = r621161 / r621167;
double r621169 = r621160 ? r621166 : r621168;
return r621169;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if z < -1.303123016424891e+26 or 1.127503885584835e+69 < z Initial program 0.1
rmApplied associate-/l*6.2
Simplified6.2
rmApplied associate-/r*0.1
if -1.303123016424891e+26 < z < 1.127503885584835e+69Initial program 4.7
rmApplied associate-/l*0.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019303 +o rules:numerics
(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))