\[ \begin{array}{c}[lambda1, lambda2] = \mathsf{sort}([lambda1, lambda2])\\ \end{array} \]
\[\cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \cdot R
\]
↓
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\cos^{-1} \left(t_0 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\lambda_2 \cdot R - \lambda_1 \cdot R\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\right)\\
\end{array}
\]
(FPCore (R lambda1 lambda2 phi1 phi2)
:precision binary64
(*
(acos
(+
(* (sin phi1) (sin phi2))
(* (* (cos phi1) (cos phi2)) (cos (- lambda1 lambda2)))))
R))↓
(FPCore (R lambda1 lambda2 phi1 phi2)
:precision binary64
(let* ((t_0 (* (sin phi1) (sin phi2))))
(if (<=
(acos (+ t_0 (* (* (cos phi1) (cos phi2)) (cos (- lambda1 lambda2)))))
2e-6)
(- (* lambda2 R) (* lambda1 R))
(*
R
(acos
(+
t_0
(*
(cos phi2)
(*
(cos phi1)
(+
(* (sin lambda2) (sin lambda1))
(* (cos lambda2) (cos lambda1)))))))))))double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
return acos(((sin(phi1) * sin(phi2)) + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) * R;
}
↓
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
double t_0 = sin(phi1) * sin(phi2);
double tmp;
if (acos((t_0 + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) <= 2e-6) {
tmp = (lambda2 * R) - (lambda1 * R);
} else {
tmp = R * acos((t_0 + (cos(phi2) * (cos(phi1) * ((sin(lambda2) * sin(lambda1)) + (cos(lambda2) * cos(lambda1)))))));
}
return tmp;
}
real(8) function code(r, lambda1, lambda2, phi1, phi2)
real(8), intent (in) :: r
real(8), intent (in) :: lambda1
real(8), intent (in) :: lambda2
real(8), intent (in) :: phi1
real(8), intent (in) :: phi2
code = acos(((sin(phi1) * sin(phi2)) + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) * r
end function
↓
real(8) function code(r, lambda1, lambda2, phi1, phi2)
real(8), intent (in) :: r
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) :: tmp
t_0 = sin(phi1) * sin(phi2)
if (acos((t_0 + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) <= 2d-6) then
tmp = (lambda2 * r) - (lambda1 * r)
else
tmp = r * acos((t_0 + (cos(phi2) * (cos(phi1) * ((sin(lambda2) * sin(lambda1)) + (cos(lambda2) * cos(lambda1)))))))
end if
code = tmp
end function
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
return Math.acos(((Math.sin(phi1) * Math.sin(phi2)) + ((Math.cos(phi1) * Math.cos(phi2)) * Math.cos((lambda1 - lambda2))))) * R;
}
↓
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
double t_0 = Math.sin(phi1) * Math.sin(phi2);
double tmp;
if (Math.acos((t_0 + ((Math.cos(phi1) * Math.cos(phi2)) * Math.cos((lambda1 - lambda2))))) <= 2e-6) {
tmp = (lambda2 * R) - (lambda1 * R);
} else {
tmp = R * Math.acos((t_0 + (Math.cos(phi2) * (Math.cos(phi1) * ((Math.sin(lambda2) * Math.sin(lambda1)) + (Math.cos(lambda2) * Math.cos(lambda1)))))));
}
return tmp;
}
def code(R, lambda1, lambda2, phi1, phi2):
return math.acos(((math.sin(phi1) * math.sin(phi2)) + ((math.cos(phi1) * math.cos(phi2)) * math.cos((lambda1 - lambda2))))) * R
↓
def code(R, lambda1, lambda2, phi1, phi2):
t_0 = math.sin(phi1) * math.sin(phi2)
tmp = 0
if math.acos((t_0 + ((math.cos(phi1) * math.cos(phi2)) * math.cos((lambda1 - lambda2))))) <= 2e-6:
tmp = (lambda2 * R) - (lambda1 * R)
else:
tmp = R * math.acos((t_0 + (math.cos(phi2) * (math.cos(phi1) * ((math.sin(lambda2) * math.sin(lambda1)) + (math.cos(lambda2) * math.cos(lambda1)))))))
return tmp
function code(R, lambda1, lambda2, phi1, phi2)
return Float64(acos(Float64(Float64(sin(phi1) * sin(phi2)) + Float64(Float64(cos(phi1) * cos(phi2)) * cos(Float64(lambda1 - lambda2))))) * R)
end
↓
function code(R, lambda1, lambda2, phi1, phi2)
t_0 = Float64(sin(phi1) * sin(phi2))
tmp = 0.0
if (acos(Float64(t_0 + Float64(Float64(cos(phi1) * cos(phi2)) * cos(Float64(lambda1 - lambda2))))) <= 2e-6)
tmp = Float64(Float64(lambda2 * R) - Float64(lambda1 * R));
else
tmp = Float64(R * acos(Float64(t_0 + Float64(cos(phi2) * Float64(cos(phi1) * Float64(Float64(sin(lambda2) * sin(lambda1)) + Float64(cos(lambda2) * cos(lambda1))))))));
end
return tmp
end
function tmp = code(R, lambda1, lambda2, phi1, phi2)
tmp = acos(((sin(phi1) * sin(phi2)) + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) * R;
end
↓
function tmp_2 = code(R, lambda1, lambda2, phi1, phi2)
t_0 = sin(phi1) * sin(phi2);
tmp = 0.0;
if (acos((t_0 + ((cos(phi1) * cos(phi2)) * cos((lambda1 - lambda2))))) <= 2e-6)
tmp = (lambda2 * R) - (lambda1 * R);
else
tmp = R * acos((t_0 + (cos(phi2) * (cos(phi1) * ((sin(lambda2) * sin(lambda1)) + (cos(lambda2) * cos(lambda1)))))));
end
tmp_2 = tmp;
end
code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[ArcCos[N[(N[(N[Sin[phi1], $MachinePrecision] * N[Sin[phi2], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * R), $MachinePrecision]
↓
code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Sin[phi1], $MachinePrecision] * N[Sin[phi2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[ArcCos[N[(t$95$0 + N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2e-6], N[(N[(lambda2 * R), $MachinePrecision] - N[(lambda1 * R), $MachinePrecision]), $MachinePrecision], N[(R * N[ArcCos[N[(t$95$0 + N[(N[Cos[phi2], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[(N[(N[Sin[lambda2], $MachinePrecision] * N[Sin[lambda1], $MachinePrecision]), $MachinePrecision] + N[(N[Cos[lambda2], $MachinePrecision] * N[Cos[lambda1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \cdot R
↓
\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\cos^{-1} \left(t_0 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\lambda_2 \cdot R - \lambda_1 \cdot R\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 10.2 |
|---|
| Cost | 58824 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \cos \phi_1 \cdot \cos \phi_2\\
t_2 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_1 \leq -56801.11291929814:\\
\;\;\;\;\mathsf{fma}\left(\pi \cdot 0.5, R, R \cdot \left(-\sin^{-1} \left(\mathsf{fma}\left(t_0, t_1, t_2\right)\right)\right)\right)\\
\mathbf{elif}\;\phi_1 \leq 1.9271134508852888 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\phi_1 \cdot \sin \phi_2 + t_1 \cdot \mathsf{fma}\left(\cos \lambda_2, \cos \lambda_1, \sin \lambda_2 \cdot \sin \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 \cdot t_0 + \frac{1}{\frac{1}{t_2}}\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 10.1 |
|---|
| Cost | 58692 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \cos \phi_1 \cdot \cos \phi_2\\
t_2 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_1 \leq -0.009754333911024758:\\
\;\;\;\;\mathsf{fma}\left(\pi \cdot 0.5, R, R \cdot \left(-\sin^{-1} \left(\mathsf{fma}\left(t_0, t_1, t_2\right)\right)\right)\right)\\
\mathbf{elif}\;\phi_1 \leq 1.9271134508852888 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_2 + \cos \phi_2 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 \cdot t_0 + \frac{1}{\frac{1}{t_2}}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 10.1 |
|---|
| Cost | 52424 |
|---|
\[\begin{array}{l}
t_0 := \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_1 \leq -1.518655669388917 \cdot 10^{-11}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, t_0\right)\right)\\
\mathbf{elif}\;\phi_1 \leq 1.9271134508852888 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_2 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \frac{1}{\frac{1}{t_1}}\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 11.2 |
|---|
| Cost | 45892 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \cos \phi_2\\
t_1 := \cos \left(\lambda_1 - \lambda_2\right)\\
\mathbf{if}\;\phi_2 \leq -2.6346245622427554 \cdot 10^{-48}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \frac{1}{\frac{\frac{1}{t_0}}{t_1}}\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 5.398425980427339 \cdot 10^{-27}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot t_1 + \frac{1}{\frac{1}{\sin \phi_1 \cdot \sin \phi_2}}\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 11.6 |
|---|
| Cost | 45764 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \cos \phi_1 \cdot \cos \phi_2\\
\mathbf{if}\;\phi_2 \leq -4.1472499936089594 \cdot 10^{-92}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \frac{t_0}{\frac{1}{t_1}}\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 5.398425980427339 \cdot 10^{-27}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 \cdot t_0 + \frac{1}{\frac{1}{\sin \phi_1 \cdot \sin \phi_2}}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 11.6 |
|---|
| Cost | 39752 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \cos \phi_1 \cdot \cos \phi_2\\
t_2 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -4.1472499936089594 \cdot 10^{-92}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_2 + \frac{t_0}{\frac{1}{t_1}}\right)\\
\mathbf{elif}\;\phi_2 \leq 5.398425980427339 \cdot 10^{-27}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 \cdot t_0 + \frac{1}{\frac{1}{t_2}}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 11.4 |
|---|
| Cost | 39496 |
|---|
\[\begin{array}{l}
t_0 := \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \cdot R\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 5.398425980427339 \cdot 10^{-27}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 11.6 |
|---|
| Cost | 39496 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \cos \phi_1 \cdot \cos \phi_2\\
t_2 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -4.1472499936089594 \cdot 10^{-92}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_2 + \frac{t_0}{\frac{1}{t_1}}\right)\\
\mathbf{elif}\;\phi_2 \leq 5.398425980427339 \cdot 10^{-27}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos^{-1} \left(t_2 + t_1 \cdot t_0\right) \cdot R\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 28.2 |
|---|
| Cost | 39372 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \cos \phi_2\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, t_0\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 1405763819360421.8:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \cos \left(\lambda_1 - \lambda_2\right) + \sin \phi_1 \cdot \phi_2\right)\\
\mathbf{elif}\;\phi_2 \leq 5.473368291690849 \cdot 10^{+108}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \cos \phi_2 \cdot \cos \left(\lambda_2 - \lambda_1\right)\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 23.3 |
|---|
| Cost | 39368 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 9.196251035014615 \cdot 10^{-18}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \cos \phi_1 \cdot \cos \left(\lambda_2 - \lambda_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 17.5 |
|---|
| Cost | 39368 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 9.196251035014615 \cdot 10^{-18}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 15.2 |
|---|
| Cost | 39368 |
|---|
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\lambda_1 \leq -1.401269559717865 \cdot 10^{-6}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{elif}\;\lambda_1 \leq 4.826221919811612 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\sin \lambda_2 \cdot \sin \lambda_1 + \cos \lambda_2 \cdot \cos \lambda_1\right)\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 28.1 |
|---|
| Cost | 38980 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \cos \phi_2\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, t_0\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 1405763819360421.8:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \cos \left(\lambda_1 - \lambda_2\right) + \sin \phi_1 \cdot \phi_2\right)\\
\mathbf{elif}\;\phi_2 \leq 5.473368291690849 \cdot 10^{+108}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot \cos \left(\lambda_2 - \lambda_1\right)\right)\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 28.1 |
|---|
| Cost | 33096 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_1 \cdot \cos \phi_2\\
t_1 := R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + t_0\right)\\
\mathbf{if}\;\phi_2 \leq -71005389823324184:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_2 \leq 1405763819360421.8:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \cos \left(\lambda_1 - \lambda_2\right) + \sin \phi_1 \cdot \phi_2\right)\\
\mathbf{elif}\;\phi_2 \leq 5.473368291690849 \cdot 10^{+108}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot \cos \left(\lambda_2 - \lambda_1\right)\right)\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 36.9 |
|---|
| Cost | 19784 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_1 \leq -2.850880258250221 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \cos \lambda_1\right)\\
\mathbf{elif}\;\lambda_1 \leq -5.802316097185745 \cdot 10^{-203}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \left(\phi_2 - \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \cos \lambda_2\right)\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 33.0 |
|---|
| Cost | 19780 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\phi_1 \leq -0.009754333911024758:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \cos \lambda_2\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot \cos \left(\lambda_2 - \lambda_1\right)\right)\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 31.6 |
|---|
| Cost | 19780 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_2 - \lambda_1\right)\\
\mathbf{if}\;\phi_2 \leq 2.115584907086277 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot t_0\right)\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 46.3 |
|---|
| Cost | 19652 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \cos \left(\lambda_2 - \lambda_1\right)\\
t_1 := R \cdot \cos^{-1} \cos \phi_2\\
\mathbf{if}\;\phi_1 \leq -0.009754333911024758:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \cos \lambda_2\right)\\
\mathbf{elif}\;\phi_1 \leq -1.157071485028341 \cdot 10^{-265}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_1 \leq 1.0015030098475422 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq 1.3673710090706307 \cdot 10^{-102}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 47.8 |
|---|
| Cost | 13648 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \cos \left(\lambda_2 - \lambda_1\right)\\
t_1 := R \cdot \cos^{-1} \cos \phi_2\\
\mathbf{if}\;\phi_1 \leq -1.7469452007195502 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \left(\phi_2 - \phi_1\right)\\
\mathbf{elif}\;\phi_1 \leq -1.157071485028341 \cdot 10^{-265}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_1 \leq 1.0015030098475422 \cdot 10^{-181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq 1.3673710090706307 \cdot 10^{-102}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 49.9 |
|---|
| Cost | 13388 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\phi_2 \leq -7.774648332706178 \cdot 10^{-225}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \phi_1\\
\mathbf{elif}\;\phi_2 \leq 4.214097319121884 \cdot 10^{-229}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_2\\
\mathbf{elif}\;\phi_2 \leq 1.6903410713415965 \cdot 10^{-6}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_1\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \phi_2\\
\end{array}
\]
| Alternative 21 |
|---|
| Error | 46.1 |
|---|
| Cost | 13256 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_1 \leq -2.850880258250221 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_1\\
\mathbf{elif}\;\lambda_1 \leq -5.802316097185745 \cdot 10^{-203}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \phi_2\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_2\\
\end{array}
\]
| Alternative 22 |
|---|
| Error | 42.6 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_1 \leq -844.8295220394822:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_1\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \left(\phi_2 - \phi_1\right)\\
\end{array}
\]
| Alternative 23 |
|---|
| Error | 51.9 |
|---|
| Cost | 13124 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_2 \leq 5.349019211088226 \cdot 10^{-19}:\\
\;\;\;\;\lambda_2 \cdot R - \lambda_1 \cdot R\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_2\\
\end{array}
\]
| Alternative 24 |
|---|
| Error | 47.7 |
|---|
| Cost | 13124 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_2 \leq 4.6258579422656443 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \phi_2\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \cos \lambda_2\\
\end{array}
\]
| Alternative 25 |
|---|
| Error | 58.9 |
|---|
| Cost | 832 |
|---|
\[\frac{\lambda_2 - \lambda_1}{\frac{\frac{\lambda_1 + \lambda_2}{R}}{\lambda_1 + \lambda_2}}
\]
| Alternative 26 |
|---|
| Error | 59.5 |
|---|
| Cost | 452 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_2 \leq 1.1148207114109132 \cdot 10^{-197}:\\
\;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;\lambda_2 \cdot R\\
\end{array}
\]
| Alternative 27 |
|---|
| Error | 58.9 |
|---|
| Cost | 448 |
|---|
\[\lambda_2 \cdot R - \lambda_1 \cdot R
\]
| Alternative 28 |
|---|
| Error | 59.2 |
|---|
| Cost | 388 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\lambda_1 \leq -1.1384283968035681 \cdot 10^{-247}:\\
\;\;\;\;\lambda_1 \cdot \left(-R\right)\\
\mathbf{else}:\\
\;\;\;\;\lambda_2 \cdot R\\
\end{array}
\]
| Alternative 29 |
|---|
| Error | 58.9 |
|---|
| Cost | 320 |
|---|
\[R \cdot \left(\lambda_2 - \lambda_1\right)
\]
| Alternative 30 |
|---|
| Error | 59.9 |
|---|
| Cost | 192 |
|---|
\[\lambda_2 \cdot R
\]