\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.5463407620259075 \cdot 10^{83} \lor \neg \left(z \le 1.00828897081930849 \cdot 10^{-64}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{\sqrt{1}}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r510067 = x;
double r510068 = y;
double r510069 = sin(r510068);
double r510070 = r510069 / r510068;
double r510071 = r510067 * r510070;
double r510072 = z;
double r510073 = r510071 / r510072;
return r510073;
}
double f(double x, double y, double z) {
double r510074 = z;
double r510075 = -8.546340762025908e+83;
bool r510076 = r510074 <= r510075;
double r510077 = 1.0082889708193085e-64;
bool r510078 = r510074 <= r510077;
double r510079 = !r510078;
bool r510080 = r510076 || r510079;
double r510081 = x;
double r510082 = r510081 / r510074;
double r510083 = 1.0;
double r510084 = sqrt(r510083);
double r510085 = y;
double r510086 = sin(r510085);
double r510087 = r510086 / r510085;
double r510088 = r510084 / r510087;
double r510089 = r510082 / r510088;
double r510090 = r510074 / r510087;
double r510091 = r510081 / r510090;
double r510092 = r510080 ? r510089 : r510091;
return r510092;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
if z < -8.546340762025908e+83 or 1.0082889708193085e-64 < z Initial program 0.2
rmApplied clear-num0.9
rmApplied div-inv1.0
Applied associate-/r*0.4
rmApplied add-sqr-sqrt0.4
Applied times-frac0.5
Applied associate-/r*0.5
Simplified0.3
if -8.546340762025908e+83 < z < 1.0082889708193085e-64Initial program 5.4
rmApplied clear-num5.6
rmApplied div-inv6.1
Applied associate-/r*6.0
rmApplied *-un-lft-identity6.0
Applied add-sqr-sqrt6.0
Applied times-frac6.0
Applied associate-/l*6.2
Simplified5.6
rmApplied *-un-lft-identity5.6
Applied times-frac1.0
Applied associate-/r*0.6
Simplified0.5
Final simplification0.4
herbie shell --seed 2020025
(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))