\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.5463407620259075 \cdot 10^{83} \lor \neg \left(z \le 1.00828897081930849 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{\sqrt{1}}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r515294 = x;
double r515295 = y;
double r515296 = sin(r515295);
double r515297 = r515296 / r515295;
double r515298 = r515294 * r515297;
double r515299 = z;
double r515300 = r515298 / r515299;
return r515300;
}
double f(double x, double y, double z) {
double r515301 = z;
double r515302 = -8.546340762025908e+83;
bool r515303 = r515301 <= r515302;
double r515304 = 1.0082889708193085e-64;
bool r515305 = r515301 <= r515304;
double r515306 = !r515305;
bool r515307 = r515303 || r515306;
double r515308 = x;
double r515309 = r515308 / r515301;
double r515310 = 1.0;
double r515311 = sqrt(r515310);
double r515312 = y;
double r515313 = sin(r515312);
double r515314 = r515313 / r515312;
double r515315 = r515311 / r515314;
double r515316 = r515309 / r515315;
double r515317 = r515301 / r515314;
double r515318 = r515308 / r515317;
double r515319 = r515307 ? r515316 : r515318;
return r515319;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
if z < -8.546340762025908e+83 or 1.0082889708193085e-64 < z Initial program 0.2
rmApplied clear-num0.9
rmApplied div-inv1.0
Applied associate-/r*0.4
rmApplied add-sqr-sqrt0.4
Applied times-frac0.5
Applied associate-/r*0.5
Simplified0.3
if -8.546340762025908e+83 < z < 1.0082889708193085e-64Initial program 5.4
rmApplied clear-num5.6
rmApplied div-inv6.1
Applied associate-/r*6.0
rmApplied *-un-lft-identity6.0
Applied add-sqr-sqrt6.0
Applied times-frac6.0
Applied associate-/l*6.2
Simplified5.6
rmApplied *-un-lft-identity5.6
Applied times-frac1.0
Applied associate-/r*0.6
Simplified0.5
Final simplification0.4
herbie shell --seed 2020025 +o rules:numerics
(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))