\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -9.3033804533966324 \cdot 10^{-7} \lor \neg \left(x \le 7.1451913129313926 \cdot 10^{69}\right):\\
\;\;\;\;\frac{x \cdot \frac{\sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r1093238 = x;
double r1093239 = y;
double r1093240 = sin(r1093239);
double r1093241 = r1093240 / r1093239;
double r1093242 = r1093238 * r1093241;
double r1093243 = z;
double r1093244 = r1093242 / r1093243;
return r1093244;
}
double f(double x, double y, double z) {
double r1093245 = x;
double r1093246 = -9.303380453396632e-07;
bool r1093247 = r1093245 <= r1093246;
double r1093248 = 7.145191312931393e+69;
bool r1093249 = r1093245 <= r1093248;
double r1093250 = !r1093249;
bool r1093251 = r1093247 || r1093250;
double r1093252 = y;
double r1093253 = sin(r1093252);
double r1093254 = r1093253 / r1093252;
double r1093255 = r1093245 * r1093254;
double r1093256 = z;
double r1093257 = r1093255 / r1093256;
double r1093258 = r1093245 / r1093256;
double r1093259 = r1093252 / r1093253;
double r1093260 = r1093258 / r1093259;
double r1093261 = r1093251 ? r1093257 : r1093260;
return r1093261;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -9.303380453396632e-07 or 7.145191312931393e+69 < x Initial program 0.2
if -9.303380453396632e-07 < x < 7.145191312931393e+69Initial program 4.3
rmApplied associate-/l*0.3
Simplified0.3
rmApplied associate-/r*0.3
Final simplification0.3
herbie shell --seed 2020047
(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))