\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \cdot \frac{\sin y}{y} \le -4.138919433006754025982245522415293926484 \cdot 10^{-256} \lor \neg \left(x \cdot \frac{\sin y}{y} \le 2.400486339854651017904177681522389558513 \cdot 10^{-313}\right):\\
\;\;\;\;\left(x \cdot \frac{\sin y}{y}\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z} \cdot \sin y}{y}\\
\end{array}double f(double x, double y, double z) {
double r337161 = x;
double r337162 = y;
double r337163 = sin(r337162);
double r337164 = r337163 / r337162;
double r337165 = r337161 * r337164;
double r337166 = z;
double r337167 = r337165 / r337166;
return r337167;
}
double f(double x, double y, double z) {
double r337168 = x;
double r337169 = y;
double r337170 = sin(r337169);
double r337171 = r337170 / r337169;
double r337172 = r337168 * r337171;
double r337173 = -4.138919433006754e-256;
bool r337174 = r337172 <= r337173;
double r337175 = 2.4004863398547e-313;
bool r337176 = r337172 <= r337175;
double r337177 = !r337176;
bool r337178 = r337174 || r337177;
double r337179 = 1.0;
double r337180 = z;
double r337181 = r337179 / r337180;
double r337182 = r337172 * r337181;
double r337183 = r337168 / r337180;
double r337184 = r337183 * r337170;
double r337185 = r337184 / r337169;
double r337186 = r337178 ? r337182 : r337185;
return r337186;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.7 |
if (* x (/ (sin y) y)) < -4.138919433006754e-256 or 2.4004863398547e-313 < (* x (/ (sin y) y)) Initial program 0.2
rmApplied div-inv0.4
if -4.138919433006754e-256 < (* x (/ (sin y) y)) < 2.4004863398547e-313Initial program 13.6
rmApplied div-inv13.6
rmApplied associate-*r/17.8
Applied associate-*l/4.4
Simplified2.0
Final simplification0.7
herbie shell --seed 2019306
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.21737202034271466e-29) (/ (* x (/ 1 (/ y (sin y)))) z) (if (< z 4.44670236911381103e64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))