\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -6.724218585312992324531933263642713427544 \lor \neg \left(x \le 276756884396063653888\right):\\
\;\;\;\;\frac{\frac{x \cdot \sin y}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y}{\sin y}}\\
\end{array}double f(double x, double y, double z) {
double r411236 = x;
double r411237 = y;
double r411238 = sin(r411237);
double r411239 = r411238 / r411237;
double r411240 = r411236 * r411239;
double r411241 = z;
double r411242 = r411240 / r411241;
return r411242;
}
double f(double x, double y, double z) {
double r411243 = x;
double r411244 = -6.724218585312992;
bool r411245 = r411243 <= r411244;
double r411246 = 2.7675688439606365e+20;
bool r411247 = r411243 <= r411246;
double r411248 = !r411247;
bool r411249 = r411245 || r411248;
double r411250 = y;
double r411251 = sin(r411250);
double r411252 = r411243 * r411251;
double r411253 = r411252 / r411250;
double r411254 = z;
double r411255 = r411253 / r411254;
double r411256 = r411250 / r411251;
double r411257 = r411254 * r411256;
double r411258 = r411243 / r411257;
double r411259 = r411249 ? r411255 : r411258;
return r411259;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
if x < -6.724218585312992 or 2.7675688439606365e+20 < x Initial program 0.2
rmApplied pow10.2
Applied pow10.2
Applied pow-prod-down0.2
Simplified0.3
if -6.724218585312992 < x < 2.7675688439606365e+20Initial program 4.4
rmApplied associate-/l*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019306 +o rules:numerics
(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))