x \cdot \frac{\sin y}{y}\begin{array}{l}
\mathbf{if}\;y \leq -0.00038475853256956117 \lor \neg \left(y \leq 0.00022643016838745178\right):\\
\;\;\;\;\sin y \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x - 0.16666666666666666 \cdot \left(x \cdot \left(y \cdot y\right)\right)\\
\end{array}(FPCore (x y) :precision binary64 (* x (/ (sin y) y)))
(FPCore (x y) :precision binary64 (if (or (<= y -0.00038475853256956117) (not (<= y 0.00022643016838745178))) (* (sin y) (/ x y)) (- x (* 0.16666666666666666 (* x (* y y))))))
double code(double x, double y) {
return x * (sin(y) / y);
}
double code(double x, double y) {
double tmp;
if ((y <= -0.00038475853256956117) || !(y <= 0.00022643016838745178)) {
tmp = sin(y) * (x / y);
} else {
tmp = x - (0.16666666666666666 * (x * (y * y)));
}
return tmp;
}








Bits error versus x








Bits error versus y
Results
| Alternative 1 | |
|---|---|
| Error | 0.2 |
| Cost | 6720 |
| Alternative 2 | |
|---|---|
| Error | 23.2 |
| Cost | 576 |
| Alternative 3 | |
|---|---|
| Error | 23.5 |
| Cost | 706 |
| Alternative 4 | |
|---|---|
| Error | 54.1 |
| Cost | 64 |
| Alternative 5 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |

if y < -3.8475853256956117e-4 or 2.2643016838745178e-4 < y Initial program 0.3
rmApplied clear-num_binary64_31460.4
rmApplied associate-/r/_binary64_30930.3
Applied associate-*r*_binary64_30870.3
Simplified0.3
Simplified0.3
if -3.8475853256956117e-4 < y < 2.2643016838745178e-4Initial program 0.0
Taylor expanded around 0 0.0
Simplified0.0
Simplified0.0
Final simplification0.1
herbie shell --seed 2021044
(FPCore (x y)
:name "Linear.Quaternion:$cexp from linear-1.19.1.3"
:precision binary64
(* x (/ (sin y) y)))