\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1396587271183383937052376781815808:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\sin y}{y}\right)\\
\mathbf{elif}\;z \le 1119859951.5625312328338623046875:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \frac{\sin y}{y}\right)\\
\end{array}double f(double x, double y, double z) {
double r36330285 = x;
double r36330286 = y;
double r36330287 = sin(r36330286);
double r36330288 = r36330287 / r36330286;
double r36330289 = r36330285 * r36330288;
double r36330290 = z;
double r36330291 = r36330289 / r36330290;
return r36330291;
}
double f(double x, double y, double z) {
double r36330292 = z;
double r36330293 = -1.396587271183384e+33;
bool r36330294 = r36330292 <= r36330293;
double r36330295 = 1.0;
double r36330296 = r36330295 / r36330292;
double r36330297 = x;
double r36330298 = y;
double r36330299 = sin(r36330298);
double r36330300 = r36330299 / r36330298;
double r36330301 = r36330297 * r36330300;
double r36330302 = r36330296 * r36330301;
double r36330303 = 1119859951.5625312;
bool r36330304 = r36330292 <= r36330303;
double r36330305 = r36330292 / r36330300;
double r36330306 = r36330297 / r36330305;
double r36330307 = r36330304 ? r36330306 : r36330302;
double r36330308 = r36330294 ? r36330302 : r36330307;
return r36330308;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -1.396587271183384e+33 or 1119859951.5625312 < z Initial program 0.1
rmApplied div-inv0.2
if -1.396587271183384e+33 < z < 1119859951.5625312Initial program 5.1
rmApplied div-inv5.3
rmApplied associate-*r/5.1
Simplified5.2
rmApplied div-inv5.2
Applied associate-/l*0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2019171
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
: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))