\[e^{re} \cdot \sin im
\]
↓
\[e^{re} \cdot \sin im
\]
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
↓
(FPCore (re im) :precision binary64 (* (exp re) (sin im)))
double code(double re, double im) {
return exp(re) * sin(im);
}
↓
double code(double re, double im) {
return exp(re) * sin(im);
}
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
↓
real(8) function code(re, im)
real(8), intent (in) :: re
real(8), intent (in) :: im
code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
↓
public static double code(double re, double im) {
return Math.exp(re) * Math.sin(im);
}
def code(re, im):
return math.exp(re) * math.sin(im)
↓
def code(re, im):
return math.exp(re) * math.sin(im)
function code(re, im)
return Float64(exp(re) * sin(im))
end
↓
function code(re, im)
return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
tmp = exp(re) * sin(im);
end
↓
function tmp = code(re, im)
tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
↓
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
e^{re} \cdot \sin im
↓
e^{re} \cdot \sin im
Alternatives
| Alternative 1 |
|---|
| Error | 0.7 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.99999:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{else}:\\
\;\;\;\;\left(re + 1\right) \cdot \sin im\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.1 |
|---|
| Cost | 13124 |
|---|
\[\begin{array}{l}
\mathbf{if}\;e^{re} \leq 0.99999:\\
\;\;\;\;e^{re} \cdot im\\
\mathbf{else}:\\
\;\;\;\;\sin im\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 9.0 |
|---|
| Cost | 6992 |
|---|
\[\begin{array}{l}
t_0 := im \cdot \left(re + 2\right)\\
t_1 := t_0 + t_0\\
t_2 := \frac{1}{\frac{1}{\left(1 + re\right) \cdot im} + \left(-0.16666666666666666 \cdot \left(re \cdot im\right) + 0.16666666666666666 \cdot im\right)}\\
t_3 := \left(t_1 + \left(t_0 + 2 \cdot im\right)\right) - \left(t_1 + \left(im + t_0\right)\right)\\
\mathbf{if}\;re \leq -1.7 \cdot 10^{+184}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;re \leq -1.18 \cdot 10^{+170}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;re \leq -8.5 \cdot 10^{+162}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;re \leq -1.9 \cdot 10^{+15}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\sin im\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 25.3 |
|---|
| Cost | 2888 |
|---|
\[\begin{array}{l}
t_0 := \frac{1}{\frac{1}{\left(1 + re\right) \cdot im} + \left(-0.16666666666666666 \cdot \left(re \cdot im\right) + 0.16666666666666666 \cdot im\right)}\\
t_1 := im \cdot \left(re + 2\right)\\
t_2 := t_1 + t_1\\
\mathbf{if}\;im \leq -8.5 \cdot 10^{+112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 10^{+88}:\\
\;\;\;\;\left(t_2 + \left(t_1 + 2 \cdot im\right)\right) - \left(t_2 + \left(im + t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 32.3 |
|---|
| Cost | 1480 |
|---|
\[\begin{array}{l}
t_0 := \frac{1}{\frac{1}{\left(1 + re\right) \cdot im} + \left(-0.16666666666666666 \cdot \left(re \cdot im\right) + 0.16666666666666666 \cdot im\right)}\\
\mathbf{if}\;re \leq -9.5 \cdot 10^{+162}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq -1.4:\\
\;\;\;\;re + \left(\left(im + im \cdot re\right) - re\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 31.8 |
|---|
| Cost | 836 |
|---|
\[\begin{array}{l}
\mathbf{if}\;re \leq -1:\\
\;\;\;\;re + \left(\left(im + im \cdot re\right) - re\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{re + 1}{\frac{1}{im} + im \cdot 0.16666666666666666}\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 32.0 |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
\mathbf{if}\;re \leq -1:\\
\;\;\;\;re + \left(\left(im + im \cdot re\right) - re\right)\\
\mathbf{else}:\\
\;\;\;\;re \cdot im + im\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 32.0 |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
\mathbf{if}\;re \leq -220:\\
\;\;\;\;re + \left(\left(im + im \cdot re\right) - re\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{im} + im \cdot 0.16666666666666666}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 36.2 |
|---|
| Cost | 448 |
|---|
\[\frac{1}{\frac{1 - re}{im}}
\]
| Alternative 10 |
|---|
| Error | 41.8 |
|---|
| Cost | 64 |
|---|
\[im
\]