\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -685445088654725504 \lor \neg \left(z \le 9.777982240122365731670702998885673597927 \cdot 10^{44}\right):\\
\;\;\;\;\frac{\frac{1}{\frac{z}{x}}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r344817 = x;
double r344818 = y;
double r344819 = sin(r344818);
double r344820 = r344819 / r344818;
double r344821 = r344817 * r344820;
double r344822 = z;
double r344823 = r344821 / r344822;
return r344823;
}
double f(double x, double y, double z) {
double r344824 = z;
double r344825 = -6.854450886547255e+17;
bool r344826 = r344824 <= r344825;
double r344827 = 9.777982240122366e+44;
bool r344828 = r344824 <= r344827;
double r344829 = !r344828;
bool r344830 = r344826 || r344829;
double r344831 = 1.0;
double r344832 = x;
double r344833 = r344824 / r344832;
double r344834 = r344831 / r344833;
double r344835 = y;
double r344836 = sin(r344835);
double r344837 = r344836 / r344835;
double r344838 = r344831 / r344837;
double r344839 = r344834 / r344838;
double r344840 = r344837 / r344824;
double r344841 = r344832 * r344840;
double r344842 = r344830 ? r344839 : r344841;
return r344842;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if z < -6.854450886547255e+17 or 9.777982240122366e+44 < z Initial program 0.1
rmApplied add-cube-cbrt0.9
Applied add-cube-cbrt0.4
Applied times-frac0.4
rmApplied clear-num1.2
Simplified0.9
rmApplied div-inv0.9
Applied associate-/r*0.5
if -6.854450886547255e+17 < z < 9.777982240122366e+44Initial program 4.9
rmApplied *-un-lft-identity4.9
Applied times-frac0.4
Simplified0.4
Final simplification0.5
herbie shell --seed 2019326 +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))