\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.629406164941695116737539545868878186622 \cdot 10^{-19}:\\
\;\;\;\;\frac{\left(\frac{1}{y} \cdot \sin y\right) \cdot x}{z}\\
\mathbf{elif}\;z \le 67082210.6168034374713897705078125:\\
\;\;\;\;\frac{\frac{\sin y}{y}}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r20433479 = x;
double r20433480 = y;
double r20433481 = sin(r20433480);
double r20433482 = r20433481 / r20433480;
double r20433483 = r20433479 * r20433482;
double r20433484 = z;
double r20433485 = r20433483 / r20433484;
return r20433485;
}
double f(double x, double y, double z) {
double r20433486 = z;
double r20433487 = -3.629406164941695e-19;
bool r20433488 = r20433486 <= r20433487;
double r20433489 = 1.0;
double r20433490 = y;
double r20433491 = r20433489 / r20433490;
double r20433492 = sin(r20433490);
double r20433493 = r20433491 * r20433492;
double r20433494 = x;
double r20433495 = r20433493 * r20433494;
double r20433496 = r20433495 / r20433486;
double r20433497 = 67082210.61680344;
bool r20433498 = r20433486 <= r20433497;
double r20433499 = r20433492 / r20433490;
double r20433500 = r20433499 / r20433486;
double r20433501 = r20433500 * r20433494;
double r20433502 = r20433490 / r20433492;
double r20433503 = r20433494 / r20433502;
double r20433504 = r20433503 / r20433486;
double r20433505 = r20433498 ? r20433501 : r20433504;
double r20433506 = r20433488 ? r20433496 : r20433505;
return r20433506;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -3.629406164941695e-19Initial program 0.1
rmApplied div-inv0.2
if -3.629406164941695e-19 < z < 67082210.61680344Initial program 5.6
rmApplied *-un-lft-identity5.6
Applied times-frac0.3
Simplified0.3
if 67082210.61680344 < z Initial program 0.1
rmApplied add-cube-cbrt0.8
Applied times-frac1.6
rmApplied *-un-lft-identity1.6
Applied associate-*l*1.6
Simplified0.1
Final simplification0.2
herbie shell --seed 2019169 +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))