\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -2.8568993598992816 \cdot 10^{48} \lor \neg \left(z \le 1.34045888132617558 \cdot 10^{-169}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{\sin y}{z}}{y}\\
\end{array}double f(double x, double y, double z) {
double r466030 = x;
double r466031 = y;
double r466032 = sin(r466031);
double r466033 = r466032 / r466031;
double r466034 = r466030 * r466033;
double r466035 = z;
double r466036 = r466034 / r466035;
return r466036;
}
double f(double x, double y, double z) {
double r466037 = z;
double r466038 = -2.8568993598992816e+48;
bool r466039 = r466037 <= r466038;
double r466040 = 1.3404588813261756e-169;
bool r466041 = r466037 <= r466040;
double r466042 = !r466041;
bool r466043 = r466039 || r466042;
double r466044 = x;
double r466045 = r466044 / r466037;
double r466046 = 1.0;
double r466047 = y;
double r466048 = sin(r466047);
double r466049 = r466048 / r466047;
double r466050 = r466046 / r466049;
double r466051 = r466045 / r466050;
double r466052 = r466048 / r466037;
double r466053 = r466052 / r466047;
double r466054 = r466044 * r466053;
double r466055 = r466043 ? r466051 : r466054;
return r466055;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 1.0 |
if z < -2.8568993598992816e+48 or 1.3404588813261756e-169 < z Initial program 0.8
rmApplied associate-/l*4.3
rmApplied div-inv4.3
Applied associate-/r*1.1
if -2.8568993598992816e+48 < z < 1.3404588813261756e-169Initial program 6.0
rmApplied associate-/l*0.4
rmApplied div-inv0.5
Simplified0.7
Final simplification1.0
herbie shell --seed 2020034
(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))