\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 r594370 = x;
double r594371 = y;
double r594372 = sin(r594371);
double r594373 = r594372 / r594371;
double r594374 = r594370 * r594373;
double r594375 = z;
double r594376 = r594374 / r594375;
return r594376;
}
double f(double x, double y, double z) {
double r594377 = x;
double r594378 = -9.303380453396632e-07;
bool r594379 = r594377 <= r594378;
double r594380 = 7.145191312931393e+69;
bool r594381 = r594377 <= r594380;
double r594382 = !r594381;
bool r594383 = r594379 || r594382;
double r594384 = y;
double r594385 = sin(r594384);
double r594386 = r594385 / r594384;
double r594387 = r594377 * r594386;
double r594388 = z;
double r594389 = r594387 / r594388;
double r594390 = r594377 / r594388;
double r594391 = r594384 / r594385;
double r594392 = r594390 / r594391;
double r594393 = r594383 ? r594389 : r594392;
return r594393;
}




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 +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))