\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le 2.843405087967007653899124626840383149923 \cdot 10^{134}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\end{array}double f(double x, double y, double z) {
double r380291 = x;
double r380292 = y;
double r380293 = sin(r380292);
double r380294 = r380293 / r380292;
double r380295 = r380291 * r380294;
double r380296 = z;
double r380297 = r380295 / r380296;
return r380297;
}
double f(double x, double y, double z) {
double r380298 = x;
double r380299 = 2.8434050879670077e+134;
bool r380300 = r380298 <= r380299;
double r380301 = z;
double r380302 = y;
double r380303 = sin(r380302);
double r380304 = r380302 / r380303;
double r380305 = r380301 * r380304;
double r380306 = r380298 / r380305;
double r380307 = r380298 * r380303;
double r380308 = r380307 / r380302;
double r380309 = r380308 / r380301;
double r380310 = r380300 ? r380306 : r380309;
return r380310;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.6 |
if x < 2.8434050879670077e+134Initial program 3.0
rmApplied associate-/l*1.8
Simplified1.8
if 2.8434050879670077e+134 < x Initial program 0.3
rmApplied pow10.3
Applied pow10.3
Applied pow-prod-down0.3
Simplified0.3
Final simplification1.6
herbie shell --seed 2019323 +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))