\[\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
\]
↓
\[\cos^{-1} \left(\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\sin \lambda_1, \sin \lambda_2, \cos \lambda_2 \cdot \cos \lambda_1\right), \sin \phi_1 \cdot \sin \phi_2\right)\right) \cdot R
\]
(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
(*
(acos
(fma
(* (cos phi2) (cos phi1))
(fma (sin lambda1) (sin lambda2) (* (cos lambda2) (cos lambda1)))
(* (sin phi1) (sin phi2))))
R))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) {
return acos(fma((cos(phi2) * cos(phi1)), fma(sin(lambda1), sin(lambda2), (cos(lambda2) * cos(lambda1))), (sin(phi1) * sin(phi2)))) * R;
}
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)
return Float64(acos(fma(Float64(cos(phi2) * cos(phi1)), fma(sin(lambda1), sin(lambda2), Float64(cos(lambda2) * cos(lambda1))), Float64(sin(phi1) * sin(phi2)))) * R)
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_] := N[(N[ArcCos[N[(N[(N[Cos[phi2], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[lambda1], $MachinePrecision] * N[Sin[lambda2], $MachinePrecision] + N[(N[Cos[lambda2], $MachinePrecision] * N[Cos[lambda1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[phi1], $MachinePrecision] * N[Sin[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * R), $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
↓
\cos^{-1} \left(\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\sin \lambda_1, \sin \lambda_2, \cos \lambda_2 \cdot \cos \lambda_1\right), \sin \phi_1 \cdot \sin \phi_2\right)\right) \cdot R
Alternatives
| Alternative 1 |
|---|
| Error | 4.0 |
|---|
| Cost | 64960 |
|---|
\[R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot \mathsf{fma}\left(\cos \lambda_1, \cos \lambda_2, \sin \lambda_1 \cdot \sin \lambda_2\right)\right)
\]
| Alternative 2 |
|---|
| Error | 4.0 |
|---|
| Cost | 64960 |
|---|
\[R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot \mathsf{fma}\left(\sin \lambda_1, \sin \lambda_2, \cos \lambda_2 \cdot \cos \lambda_1\right)\right)
\]
| Alternative 3 |
|---|
| Error | 10.9 |
|---|
| Cost | 58824 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := \cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), t_0, \sin \phi_1 \cdot \sin \phi_2\right)\right)\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 3785298.970286832:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \mathsf{fma}\left(\sin \lambda_1, \sin \lambda_2, \cos \lambda_2 \cdot \cos \lambda_1\right) + \phi_2 \cdot \sin \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(t_1\right)\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 4.0 |
|---|
| Cost | 58688 |
|---|
\[R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right)\right)
\]
| Alternative 5 |
|---|
| Error | 10.8 |
|---|
| Cost | 58568 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 3785298.970286832:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right) + \phi_2 \cdot \sin \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \log \left(e^{\cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), t_0, t_1\right)\right)}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 10.8 |
|---|
| Cost | 58568 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 3785298.970286832:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right) + \phi_2 \cdot \sin \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), t_0, t_1\right)\right)\right)\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 10.9 |
|---|
| Cost | 58568 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := \cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), t_0, \sin \phi_1 \cdot \sin \phi_2\right)\right)\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(t_1\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 3785298.970286832:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right) + \phi_2 \cdot \sin \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(t_1\right)\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 10.8 |
|---|
| Cost | 52552 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 3785298.970286832:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right) + \phi_2 \cdot \sin \phi_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), t_0, t_1\right)\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 11.0 |
|---|
| Cost | 46024 |
|---|
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -0.001771095156682198:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 2.6452787870445573 \cdot 10^{-23}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\phi_2 \cdot \sin \phi_1 + \cos \phi_1 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), \cos \phi_2 \cdot \cos \phi_1, t_0\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 11.1 |
|---|
| Cost | 45768 |
|---|
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -2.0489324248723593 \cdot 10^{-18}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 2.6452787870445573 \cdot 10^{-23}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \mathsf{fma}\left(\cos \lambda_2, \cos \lambda_1, \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), \cos \phi_2 \cdot \cos \phi_1, t_0\right)\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 11.1 |
|---|
| Cost | 45640 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -2.0489324248723593 \cdot 10^{-18}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot t_0\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 2.6452787870445573 \cdot 10^{-23}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \mathsf{fma}\left(\cos \lambda_2, \cos \lambda_1, \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot t_0\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 17.4 |
|---|
| Cost | 39896 |
|---|
\[\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)\\
t_1 := \cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\\
t_2 := R \cdot \cos^{-1} \left(\cos \phi_2 \cdot t_1\right)\\
\mathbf{if}\;\phi_2 \leq -3.653964539340922 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 3.3675086527382384 \cdot 10^{-11}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot t_1\right)\\
\mathbf{elif}\;\phi_2 \leq 2.959794502762625 \cdot 10^{+127}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\phi_2 \leq 4.8504165826405776 \cdot 10^{+191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 2.0099808415093212 \cdot 10^{+228}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\phi_2 \leq 7.111005260934945 \cdot 10^{+295}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 17.3 |
|---|
| Cost | 39632 |
|---|
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
t_1 := R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_2\right)\right)\\
t_2 := \cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\\
\mathbf{if}\;\lambda_2 \leq -3.324560186503782:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot t_2\right)\\
\mathbf{elif}\;\lambda_2 \leq 0.002215551339273201:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{elif}\;\lambda_2 \leq 5.437220474107897 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\lambda_2 \leq 2.6616776691247708 \cdot 10^{+225}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 17.3 |
|---|
| Cost | 39632 |
|---|
\[\begin{array}{l}
t_0 := \sin \phi_1 \cdot \sin \phi_2\\
t_1 := \cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\\
\mathbf{if}\;\lambda_2 \leq -3.324560186503782:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot t_1\right)\\
\mathbf{elif}\;\lambda_2 \leq 0.002215551339273201:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{elif}\;\lambda_2 \leq 5.437220474107897 \cdot 10^{+154}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \lambda_2 \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)\right)\\
\mathbf{elif}\;\lambda_2 \leq 2.6616776691247708 \cdot 10^{+225}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_2\right)\right)\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 11.1 |
|---|
| Cost | 39496 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{if}\;\phi_2 \leq -2.0489324248723593 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 2.6452787870445573 \cdot 10^{-23}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 11.1 |
|---|
| Cost | 39496 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \sin \phi_1 \cdot \sin \phi_2\\
\mathbf{if}\;\phi_2 \leq -2.0489324248723593 \cdot 10^{-18}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot t_0\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 2.6452787870445573 \cdot 10^{-23}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot t_0\right)\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 25.9 |
|---|
| Cost | 39372 |
|---|
\[\begin{array}{l}
t_0 := R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \cos \phi_2 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\\
\mathbf{if}\;\phi_2 \leq 3.3675086527382384 \cdot 10^{-11}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot \left(\cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\right)\right)\\
\mathbf{elif}\;\phi_2 \leq 9.411803137543734 \cdot 10^{+208}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\phi_2 \leq 7.111005260934945 \cdot 10^{+295}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \cos \phi_2 \cdot \cos \phi_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 20.8 |
|---|
| Cost | 39368 |
|---|
\[\begin{array}{l}
t_0 := \cos \lambda_2 \cdot \cos \lambda_1 + \sin \lambda_1 \cdot \sin \lambda_2\\
\mathbf{if}\;\phi_1 \leq -7325599.827869333:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_1 \cdot t_0\right)\\
\mathbf{elif}\;\phi_1 \leq 1.2193725882016935 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \phi_2 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, \cos \phi_2 \cdot \cos \phi_1\right)\right)\\
\end{array}
\]
| Alternative 19 |
|---|
| Error | 30.0 |
|---|
| Cost | 39244 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
t_1 := R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, t_0\right)\right)\\
t_2 := t_0 \cdot \cos \left(\lambda_1 - \lambda_2\right)\\
\mathbf{if}\;\phi_1 \leq -2.2150024426448447 \cdot 10^{+253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\phi_1 \leq -7325599.827869333:\\
\;\;\;\;R \cdot \cos^{-1} \left(\phi_2 \cdot \sin \phi_1 + t_2\right)\\
\mathbf{elif}\;\phi_1 \leq 1.2193725882016935 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_2 + \phi_1 \cdot \sin \phi_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 20 |
|---|
| Error | 28.6 |
|---|
| Cost | 39112 |
|---|
\[\begin{array}{l}
t_0 := \cos \phi_2 \cdot \cos \phi_1\\
\mathbf{if}\;\phi_1 \leq -7325599.827869333:\\
\;\;\;\;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{elif}\;\phi_1 \leq 1.2193725882016935 \cdot 10^{-17}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 \cdot \cos \left(\lambda_1 - \lambda_2\right) + \phi_1 \cdot \sin \phi_2\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\mathsf{fma}\left(\sin \phi_1, \sin \phi_2, t_0\right)\right)\\
\end{array}
\]
| Alternative 21 |
|---|
| Error | 32.9 |
|---|
| Cost | 32964 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
\mathbf{if}\;\phi_1 \leq -7325599.827869333:\\
\;\;\;\;R \cdot \cos^{-1} \left(\phi_2 \cdot \sin \phi_1 + t_0 \cdot \left(\cos \phi_1 \cdot \left(-0.5 \cdot \left(\phi_2 \cdot \phi_2\right) + 1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot t_0 + \phi_1 \cdot \sin \phi_2\right)\\
\end{array}
\]
| Alternative 22 |
|---|
| Error | 32.9 |
|---|
| Cost | 32964 |
|---|
\[\begin{array}{l}
t_0 := \left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot \cos \left(\lambda_1 - \lambda_2\right)\\
\mathbf{if}\;\phi_1 \leq -7325599.827869333:\\
\;\;\;\;R \cdot \cos^{-1} \left(\phi_2 \cdot \sin \phi_1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \phi_1 \cdot \sin \phi_2\right)\\
\end{array}
\]
| Alternative 23 |
|---|
| Error | 40.7 |
|---|
| Cost | 32836 |
|---|
\[\begin{array}{l}
t_0 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\lambda_2 \leq 0.002215551339273201:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot \cos \lambda_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \lambda_2 \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)\right)\\
\end{array}
\]
| Alternative 24 |
|---|
| Error | 41.3 |
|---|
| Cost | 26948 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\phi_1 \leq -2.3967311060527453 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + t_0 \cdot \left(\cos \phi_1 \cdot \left(-0.5 \cdot \left(\phi_2 \cdot \phi_2\right) + 1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_2 \cdot t_0\right)\\
\end{array}
\]
| Alternative 25 |
|---|
| Error | 40.1 |
|---|
| Cost | 26436 |
|---|
\[\begin{array}{l}
t_0 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\phi_2 \leq 3.3675086527382384 \cdot 10^{-11}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_1 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \cos \lambda_2\right)\\
\end{array}
\]
| Alternative 26 |
|---|
| Error | 41.4 |
|---|
| Cost | 26436 |
|---|
\[\begin{array}{l}
t_0 := \cos \left(\lambda_1 - \lambda_2\right)\\
t_1 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\phi_1 \leq -2.3967311060527453 \cdot 10^{-7}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_1 \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_1 + \cos \phi_2 \cdot t_0\right)\\
\end{array}
\]
| Alternative 27 |
|---|
| Error | 49.9 |
|---|
| Cost | 26308 |
|---|
\[\begin{array}{l}
t_0 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\lambda_1 \leq -2.9452362796445526 \cdot 10^{-5}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \lambda_1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \cos \lambda_2\right)\\
\end{array}
\]
| Alternative 28 |
|---|
| Error | 49.2 |
|---|
| Cost | 26308 |
|---|
\[\begin{array}{l}
t_0 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\lambda_1 \leq -2.9452362796445526 \cdot 10^{-5}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \cos \lambda_1\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(t_0 + \cos \phi_2 \cdot \cos \lambda_2\right)\\
\end{array}
\]
| Alternative 29 |
|---|
| Error | 53.6 |
|---|
| Cost | 19780 |
|---|
\[\begin{array}{l}
t_0 := \phi_2 \cdot \sin \phi_1\\
\mathbf{if}\;\lambda_1 \leq -2.9452362796445526 \cdot 10^{-5}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \lambda_1 + t_0\right)\\
\mathbf{else}:\\
\;\;\;\;R \cdot \cos^{-1} \left(\cos \lambda_2 + t_0\right)\\
\end{array}
\]
| Alternative 30 |
|---|
| Error | 51.2 |
|---|
| Cost | 19776 |
|---|
\[R \cdot \cos^{-1} \left(\phi_2 \cdot \sin \phi_1 + \cos \left(\lambda_1 - \lambda_2\right)\right)
\]
| Alternative 31 |
|---|
| Error | 52.5 |
|---|
| Cost | 13376 |
|---|
\[R \cdot \cos^{-1} \left(\cos \left(\lambda_1 - \lambda_2\right) + \phi_2 \cdot \phi_1\right)
\]