\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.210199914794309130085332727707594995869 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{\frac{\sin y}{y}}}{x}}\\
\end{array}double f(double x, double y, double z) {
double r566394 = x;
double r566395 = y;
double r566396 = sin(r566395);
double r566397 = r566396 / r566395;
double r566398 = r566394 * r566397;
double r566399 = z;
double r566400 = r566398 / r566399;
return r566400;
}
double f(double x, double y, double z) {
double r566401 = z;
double r566402 = -8.210199914794309e-88;
bool r566403 = r566401 <= r566402;
double r566404 = x;
double r566405 = r566404 / r566401;
double r566406 = 1.0;
double r566407 = y;
double r566408 = sin(r566407);
double r566409 = r566408 / r566407;
double r566410 = r566406 / r566409;
double r566411 = r566405 / r566410;
double r566412 = r566401 / r566409;
double r566413 = r566412 / r566404;
double r566414 = r566406 / r566413;
double r566415 = r566403 ? r566411 : r566414;
return r566415;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.9 |
if z < -8.210199914794309e-88Initial program 0.4
rmApplied associate-/l*4.0
rmApplied div-inv4.0
Applied associate-/r*0.4
if -8.210199914794309e-88 < z Initial program 3.9
rmApplied associate-/l*2.2
rmApplied clear-num2.7
Final simplification1.9
herbie shell --seed 2019356 +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))