\[\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\cos \phi_1 \cdot \sin \phi_2 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)}
\]
↓
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_2 := t_0 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(-\lambda_2\right)\\
\mathbf{if}\;\lambda_2 \leq -255000000:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_2}\\
\mathbf{elif}\;\lambda_2 \leq 0.0074:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_0 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \lambda_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_2}\\
\end{array}
\]
(FPCore (lambda1 lambda2 phi1 phi2)
:precision binary64
(atan2
(* (sin (- lambda1 lambda2)) (cos phi2))
(-
(* (cos phi1) (sin phi2))
(* (* (sin phi1) (cos phi2)) (cos (- lambda1 lambda2))))))
↓
(FPCore (lambda1 lambda2 phi1 phi2)
:precision binary64
(let* ((t_0 (* (cos phi1) (sin phi2)))
(t_1 (* (sin (- lambda1 lambda2)) (cos phi2)))
(t_2 (- t_0 (* (* (sin phi1) (cos phi2)) (cos (- lambda2))))))
(if (<= lambda2 -255000000.0)
(atan2 t_1 t_2)
(if (<= lambda2 0.0074)
(atan2 t_1 (- t_0 (* (sin phi1) (* (cos phi2) (cos lambda1)))))
(atan2 (* (sin (- lambda2)) (cos phi2)) t_2)))))double code(double lambda1, double lambda2, double phi1, double phi2) {
return atan2((sin((lambda1 - lambda2)) * cos(phi2)), ((cos(phi1) * sin(phi2)) - ((sin(phi1) * cos(phi2)) * cos((lambda1 - lambda2)))));
}
↓
double code(double lambda1, double lambda2, double phi1, double phi2) {
double t_0 = cos(phi1) * sin(phi2);
double t_1 = sin((lambda1 - lambda2)) * cos(phi2);
double t_2 = t_0 - ((sin(phi1) * cos(phi2)) * cos(-lambda2));
double tmp;
if (lambda2 <= -255000000.0) {
tmp = atan2(t_1, t_2);
} else if (lambda2 <= 0.0074) {
tmp = atan2(t_1, (t_0 - (sin(phi1) * (cos(phi2) * cos(lambda1)))));
} else {
tmp = atan2((sin(-lambda2) * cos(phi2)), t_2);
}
return tmp;
}
real(8) function code(lambda1, lambda2, phi1, phi2)
real(8), intent (in) :: lambda1
real(8), intent (in) :: lambda2
real(8), intent (in) :: phi1
real(8), intent (in) :: phi2
code = atan2((sin((lambda1 - lambda2)) * cos(phi2)), ((cos(phi1) * sin(phi2)) - ((sin(phi1) * cos(phi2)) * cos((lambda1 - lambda2)))))
end function
↓
real(8) function code(lambda1, lambda2, phi1, phi2)
real(8), intent (in) :: lambda1
real(8), intent (in) :: lambda2
real(8), intent (in) :: phi1
real(8), intent (in) :: phi2
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = cos(phi1) * sin(phi2)
t_1 = sin((lambda1 - lambda2)) * cos(phi2)
t_2 = t_0 - ((sin(phi1) * cos(phi2)) * cos(-lambda2))
if (lambda2 <= (-255000000.0d0)) then
tmp = atan2(t_1, t_2)
else if (lambda2 <= 0.0074d0) then
tmp = atan2(t_1, (t_0 - (sin(phi1) * (cos(phi2) * cos(lambda1)))))
else
tmp = atan2((sin(-lambda2) * cos(phi2)), t_2)
end if
code = tmp
end function
public static double code(double lambda1, double lambda2, double phi1, double phi2) {
return Math.atan2((Math.sin((lambda1 - lambda2)) * Math.cos(phi2)), ((Math.cos(phi1) * Math.sin(phi2)) - ((Math.sin(phi1) * Math.cos(phi2)) * Math.cos((lambda1 - lambda2)))));
}
↓
public static double code(double lambda1, double lambda2, double phi1, double phi2) {
double t_0 = Math.cos(phi1) * Math.sin(phi2);
double t_1 = Math.sin((lambda1 - lambda2)) * Math.cos(phi2);
double t_2 = t_0 - ((Math.sin(phi1) * Math.cos(phi2)) * Math.cos(-lambda2));
double tmp;
if (lambda2 <= -255000000.0) {
tmp = Math.atan2(t_1, t_2);
} else if (lambda2 <= 0.0074) {
tmp = Math.atan2(t_1, (t_0 - (Math.sin(phi1) * (Math.cos(phi2) * Math.cos(lambda1)))));
} else {
tmp = Math.atan2((Math.sin(-lambda2) * Math.cos(phi2)), t_2);
}
return tmp;
}
def code(lambda1, lambda2, phi1, phi2):
return math.atan2((math.sin((lambda1 - lambda2)) * math.cos(phi2)), ((math.cos(phi1) * math.sin(phi2)) - ((math.sin(phi1) * math.cos(phi2)) * math.cos((lambda1 - lambda2)))))
↓
def code(lambda1, lambda2, phi1, phi2):
t_0 = math.cos(phi1) * math.sin(phi2)
t_1 = math.sin((lambda1 - lambda2)) * math.cos(phi2)
t_2 = t_0 - ((math.sin(phi1) * math.cos(phi2)) * math.cos(-lambda2))
tmp = 0
if lambda2 <= -255000000.0:
tmp = math.atan2(t_1, t_2)
elif lambda2 <= 0.0074:
tmp = math.atan2(t_1, (t_0 - (math.sin(phi1) * (math.cos(phi2) * math.cos(lambda1)))))
else:
tmp = math.atan2((math.sin(-lambda2) * math.cos(phi2)), t_2)
return tmp
function code(lambda1, lambda2, phi1, phi2)
return atan(Float64(sin(Float64(lambda1 - lambda2)) * cos(phi2)), Float64(Float64(cos(phi1) * sin(phi2)) - Float64(Float64(sin(phi1) * cos(phi2)) * cos(Float64(lambda1 - lambda2)))))
end
↓
function code(lambda1, lambda2, phi1, phi2)
t_0 = Float64(cos(phi1) * sin(phi2))
t_1 = Float64(sin(Float64(lambda1 - lambda2)) * cos(phi2))
t_2 = Float64(t_0 - Float64(Float64(sin(phi1) * cos(phi2)) * cos(Float64(-lambda2))))
tmp = 0.0
if (lambda2 <= -255000000.0)
tmp = atan(t_1, t_2);
elseif (lambda2 <= 0.0074)
tmp = atan(t_1, Float64(t_0 - Float64(sin(phi1) * Float64(cos(phi2) * cos(lambda1)))));
else
tmp = atan(Float64(sin(Float64(-lambda2)) * cos(phi2)), t_2);
end
return tmp
end
function tmp = code(lambda1, lambda2, phi1, phi2)
tmp = atan2((sin((lambda1 - lambda2)) * cos(phi2)), ((cos(phi1) * sin(phi2)) - ((sin(phi1) * cos(phi2)) * cos((lambda1 - lambda2)))));
end
↓
function tmp_2 = code(lambda1, lambda2, phi1, phi2)
t_0 = cos(phi1) * sin(phi2);
t_1 = sin((lambda1 - lambda2)) * cos(phi2);
t_2 = t_0 - ((sin(phi1) * cos(phi2)) * cos(-lambda2));
tmp = 0.0;
if (lambda2 <= -255000000.0)
tmp = atan2(t_1, t_2);
elseif (lambda2 <= 0.0074)
tmp = atan2(t_1, (t_0 - (sin(phi1) * (cos(phi2) * cos(lambda1)))));
else
tmp = atan2((sin(-lambda2) * cos(phi2)), t_2);
end
tmp_2 = tmp;
end
code[lambda1_, lambda2_, phi1_, phi2_] := N[ArcTan[N[(N[Sin[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[phi1], $MachinePrecision] * N[Sin[phi2], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sin[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
↓
code[lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Cos[phi1], $MachinePrecision] * N[Sin[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[(N[(N[Sin[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[(-lambda2)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[lambda2, -255000000.0], N[ArcTan[t$95$1 / t$95$2], $MachinePrecision], If[LessEqual[lambda2, 0.0074], N[ArcTan[t$95$1 / N[(t$95$0 - N[(N[Sin[phi1], $MachinePrecision] * N[(N[Cos[phi2], $MachinePrecision] * N[Cos[lambda1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcTan[N[(N[Sin[(-lambda2)], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] / t$95$2], $MachinePrecision]]]]]]
\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\cos \phi_1 \cdot \sin \phi_2 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)}
↓
\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_2 := t_0 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(-\lambda_2\right)\\
\mathbf{if}\;\lambda_2 \leq -255000000:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_2}\\
\mathbf{elif}\;\lambda_2 \leq 0.0074:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_0 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \lambda_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_2}\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 19.2 |
|---|
| Cost | 52492 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_0 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(-\lambda_2\right)}\\
\mathbf{if}\;\lambda_2 \leq -3.7 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\lambda_2 \leq 1.05 \cdot 10^{-242}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \lambda_1 \cdot \cos \phi_2}{t_0 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \lambda_1\right)}\\
\mathbf{elif}\;\lambda_2 \leq 0.35:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{t_0 - \cos \phi_2 \cdot \sin \phi_1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 14.3 |
|---|
| Cost | 52360 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_0 - \left(\sin \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(-\lambda_2\right)}\\
\mathbf{if}\;\lambda_2 \leq -1.5 \cdot 10^{+54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\lambda_2 \leq 0.009:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{t_0 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \lambda_1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 21.2 |
|---|
| Cost | 52232 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_2 := t_0 - \cos \left(\lambda_1 - \lambda_2\right) \cdot \sin \phi_1\\
\mathbf{if}\;\lambda_2 \leq -1.9 \cdot 10^{-171}:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_2}\\
\mathbf{elif}\;\lambda_2 \leq 1.05 \cdot 10^{-242}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \lambda_1 \cdot \cos \phi_2}{t_0 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \lambda_1\right)}\\
\mathbf{elif}\;\lambda_2 \leq 0.09:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_0 - \cos \phi_2 \cdot \sin \phi_1}\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_2}\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 13.8 |
|---|
| Cost | 52224 |
|---|
\[\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\cos \phi_1 \cdot \sin \phi_2 - \sin \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}
\]
| Alternative 5 |
|---|
| Error | 23.0 |
|---|
| Cost | 46028 |
|---|
\[\begin{array}{l}
t_0 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_1 := \cos \phi_1 \cdot \sin \phi_2\\
t_2 := \tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{t_1 - \cos \left(\lambda_1 - \lambda_2\right) \cdot \sin \phi_1}\\
\mathbf{if}\;\lambda_2 \leq -7.2 \cdot 10^{+67}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\lambda_2 \leq -4.7 \cdot 10^{-284}:\\
\;\;\;\;\tan^{-1}_* \frac{t_0}{t_1 - \sin \phi_1 \cdot \cos \lambda_1}\\
\mathbf{elif}\;\lambda_2 \leq 0.058:\\
\;\;\;\;\tan^{-1}_* \frac{t_0}{t_1 - \cos \phi_2 \cdot \sin \phi_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 20.1 |
|---|
| Cost | 45960 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_2 := \tan^{-1}_* \frac{t_1}{t_0 - \cos \phi_2 \cdot \sin \phi_1}\\
\mathbf{if}\;\phi_2 \leq -3200:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\phi_2 \leq 1.08 \cdot 10^{+33}:\\
\;\;\;\;\tan^{-1}_* \frac{t_1}{t_0 - \cos \left(\lambda_1 - \lambda_2\right) \cdot \sin \phi_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 23.7 |
|---|
| Cost | 45832 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \sin \phi_2\\
t_1 := \tan^{-1}_* \frac{\sin \lambda_1 \cdot \cos \phi_2}{t_0 - \cos \left(\lambda_1 - \lambda_2\right) \cdot \sin \phi_1}\\
\mathbf{if}\;\lambda_1 \leq -3.6 \cdot 10^{+47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\lambda_1 \leq 1.12 \cdot 10^{+133}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{t_0 - \cos \phi_2 \cdot \sin \phi_1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 26.1 |
|---|
| Cost | 39560 |
|---|
\[\begin{array}{l}
t_0 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_1 := \tan^{-1}_* \frac{t_0}{\sin \phi_1 \cdot \left(-\cos \lambda_1\right)}\\
\mathbf{if}\;\phi_1 \leq -0.00185:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq 1000000000000:\\
\;\;\;\;\tan^{-1}_* \frac{t_0}{\cos \phi_1 \cdot \sin \phi_2 - \cos \left(\lambda_1 - \lambda_2\right) \cdot \phi_1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 26.1 |
|---|
| Cost | 39432 |
|---|
\[\begin{array}{l}
t_0 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_1 := \tan^{-1}_* \frac{t_0}{\sin \phi_1 \cdot \left(-\cos \lambda_1\right)}\\
\mathbf{if}\;\phi_1 \leq -0.00028:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq 185000000:\\
\;\;\;\;\tan^{-1}_* \frac{t_0}{\cos \phi_1 \cdot \sin \phi_2 - \phi_1 \cdot \cos \lambda_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 27.0 |
|---|
| Cost | 32840 |
|---|
\[\begin{array}{l}
t_0 := \sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2\\
t_1 := \tan^{-1}_* \frac{t_0}{\sin \phi_1 \cdot \left(-\cos \lambda_1\right)}\\
\mathbf{if}\;\phi_1 \leq -0.00013:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq 2700:\\
\;\;\;\;\tan^{-1}_* \frac{t_0}{\sin \phi_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 36.1 |
|---|
| Cost | 26184 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{\sin \left(-\lambda_2\right) \cdot \cos \phi_2}{\sin \phi_2}\\
\mathbf{if}\;\lambda_2 \leq -38000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\lambda_2 \leq 0.155:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \lambda_1 \cdot \cos \phi_2}{\sin \phi_2}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 39.3 |
|---|
| Cost | 26120 |
|---|
\[\begin{array}{l}
t_0 := \tan^{-1}_* \frac{\sin \lambda_1 \cdot \cos \phi_2}{\sin \phi_2}\\
\mathbf{if}\;\phi_2 \leq -8 \cdot 10^{+148}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 4.1 \cdot 10^{-12}:\\
\;\;\;\;\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\phi_2}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 33.3 |
|---|
| Cost | 25984 |
|---|
\[\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\sin \phi_2}
\]
| Alternative 14 |
|---|
| Error | 43.6 |
|---|
| Cost | 19584 |
|---|
\[\tan^{-1}_* \frac{\sin \left(\lambda_1 - \lambda_2\right) \cdot \cos \phi_2}{\phi_2}
\]