\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5593196487055916383862784:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\mathbf{elif}\;z \le 0.001397275382843652952874480277500879310537:\\
\;\;\;\;\frac{x}{\frac{z}{\frac{\sin y}{y}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{\frac{1}{y}}{\frac{1}{\sin y}}}{z}\\
\end{array}double f(double x, double y, double z) {
double r20406150 = x;
double r20406151 = y;
double r20406152 = sin(r20406151);
double r20406153 = r20406152 / r20406151;
double r20406154 = r20406150 * r20406153;
double r20406155 = z;
double r20406156 = r20406154 / r20406155;
return r20406156;
}
double f(double x, double y, double z) {
double r20406157 = z;
double r20406158 = -5.593196487055916e+24;
bool r20406159 = r20406157 <= r20406158;
double r20406160 = x;
double r20406161 = 1.0;
double r20406162 = y;
double r20406163 = r20406161 / r20406162;
double r20406164 = sin(r20406162);
double r20406165 = r20406161 / r20406164;
double r20406166 = r20406163 / r20406165;
double r20406167 = r20406160 * r20406166;
double r20406168 = r20406167 / r20406157;
double r20406169 = 0.001397275382843653;
bool r20406170 = r20406157 <= r20406169;
double r20406171 = r20406164 / r20406162;
double r20406172 = r20406157 / r20406171;
double r20406173 = r20406160 / r20406172;
double r20406174 = r20406170 ? r20406173 : r20406168;
double r20406175 = r20406159 ? r20406168 : r20406174;
return r20406175;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if z < -5.593196487055916e+24 or 0.001397275382843653 < z Initial program 0.1
rmApplied clear-num0.1
rmApplied div-inv0.2
Applied associate-/r*0.2
if -5.593196487055916e+24 < z < 0.001397275382843653Initial program 5.7
rmApplied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019172
(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))