\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 24.59938632289427218324817658867686986923:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r326331 = x;
double r326332 = y;
double r326333 = sin(r326332);
double r326334 = r326333 / r326332;
double r326335 = r326331 * r326334;
double r326336 = z;
double r326337 = r326335 / r326336;
return r326337;
}
double f(double x, double y, double z) {
double r326338 = x;
double r326339 = 24.599386322894272;
bool r326340 = r326338 <= r326339;
double r326341 = z;
double r326342 = y;
double r326343 = sin(r326342);
double r326344 = r326343 / r326342;
double r326345 = r326341 / r326344;
double r326346 = r326338 / r326345;
double r326347 = r326338 * r326343;
double r326348 = r326347 / r326342;
double r326349 = r326348 / r326341;
double r326350 = r326340 ? r326346 : r326349;
return r326350;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.3 |
if x < 24.599386322894272Initial program 3.4
rmApplied clear-num3.9
rmApplied *-un-lft-identity3.9
Applied times-frac2.3
Applied associate-/r*1.7
Simplified1.6
if 24.599386322894272 < x Initial program 0.2
rmApplied pow10.2
Applied pow10.2
Applied pow-prod-down0.2
Simplified0.2
Final simplification1.3
herbie shell --seed 2019323
(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))