\[x \cdot \frac{\sin y}{y}
\]
↓
\[\frac{x}{\frac{y}{\sin y}}
\]
(FPCore (x y) :precision binary64 (* x (/ (sin y) y)))
↓
(FPCore (x y) :precision binary64 (/ x (/ y (sin y))))
double code(double x, double y) {
return x * (sin(y) / y);
}
↓
double code(double x, double y) {
return x / (y / sin(y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (sin(y) / y)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x / (y / sin(y))
end function
public static double code(double x, double y) {
return x * (Math.sin(y) / y);
}
↓
public static double code(double x, double y) {
return x / (y / Math.sin(y));
}
def code(x, y):
return x * (math.sin(y) / y)
↓
def code(x, y):
return x / (y / math.sin(y))
function code(x, y)
return Float64(x * Float64(sin(y) / y))
end
↓
function code(x, y)
return Float64(x / Float64(y / sin(y)))
end
function tmp = code(x, y)
tmp = x * (sin(y) / y);
end
↓
function tmp = code(x, y)
tmp = x / (y / sin(y));
end
code[x_, y_] := N[(x * N[(N[Sin[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(x / N[(y / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \frac{\sin y}{y}
↓
\frac{x}{\frac{y}{\sin y}}
Alternatives
| Alternative 1 |
|---|
| Error | 0.21% |
|---|
| Cost | 6720 |
|---|
\[x \cdot \frac{\sin y}{y}
\]
| Alternative 2 |
|---|
| Error | 35.87% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{6}{y}\\
\mathbf{elif}\;y \leq 52000000:\\
\;\;\;\;x \cdot \left(1 + -0.16666666666666666 \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{y \cdot y}\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 35.87% |
|---|
| Cost | 840 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+16}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{6}{y}\\
\mathbf{elif}\;y \leq 116000000:\\
\;\;\;\;x + -0.16666666666666666 \cdot \left(y \cdot \left(x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{y \cdot y}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 36.13% |
|---|
| Cost | 713 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.4\right):\\
\;\;\;\;6 \cdot \frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 36.13% |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.4:\\
\;\;\;\;\frac{x}{y} \cdot \frac{6}{y}\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \frac{x}{y \cdot y}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 35.85% |
|---|
| Cost | 576 |
|---|
\[\frac{x}{1 + y \cdot \left(y \cdot 0.16666666666666666\right)}
\]
| Alternative 7 |
|---|
| Error | 48.27% |
|---|
| Cost | 64 |
|---|
\[x
\]