\[{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;angle \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\]
(FPCore (a b angle)
:precision binary64
(+
(pow (* a (cos (* PI (/ angle 180.0)))) 2.0)
(pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
↓
(FPCore (a b angle)
:precision binary64
(if (<= angle 1.8e-11)
(+
(pow a 2.0)
(pow (* b (expm1 (* PI (* angle 0.005555555555555556)))) 2.0))
(+
(pow a 2.0)
(* (/ b (/ 2.0 b)) (- 1.0 (cos (* angle (* PI 0.011111111111111112))))))))double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
↓
double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.8e-11) {
tmp = pow(a, 2.0) + pow((b * expm1((((double) M_PI) * (angle * 0.005555555555555556)))), 2.0);
} else {
tmp = pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - cos((angle * (((double) M_PI) * 0.011111111111111112)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
↓
public static double code(double a, double b, double angle) {
double tmp;
if (angle <= 1.8e-11) {
tmp = Math.pow(a, 2.0) + Math.pow((b * Math.expm1((Math.PI * (angle * 0.005555555555555556)))), 2.0);
} else {
tmp = Math.pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - Math.cos((angle * (Math.PI * 0.011111111111111112)))));
}
return tmp;
}
def code(a, b, angle):
return math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0)
↓
def code(a, b, angle):
tmp = 0
if angle <= 1.8e-11:
tmp = math.pow(a, 2.0) + math.pow((b * math.expm1((math.pi * (angle * 0.005555555555555556)))), 2.0)
else:
tmp = math.pow(a, 2.0) + ((b / (2.0 / b)) * (1.0 - math.cos((angle * (math.pi * 0.011111111111111112)))))
return tmp
function code(a, b, angle)
return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0))
end
↓
function code(a, b, angle)
tmp = 0.0
if (angle <= 1.8e-11)
tmp = Float64((a ^ 2.0) + (Float64(b * expm1(Float64(pi * Float64(angle * 0.005555555555555556)))) ^ 2.0));
else
tmp = Float64((a ^ 2.0) + Float64(Float64(b / Float64(2.0 / b)) * Float64(1.0 - cos(Float64(angle * Float64(pi * 0.011111111111111112))))));
end
return tmp
end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
↓
code[a_, b_, angle_] := If[LessEqual[angle, 1.8e-11], N[(N[Power[a, 2.0], $MachinePrecision] + N[Power[N[(b * N[(Exp[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[a, 2.0], $MachinePrecision] + N[(N[(b / N[(2.0 / b), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
↓
\begin{array}{l}
\mathbf{if}\;angle \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 20.5 |
|---|
| Cost | 65664 |
|---|
\[{\left(a \cdot \cos \left(\frac{\pi}{\sqrt[3]{\frac{180}{angle}}} \cdot \frac{1}{{\left(\frac{\sqrt[3]{180}}{\frac{1}{\sqrt[3]{\frac{1}{angle}}}}\right)}^{2}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\]
| Alternative 2 |
|---|
| Error | 20.8 |
|---|
| Cost | 33088 |
|---|
\[{a}^{2} + {\left(b \cdot \mathsf{expm1}\left(\pi \cdot \left(angle \cdot 0.005555555555555556 + \pi \cdot \left(\left(angle \cdot angle\right) \cdot -1.54320987654321 \cdot 10^{-5}\right)\right)\right)\right)}^{2}
\]
| Alternative 3 |
|---|
| Error | 20.6 |
|---|
| Cost | 26368 |
|---|
\[{a}^{2} + {\left(b \cdot \sin \left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right)\right)}^{2}
\]
| Alternative 4 |
|---|
| Error | 20.6 |
|---|
| Cost | 26240 |
|---|
\[{a}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)}^{2}
\]
| Alternative 5 |
|---|
| Error | 20.9 |
|---|
| Cost | 20425 |
|---|
\[\begin{array}{l}
\mathbf{if}\;angle \leq -5.4 \cdot 10^{+15} \lor \neg \left(angle \leq 1.8 \cdot 10^{-11}\right):\\
\;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 20.9 |
|---|
| Cost | 20424 |
|---|
\[\begin{array}{l}
\mathbf{if}\;angle \leq -5.4 \cdot 10^{+15}:\\
\;\;\;\;{a}^{2} + \frac{b \cdot b}{\frac{2}{1 - \cos \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)}}\\
\mathbf{elif}\;angle \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + \frac{b}{\frac{2}{b}} \cdot \left(1 - \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 23.9 |
|---|
| Cost | 20360 |
|---|
\[\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{+136}:\\
\;\;\;\;{a}^{2} + {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}\\
\mathbf{elif}\;b \leq 10^{-15}:\\
\;\;\;\;{a}^{2} + \left(angle \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot {\pi}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 26.2 |
|---|
| Cost | 19840 |
|---|
\[{a}^{2} + 3.08641975308642 \cdot 10^{-5} \cdot {\left(angle \cdot \left(\pi \cdot b\right)\right)}^{2}
\]
| Alternative 9 |
|---|
| Error | 26.2 |
|---|
| Cost | 19840 |
|---|
\[{a}^{2} + {\left(b \cdot \left(\pi \cdot angle\right)\right)}^{2} \cdot 3.08641975308642 \cdot 10^{-5}
\]
| Alternative 10 |
|---|
| Error | 26.2 |
|---|
| Cost | 19840 |
|---|
\[{a}^{2} + {\left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot b\right)\right)\right)}^{2}
\]