\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -3.709201162717754895449491456213181044763 \cdot 10^{48}:\\
\;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\
\mathbf{elif}\;x \le 1567.526035614710735899279825389385223389:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{y}{\sin y}} \cdot x}{z}\\
\end{array}double f(double x, double y, double z) {
double r19752338 = x;
double r19752339 = y;
double r19752340 = sin(r19752339);
double r19752341 = r19752340 / r19752339;
double r19752342 = r19752338 * r19752341;
double r19752343 = z;
double r19752344 = r19752342 / r19752343;
return r19752344;
}
double f(double x, double y, double z) {
double r19752345 = x;
double r19752346 = -3.709201162717755e+48;
bool r19752347 = r19752345 <= r19752346;
double r19752348 = 1.0;
double r19752349 = y;
double r19752350 = sin(r19752349);
double r19752351 = r19752349 / r19752350;
double r19752352 = r19752348 / r19752351;
double r19752353 = r19752352 * r19752345;
double r19752354 = z;
double r19752355 = r19752353 / r19752354;
double r19752356 = 1567.5260356147107;
bool r19752357 = r19752345 <= r19752356;
double r19752358 = r19752345 / r19752354;
double r19752359 = r19752358 / r19752351;
double r19752360 = r19752357 ? r19752359 : r19752355;
double r19752361 = r19752347 ? r19752355 : r19752360;
return r19752361;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.4 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -3.709201162717755e+48 or 1567.5260356147107 < x Initial program 0.2
rmApplied clear-num0.3
if -3.709201162717755e+48 < x < 1567.5260356147107Initial program 3.9
rmApplied clear-num3.9
rmApplied div-inv4.1
rmApplied un-div-inv4.0
Applied associate-*l/0.3
Simplified0.2
Final simplification0.2
herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))