\frac{x \cdot \frac{\sin y}{y}}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.3530667918855812 \cdot 10^{-68} \lor \neg \left(x \le 1.46451474323560222 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{y}{\sin y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{z}{x}}{\frac{\sin y}{y}}}\\
\end{array}double f(double x, double y, double z) {
double r451331 = x;
double r451332 = y;
double r451333 = sin(r451332);
double r451334 = r451333 / r451332;
double r451335 = r451331 * r451334;
double r451336 = z;
double r451337 = r451335 / r451336;
return r451337;
}
double f(double x, double y, double z) {
double r451338 = x;
double r451339 = -1.3530667918855812e-68;
bool r451340 = r451338 <= r451339;
double r451341 = 1.4645147432356022e-46;
bool r451342 = r451338 <= r451341;
double r451343 = !r451342;
bool r451344 = r451340 || r451343;
double r451345 = y;
double r451346 = sin(r451345);
double r451347 = r451345 / r451346;
double r451348 = r451338 / r451347;
double r451349 = z;
double r451350 = r451348 / r451349;
double r451351 = 1.0;
double r451352 = r451349 / r451338;
double r451353 = r451346 / r451345;
double r451354 = r451352 / r451353;
double r451355 = r451351 / r451354;
double r451356 = r451344 ? r451350 : r451355;
return r451356;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if x < -1.3530667918855812e-68 or 1.4645147432356022e-46 < x Initial program 0.4
rmApplied clear-num0.4
rmApplied *-un-lft-identity0.4
Applied associate-/r*0.4
Simplified0.4
if -1.3530667918855812e-68 < x < 1.4645147432356022e-46Initial program 5.7
rmApplied clear-num5.7
rmApplied clear-num6.3
Simplified0.8
Final simplification0.6
herbie shell --seed 2020033 +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))