\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -0.0334556813538067696:\\
\;\;\;\;\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}\\
\mathbf{elif}\;x \le 1.025572474839032 \cdot 10^{-44}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sin y \cdot x}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r548311 = x;
double r548312 = y;
double r548313 = sin(r548312);
double r548314 = r548313 / r548312;
double r548315 = r548311 * r548314;
double r548316 = z;
double r548317 = r548315 / r548316;
return r548317;
}
double f(double x, double y, double z) {
double r548318 = x;
double r548319 = -0.03345568135380677;
bool r548320 = r548318 <= r548319;
double r548321 = y;
double r548322 = sin(r548321);
double r548323 = r548322 / r548321;
double r548324 = r548318 * r548323;
double r548325 = 1.0;
double r548326 = z;
double r548327 = r548325 / r548326;
double r548328 = r548324 * r548327;
double r548329 = 1.0255724748390319e-44;
bool r548330 = r548318 <= r548329;
double r548331 = r548326 / r548318;
double r548332 = r548331 / r548323;
double r548333 = r548325 / r548332;
double r548334 = r548322 * r548318;
double r548335 = r548334 / r548321;
double r548336 = r548335 / r548326;
double r548337 = r548330 ? r548333 : r548336;
double r548338 = r548320 ? r548328 : r548337;
return r548338;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if x < -0.03345568135380677Initial program 0.2
rmApplied div-inv0.4
if -0.03345568135380677 < x < 1.0255724748390319e-44Initial program 5.0
rmApplied div-inv5.0
rmApplied clear-num5.6
Simplified0.9
if 1.0255724748390319e-44 < x Initial program 0.3
rmApplied div-inv0.4
rmApplied un-div-inv0.3
Applied associate-*r/0.6
Simplified0.6
Final simplification0.7
herbie shell --seed 2020049
(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))