Distance on a great circle

Percentage Accurate: 62.7% → 79.3%
Time: 48.8s
Alternatives: 30
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t\_0\right) \cdot t\_0\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - t\_1}}\right) \end{array} \end{array} \]
(FPCore (R lambda1 lambda2 phi1 phi2)
 :precision binary64
 (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
        (t_1
         (+
          (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)
          (* (* (* (cos phi1) (cos phi2)) t_0) t_0))))
   (* R (* 2.0 (atan2 (sqrt t_1) (sqrt (- 1.0 t_1)))))))
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = sin(((lambda1 - lambda2) / 2.0));
	double t_1 = pow(sin(((phi1 - phi2) / 2.0)), 2.0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0);
	return R * (2.0 * atan2(sqrt(t_1), sqrt((1.0 - t_1))));
}
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) :: t_1
    t_0 = sin(((lambda1 - lambda2) / 2.0d0))
    t_1 = (sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0)
    code = r * (2.0d0 * atan2(sqrt(t_1), sqrt((1.0d0 - t_1))))
end function
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = Math.sin(((lambda1 - lambda2) / 2.0));
	double t_1 = Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((Math.cos(phi1) * Math.cos(phi2)) * t_0) * t_0);
	return R * (2.0 * Math.atan2(Math.sqrt(t_1), Math.sqrt((1.0 - t_1))));
}
def code(R, lambda1, lambda2, phi1, phi2):
	t_0 = math.sin(((lambda1 - lambda2) / 2.0))
	t_1 = math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((math.cos(phi1) * math.cos(phi2)) * t_0) * t_0)
	return R * (2.0 * math.atan2(math.sqrt(t_1), math.sqrt((1.0 - t_1))))
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_1 = Float64((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + Float64(Float64(Float64(cos(phi1) * cos(phi2)) * t_0) * t_0))
	return Float64(R * Float64(2.0 * atan(sqrt(t_1), sqrt(Float64(1.0 - t_1)))))
end
function tmp = code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(((lambda1 - lambda2) / 2.0));
	t_1 = (sin(((phi1 - phi2) / 2.0)) ^ 2.0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0);
	tmp = R * (2.0 * atan2(sqrt(t_1), sqrt((1.0 - t_1))));
end
code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, N[(R * N[(2.0 * N[ArcTan[N[Sqrt[t$95$1], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_1 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t\_0\right) \cdot t\_0\\
R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - t\_1}}\right)
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 30 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 62.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t\_0\right) \cdot t\_0\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - t\_1}}\right) \end{array} \end{array} \]
(FPCore (R lambda1 lambda2 phi1 phi2)
 :precision binary64
 (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
        (t_1
         (+
          (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)
          (* (* (* (cos phi1) (cos phi2)) t_0) t_0))))
   (* R (* 2.0 (atan2 (sqrt t_1) (sqrt (- 1.0 t_1)))))))
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = sin(((lambda1 - lambda2) / 2.0));
	double t_1 = pow(sin(((phi1 - phi2) / 2.0)), 2.0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0);
	return R * (2.0 * atan2(sqrt(t_1), sqrt((1.0 - t_1))));
}
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) :: t_1
    t_0 = sin(((lambda1 - lambda2) / 2.0d0))
    t_1 = (sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0)
    code = r * (2.0d0 * atan2(sqrt(t_1), sqrt((1.0d0 - t_1))))
end function
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = Math.sin(((lambda1 - lambda2) / 2.0));
	double t_1 = Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((Math.cos(phi1) * Math.cos(phi2)) * t_0) * t_0);
	return R * (2.0 * Math.atan2(Math.sqrt(t_1), Math.sqrt((1.0 - t_1))));
}
def code(R, lambda1, lambda2, phi1, phi2):
	t_0 = math.sin(((lambda1 - lambda2) / 2.0))
	t_1 = math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((math.cos(phi1) * math.cos(phi2)) * t_0) * t_0)
	return R * (2.0 * math.atan2(math.sqrt(t_1), math.sqrt((1.0 - t_1))))
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_1 = Float64((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + Float64(Float64(Float64(cos(phi1) * cos(phi2)) * t_0) * t_0))
	return Float64(R * Float64(2.0 * atan(sqrt(t_1), sqrt(Float64(1.0 - t_1)))))
end
function tmp = code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(((lambda1 - lambda2) / 2.0));
	t_1 = (sin(((phi1 - phi2) / 2.0)) ^ 2.0) + (((cos(phi1) * cos(phi2)) * t_0) * t_0);
	tmp = R * (2.0 * atan2(sqrt(t_1), sqrt((1.0 - t_1))));
end
code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, N[(R * N[(2.0 * N[ArcTan[N[Sqrt[t$95$1], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_1 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t\_0\right) \cdot t\_0\\
R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - t\_1}}\right)
\end{array}
\end{array}

Alternative 1: 79.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_2 := \left(-\lambda_1\right) \cdot -0.5\\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_1, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_0\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\left(\mathsf{fma}\left(\sin \left(\lambda_2 \cdot -0.5\right), \cos t\_2, \sin t\_2 \cdot \cos \left(\lambda_2 \cdot -0.5\right)\right)\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot t\_0 - \sin \left(\phi_2 \cdot 0.5\right) \cdot t\_1\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
(FPCore (R lambda1 lambda2 phi1 phi2)
 :precision binary64
 (let* ((t_0 (sin (* phi1 0.5)))
        (t_1 (cos (* phi1 0.5)))
        (t_2 (* (- lambda1) -0.5)))
   (*
    (atan2
     (sqrt
      (fma
       (* (cos phi1) (cos phi2))
       (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0)
       (pow (fma (sin (* phi2 -0.5)) t_1 (* (cos (* phi2 -0.5)) t_0)) 2.0)))
     (sqrt
      (-
       1.0
       (fma
        (*
         (pow
          (fma
           (sin (* lambda2 -0.5))
           (cos t_2)
           (* (sin t_2) (cos (* lambda2 -0.5))))
          2.0)
         (cos phi2))
        (cos phi1)
        (pow (- (* (cos (* phi2 0.5)) t_0) (* (sin (* phi2 0.5)) t_1)) 2.0)))))
    (* 2.0 R))))
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = sin((phi1 * 0.5));
	double t_1 = cos((phi1 * 0.5));
	double t_2 = -lambda1 * -0.5;
	return atan2(sqrt(fma((cos(phi1) * cos(phi2)), pow(sin(((lambda2 - lambda1) * -0.5)), 2.0), pow(fma(sin((phi2 * -0.5)), t_1, (cos((phi2 * -0.5)) * t_0)), 2.0))), sqrt((1.0 - fma((pow(fma(sin((lambda2 * -0.5)), cos(t_2), (sin(t_2) * cos((lambda2 * -0.5)))), 2.0) * cos(phi2)), cos(phi1), pow(((cos((phi2 * 0.5)) * t_0) - (sin((phi2 * 0.5)) * t_1)), 2.0))))) * (2.0 * R);
}
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(Float64(phi1 * 0.5))
	t_1 = cos(Float64(phi1 * 0.5))
	t_2 = Float64(Float64(-lambda1) * -0.5)
	return Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0), (fma(sin(Float64(phi2 * -0.5)), t_1, Float64(cos(Float64(phi2 * -0.5)) * t_0)) ^ 2.0))), sqrt(Float64(1.0 - fma(Float64((fma(sin(Float64(lambda2 * -0.5)), cos(t_2), Float64(sin(t_2) * cos(Float64(lambda2 * -0.5)))) ^ 2.0) * cos(phi2)), cos(phi1), (Float64(Float64(cos(Float64(phi2 * 0.5)) * t_0) - Float64(sin(Float64(phi2 * 0.5)) * t_1)) ^ 2.0))))) * Float64(2.0 * R))
end
code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[((-lambda1) * -0.5), $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$1 + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[(N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision] + N[(N[Sin[t$95$2], $MachinePrecision] * N[Cos[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[(N[(N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] - N[(N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(\phi_1 \cdot 0.5\right)\\
t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\
t_2 := \left(-\lambda_1\right) \cdot -0.5\\
\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_1, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_0\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\left(\mathsf{fma}\left(\sin \left(\lambda_2 \cdot -0.5\right), \cos t\_2, \sin t\_2 \cdot \cos \left(\lambda_2 \cdot -0.5\right)\right)\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot t\_0 - \sin \left(\phi_2 \cdot 0.5\right) \cdot t\_1\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)
\end{array}
\end{array}
Derivation
  1. Initial program 65.5%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    2. lift-/.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    3. lift--.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    4. div-subN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    5. sin-diffN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    6. lower--.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    7. lower-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    8. lower-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    9. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    10. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    11. lower-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    12. lower-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    13. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    14. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    15. lower-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    16. lower-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    17. lower-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    18. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    19. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    20. lower-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    21. lower-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    22. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    23. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    24. lower-*.f6466.2

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  4. Applied rewrites66.2%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  5. Step-by-step derivation
    1. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    2. lift-/.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    3. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    4. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    5. *-commutativeN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    6. lift--.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    7. sub-negN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    8. distribute-rgt-inN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    9. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    10. cancel-sign-sub-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    11. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    12. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    13. *-commutativeN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    14. cancel-sign-sub-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    15. sin-sumN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    16. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    17. lower-fma.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  6. Applied rewrites79.1%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  7. Taylor expanded in lambda1 around -inf

    \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
  8. Applied rewrites79.2%

    \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
  9. Step-by-step derivation
    1. Applied rewrites79.8%

      \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\left(\mathsf{fma}\left(\sin \left(\lambda_2 \cdot -0.5\right), \cos \left(\left(-\lambda_1\right) \cdot -0.5\right), \cos \left(\lambda_2 \cdot -0.5\right) \cdot \sin \left(\left(-\lambda_1\right) \cdot -0.5\right)\right)\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}} \]
    2. Final simplification79.8%

      \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\left(\mathsf{fma}\left(\sin \left(\lambda_2 \cdot -0.5\right), \cos \left(\left(-\lambda_1\right) \cdot -0.5\right), \sin \left(\left(-\lambda_1\right) \cdot -0.5\right) \cdot \cos \left(\lambda_2 \cdot -0.5\right)\right)\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \]
    3. Add Preprocessing

    Alternative 2: 78.6% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_2 := \sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_1, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_0\right)\right)}^{2}\right)}\\ t_3 := {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), t\_0, \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot t\_1\right)\right)}^{2}\\ t_4 := \tan^{-1}_* \frac{t\_2}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_3\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{if}\;\lambda_2 \leq -7.6 \cdot 10^{-6}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;\lambda_2 \leq 2.9 \cdot 10^{-6}:\\ \;\;\;\;\tan^{-1}_* \frac{t\_2}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot 0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_3\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;t\_4\\ \end{array} \end{array} \]
    (FPCore (R lambda1 lambda2 phi1 phi2)
     :precision binary64
     (let* ((t_0 (sin (* phi1 0.5)))
            (t_1 (cos (* phi1 0.5)))
            (t_2
             (sqrt
              (fma
               (* (cos phi1) (cos phi2))
               (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0)
               (pow
                (fma (sin (* phi2 -0.5)) t_1 (* (cos (* phi2 -0.5)) t_0))
                2.0))))
            (t_3
             (pow (fma (cos (* phi2 0.5)) t_0 (* (- (sin (* phi2 0.5))) t_1)) 2.0))
            (t_4
             (*
              (atan2
               t_2
               (sqrt
                (-
                 1.0
                 (fma
                  (* (pow (sin (* lambda2 -0.5)) 2.0) (cos phi2))
                  (cos phi1)
                  t_3))))
              (* 2.0 R))))
       (if (<= lambda2 -7.6e-6)
         t_4
         (if (<= lambda2 2.9e-6)
           (*
            (atan2
             t_2
             (sqrt
              (-
               1.0
               (fma
                (* (pow (sin (* lambda1 0.5)) 2.0) (cos phi2))
                (cos phi1)
                t_3))))
            (* 2.0 R))
           t_4))))
    double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
    	double t_0 = sin((phi1 * 0.5));
    	double t_1 = cos((phi1 * 0.5));
    	double t_2 = sqrt(fma((cos(phi1) * cos(phi2)), pow(sin(((lambda2 - lambda1) * -0.5)), 2.0), pow(fma(sin((phi2 * -0.5)), t_1, (cos((phi2 * -0.5)) * t_0)), 2.0)));
    	double t_3 = pow(fma(cos((phi2 * 0.5)), t_0, (-sin((phi2 * 0.5)) * t_1)), 2.0);
    	double t_4 = atan2(t_2, sqrt((1.0 - fma((pow(sin((lambda2 * -0.5)), 2.0) * cos(phi2)), cos(phi1), t_3)))) * (2.0 * R);
    	double tmp;
    	if (lambda2 <= -7.6e-6) {
    		tmp = t_4;
    	} else if (lambda2 <= 2.9e-6) {
    		tmp = atan2(t_2, sqrt((1.0 - fma((pow(sin((lambda1 * 0.5)), 2.0) * cos(phi2)), cos(phi1), t_3)))) * (2.0 * R);
    	} else {
    		tmp = t_4;
    	}
    	return tmp;
    }
    
    function code(R, lambda1, lambda2, phi1, phi2)
    	t_0 = sin(Float64(phi1 * 0.5))
    	t_1 = cos(Float64(phi1 * 0.5))
    	t_2 = sqrt(fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0), (fma(sin(Float64(phi2 * -0.5)), t_1, Float64(cos(Float64(phi2 * -0.5)) * t_0)) ^ 2.0)))
    	t_3 = fma(cos(Float64(phi2 * 0.5)), t_0, Float64(Float64(-sin(Float64(phi2 * 0.5))) * t_1)) ^ 2.0
    	t_4 = Float64(atan(t_2, sqrt(Float64(1.0 - fma(Float64((sin(Float64(lambda2 * -0.5)) ^ 2.0) * cos(phi2)), cos(phi1), t_3)))) * Float64(2.0 * R))
    	tmp = 0.0
    	if (lambda2 <= -7.6e-6)
    		tmp = t_4;
    	elseif (lambda2 <= 2.9e-6)
    		tmp = Float64(atan(t_2, sqrt(Float64(1.0 - fma(Float64((sin(Float64(lambda1 * 0.5)) ^ 2.0) * cos(phi2)), cos(phi1), t_3)))) * Float64(2.0 * R));
    	else
    		tmp = t_4;
    	end
    	return tmp
    end
    
    code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$1 + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0 + N[((-N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]) * t$95$1), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = N[(N[ArcTan[t$95$2 / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[lambda2, -7.6e-6], t$95$4, If[LessEqual[lambda2, 2.9e-6], N[(N[ArcTan[t$95$2 / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin \left(\phi_1 \cdot 0.5\right)\\
    t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\
    t_2 := \sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_1, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_0\right)\right)}^{2}\right)}\\
    t_3 := {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), t\_0, \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot t\_1\right)\right)}^{2}\\
    t_4 := \tan^{-1}_* \frac{t\_2}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_3\right)}} \cdot \left(2 \cdot R\right)\\
    \mathbf{if}\;\lambda_2 \leq -7.6 \cdot 10^{-6}:\\
    \;\;\;\;t\_4\\
    
    \mathbf{elif}\;\lambda_2 \leq 2.9 \cdot 10^{-6}:\\
    \;\;\;\;\tan^{-1}_* \frac{t\_2}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot 0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_3\right)}} \cdot \left(2 \cdot R\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_4\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if lambda2 < -7.6000000000000001e-6 or 2.9000000000000002e-6 < lambda2

      1. Initial program 51.2%

        \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-sin.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        2. lift-/.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        3. lift--.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        4. div-subN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        5. sin-diffN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        6. lower--.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        7. lower-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        8. lower-sin.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        9. div-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        10. metadata-evalN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        11. lower-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        12. lower-cos.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        13. div-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        14. metadata-evalN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        15. lower-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        16. lower-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        17. lower-cos.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        18. div-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        19. metadata-evalN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        20. lower-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        21. lower-sin.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        22. div-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        23. metadata-evalN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        24. lower-*.f6451.8

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      4. Applied rewrites51.8%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Step-by-step derivation
        1. lift-sin.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        2. lift-/.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        3. div-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        4. metadata-evalN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        5. *-commutativeN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        6. lift--.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        7. sub-negN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        8. distribute-rgt-inN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        9. lift-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        10. cancel-sign-sub-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        11. lift-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        12. lift-*.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        13. *-commutativeN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        14. cancel-sign-sub-invN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        15. sin-sumN/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        16. lift-sin.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        17. lower-fma.f64N/A

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      6. Applied rewrites61.1%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      7. Taylor expanded in lambda1 around -inf

        \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
      8. Applied rewrites61.1%

        \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
      9. Taylor expanded in lambda1 around 0

        \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot \frac{-1}{2}\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\frac{-1}{2} \cdot \phi_2\right), \cos \left(\frac{1}{2} \cdot \phi_1\right), \sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{-1}{2} \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}} \]
      10. Step-by-step derivation
        1. Applied rewrites61.5%

          \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \left(-\sin \left(0.5 \cdot \phi_2\right)\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)\right)}^{2}\right)}} \]

        if -7.6000000000000001e-6 < lambda2 < 2.9000000000000002e-6

        1. Initial program 80.2%

          \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-sin.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. lift-/.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          3. lift--.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. div-subN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. sin-diffN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          6. lower--.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          7. lower-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          8. lower-sin.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          9. div-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          10. metadata-evalN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          11. lower-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          12. lower-cos.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          13. div-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          14. metadata-evalN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          15. lower-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          16. lower-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          17. lower-cos.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          18. div-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          19. metadata-evalN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          20. lower-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          21. lower-sin.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          22. div-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          23. metadata-evalN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          24. lower-*.f6481.0

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        4. Applied rewrites81.0%

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        5. Step-by-step derivation
          1. lift-sin.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. lift-/.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          3. div-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. metadata-evalN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. *-commutativeN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          6. lift--.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          7. sub-negN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          8. distribute-rgt-inN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          9. lift-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          10. cancel-sign-sub-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          11. lift-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          12. lift-*.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          13. *-commutativeN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          14. cancel-sign-sub-invN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          15. sin-sumN/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          16. lift-sin.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          17. lower-fma.f64N/A

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        6. Applied rewrites97.8%

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
        7. Taylor expanded in lambda1 around -inf

          \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
        8. Applied rewrites97.8%

          \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
        9. Taylor expanded in lambda2 around 0

          \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot \frac{-1}{2}\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\frac{-1}{2} \cdot \phi_2\right), \cos \left(\frac{1}{2} \cdot \phi_1\right), \sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{-1}{2} \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}} \]
        10. Step-by-step derivation
          1. Applied rewrites97.8%

            \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot 0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \left(-\sin \left(0.5 \cdot \phi_2\right)\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)\right)}^{2}\right)}} \]
        11. Recombined 2 regimes into one program.
        12. Final simplification79.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_2 \leq -7.6 \cdot 10^{-6}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), \sin \left(\phi_1 \cdot 0.5\right), \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{elif}\;\lambda_2 \leq 2.9 \cdot 10^{-6}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot 0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), \sin \left(\phi_1 \cdot 0.5\right), \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), \sin \left(\phi_1 \cdot 0.5\right), \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \end{array} \]
        13. Add Preprocessing

        Alternative 3: 73.1% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ t_2 := \sin \left(\phi_2 \cdot -0.5\right)\\ t_3 := \cos \left(\phi_2 \cdot 0.5\right)\\ t_4 := \left(t\_0 \cdot t\_1\right) \cdot t\_0\\ t_5 := \sqrt{t\_4 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}\\ t_6 := \sin \left(\phi_2 \cdot 0.5\right)\\ t_7 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_8 := \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_7\\ t_9 := \cos \left(\phi_1 \cdot 0.5\right)\\ \mathbf{if}\;\lambda_1 \leq -0.0034:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_5}{\sqrt{1 - \mathsf{fma}\left(t\_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(t\_2, \cos \left(-0.5 \cdot \phi_1\right), t\_8\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\lambda_1 \leq 1.5 \cdot 10^{-8}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(t\_2, t\_9, t\_8\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(t\_3, t\_7, \left(-t\_6\right) \cdot t\_9\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_5}{\sqrt{1 - \left(t\_4 + {\left(t\_3 \cdot t\_7 - t\_6 \cdot t\_9\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
        (FPCore (R lambda1 lambda2 phi1 phi2)
         :precision binary64
         (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
                (t_1 (* (cos phi1) (cos phi2)))
                (t_2 (sin (* phi2 -0.5)))
                (t_3 (cos (* phi2 0.5)))
                (t_4 (* (* t_0 t_1) t_0))
                (t_5 (sqrt (+ t_4 (pow (sin (/ (- phi1 phi2) 2.0)) 2.0))))
                (t_6 (sin (* phi2 0.5)))
                (t_7 (sin (* phi1 0.5)))
                (t_8 (* (cos (* phi2 -0.5)) t_7))
                (t_9 (cos (* phi1 0.5))))
           (if (<= lambda1 -0.0034)
             (*
              (*
               (atan2
                t_5
                (sqrt
                 (-
                  1.0
                  (fma
                   t_1
                   (pow (sin (* lambda1 0.5)) 2.0)
                   (pow (fma t_2 (cos (* -0.5 phi1)) t_8) 2.0)))))
               2.0)
              R)
             (if (<= lambda1 1.5e-8)
               (*
                (atan2
                 (sqrt
                  (fma
                   t_1
                   (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0)
                   (pow (fma t_2 t_9 t_8) 2.0)))
                 (sqrt
                  (-
                   1.0
                   (fma
                    (* (pow (sin (* lambda2 -0.5)) 2.0) (cos phi2))
                    (cos phi1)
                    (pow (fma t_3 t_7 (* (- t_6) t_9)) 2.0)))))
                (* 2.0 R))
               (*
                (*
                 (atan2
                  t_5
                  (sqrt (- 1.0 (+ t_4 (pow (- (* t_3 t_7) (* t_6 t_9)) 2.0)))))
                 2.0)
                R)))))
        double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
        	double t_0 = sin(((lambda1 - lambda2) / 2.0));
        	double t_1 = cos(phi1) * cos(phi2);
        	double t_2 = sin((phi2 * -0.5));
        	double t_3 = cos((phi2 * 0.5));
        	double t_4 = (t_0 * t_1) * t_0;
        	double t_5 = sqrt((t_4 + pow(sin(((phi1 - phi2) / 2.0)), 2.0)));
        	double t_6 = sin((phi2 * 0.5));
        	double t_7 = sin((phi1 * 0.5));
        	double t_8 = cos((phi2 * -0.5)) * t_7;
        	double t_9 = cos((phi1 * 0.5));
        	double tmp;
        	if (lambda1 <= -0.0034) {
        		tmp = (atan2(t_5, sqrt((1.0 - fma(t_1, pow(sin((lambda1 * 0.5)), 2.0), pow(fma(t_2, cos((-0.5 * phi1)), t_8), 2.0))))) * 2.0) * R;
        	} else if (lambda1 <= 1.5e-8) {
        		tmp = atan2(sqrt(fma(t_1, pow(sin(((lambda2 - lambda1) * -0.5)), 2.0), pow(fma(t_2, t_9, t_8), 2.0))), sqrt((1.0 - fma((pow(sin((lambda2 * -0.5)), 2.0) * cos(phi2)), cos(phi1), pow(fma(t_3, t_7, (-t_6 * t_9)), 2.0))))) * (2.0 * R);
        	} else {
        		tmp = (atan2(t_5, sqrt((1.0 - (t_4 + pow(((t_3 * t_7) - (t_6 * t_9)), 2.0))))) * 2.0) * R;
        	}
        	return tmp;
        }
        
        function code(R, lambda1, lambda2, phi1, phi2)
        	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
        	t_1 = Float64(cos(phi1) * cos(phi2))
        	t_2 = sin(Float64(phi2 * -0.5))
        	t_3 = cos(Float64(phi2 * 0.5))
        	t_4 = Float64(Float64(t_0 * t_1) * t_0)
        	t_5 = sqrt(Float64(t_4 + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0)))
        	t_6 = sin(Float64(phi2 * 0.5))
        	t_7 = sin(Float64(phi1 * 0.5))
        	t_8 = Float64(cos(Float64(phi2 * -0.5)) * t_7)
        	t_9 = cos(Float64(phi1 * 0.5))
        	tmp = 0.0
        	if (lambda1 <= -0.0034)
        		tmp = Float64(Float64(atan(t_5, sqrt(Float64(1.0 - fma(t_1, (sin(Float64(lambda1 * 0.5)) ^ 2.0), (fma(t_2, cos(Float64(-0.5 * phi1)), t_8) ^ 2.0))))) * 2.0) * R);
        	elseif (lambda1 <= 1.5e-8)
        		tmp = Float64(atan(sqrt(fma(t_1, (sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0), (fma(t_2, t_9, t_8) ^ 2.0))), sqrt(Float64(1.0 - fma(Float64((sin(Float64(lambda2 * -0.5)) ^ 2.0) * cos(phi2)), cos(phi1), (fma(t_3, t_7, Float64(Float64(-t_6) * t_9)) ^ 2.0))))) * Float64(2.0 * R));
        	else
        		tmp = Float64(Float64(atan(t_5, sqrt(Float64(1.0 - Float64(t_4 + (Float64(Float64(t_3 * t_7) - Float64(t_6 * t_9)) ^ 2.0))))) * 2.0) * R);
        	end
        	return tmp
        end
        
        code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$0 * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(t$95$4 + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$8 = N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$7), $MachinePrecision]}, Block[{t$95$9 = N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[lambda1, -0.0034], N[(N[(N[ArcTan[t$95$5 / N[Sqrt[N[(1.0 - N[(t$95$1 * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(t$95$2 * N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision] + t$95$8), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[lambda1, 1.5e-8], N[(N[ArcTan[N[Sqrt[N[(t$95$1 * N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(t$95$2 * t$95$9 + t$95$8), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[(t$95$3 * t$95$7 + N[((-t$95$6) * t$95$9), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision], N[(N[(N[ArcTan[t$95$5 / N[Sqrt[N[(1.0 - N[(t$95$4 + N[Power[N[(N[(t$95$3 * t$95$7), $MachinePrecision] - N[(t$95$6 * t$95$9), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
        t_1 := \cos \phi_1 \cdot \cos \phi_2\\
        t_2 := \sin \left(\phi_2 \cdot -0.5\right)\\
        t_3 := \cos \left(\phi_2 \cdot 0.5\right)\\
        t_4 := \left(t\_0 \cdot t\_1\right) \cdot t\_0\\
        t_5 := \sqrt{t\_4 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}\\
        t_6 := \sin \left(\phi_2 \cdot 0.5\right)\\
        t_7 := \sin \left(\phi_1 \cdot 0.5\right)\\
        t_8 := \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_7\\
        t_9 := \cos \left(\phi_1 \cdot 0.5\right)\\
        \mathbf{if}\;\lambda_1 \leq -0.0034:\\
        \;\;\;\;\left(\tan^{-1}_* \frac{t\_5}{\sqrt{1 - \mathsf{fma}\left(t\_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(t\_2, \cos \left(-0.5 \cdot \phi_1\right), t\_8\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
        
        \mathbf{elif}\;\lambda_1 \leq 1.5 \cdot 10^{-8}:\\
        \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(t\_2, t\_9, t\_8\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(t\_3, t\_7, \left(-t\_6\right) \cdot t\_9\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\tan^{-1}_* \frac{t\_5}{\sqrt{1 - \left(t\_4 + {\left(t\_3 \cdot t\_7 - t\_6 \cdot t\_9\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if lambda1 < -0.00339999999999999981

          1. Initial program 52.4%

            \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. div-subN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. sin-diffN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lower--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            18. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            19. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            20. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            21. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            22. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            23. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            24. lower-*.f6453.0

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. Applied rewrites53.0%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. Taylor expanded in lambda2 around 0

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}}\right) \]
          6. Applied rewrites53.2%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(\phi_1 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right)\right)\right)}^{2}\right)}}}\right) \]

          if -0.00339999999999999981 < lambda1 < 1.49999999999999987e-8

          1. Initial program 79.8%

            \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. div-subN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. sin-diffN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lower--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            18. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            19. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            20. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            21. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            22. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            23. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            24. lower-*.f6480.6

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. Applied rewrites80.6%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. sub-negN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. distribute-rgt-inN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. sin-sumN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-fma.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          6. Applied rewrites97.4%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          7. Taylor expanded in lambda1 around -inf

            \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
          8. Applied rewrites97.4%

            \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
          9. Taylor expanded in lambda1 around 0

            \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot \frac{-1}{2}\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\frac{-1}{2} \cdot \phi_2\right), \cos \left(\frac{1}{2} \cdot \phi_1\right), \sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{-1}{2} \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}} \]
          10. Step-by-step derivation
            1. Applied rewrites97.5%

              \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \left(-\sin \left(0.5 \cdot \phi_2\right)\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)\right)}^{2}\right)}} \]

            if 1.49999999999999987e-8 < lambda1

            1. Initial program 50.2%

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              3. lift--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              4. div-subN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              5. sin-diffN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              6. lower--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              7. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              8. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              9. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              10. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              11. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              12. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              13. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              14. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              15. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              16. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              17. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              18. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              19. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              20. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              21. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              22. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              23. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              24. lower-*.f6450.9

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. Applied rewrites50.9%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          11. Recombined 3 regimes into one program.
          12. Final simplification74.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 \leq -0.0034:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\lambda_1 \leq 1.5 \cdot 10^{-8}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\cos \left(\phi_2 \cdot 0.5\right), \sin \left(\phi_1 \cdot 0.5\right), \left(-\sin \left(\phi_2 \cdot 0.5\right)\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \left(\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
          13. Add Preprocessing

          Alternative 4: 78.7% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_1 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\ t_2 := \sin \left(\phi_1 \cdot 0.5\right)\\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_1, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_0, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_2\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_1 \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot t\_2 - \sin \left(\phi_2 \cdot 0.5\right) \cdot t\_0\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
          (FPCore (R lambda1 lambda2 phi1 phi2)
           :precision binary64
           (let* ((t_0 (cos (* phi1 0.5)))
                  (t_1 (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0))
                  (t_2 (sin (* phi1 0.5))))
             (*
              (atan2
               (sqrt
                (fma
                 (* (cos phi1) (cos phi2))
                 t_1
                 (pow (fma (sin (* phi2 -0.5)) t_0 (* (cos (* phi2 -0.5)) t_2)) 2.0)))
               (sqrt
                (-
                 1.0
                 (fma
                  (* t_1 (cos phi2))
                  (cos phi1)
                  (pow (- (* (cos (* phi2 0.5)) t_2) (* (sin (* phi2 0.5)) t_0)) 2.0)))))
              (* 2.0 R))))
          double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
          	double t_0 = cos((phi1 * 0.5));
          	double t_1 = pow(sin(((lambda2 - lambda1) * -0.5)), 2.0);
          	double t_2 = sin((phi1 * 0.5));
          	return atan2(sqrt(fma((cos(phi1) * cos(phi2)), t_1, pow(fma(sin((phi2 * -0.5)), t_0, (cos((phi2 * -0.5)) * t_2)), 2.0))), sqrt((1.0 - fma((t_1 * cos(phi2)), cos(phi1), pow(((cos((phi2 * 0.5)) * t_2) - (sin((phi2 * 0.5)) * t_0)), 2.0))))) * (2.0 * R);
          }
          
          function code(R, lambda1, lambda2, phi1, phi2)
          	t_0 = cos(Float64(phi1 * 0.5))
          	t_1 = sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0
          	t_2 = sin(Float64(phi1 * 0.5))
          	return Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), t_1, (fma(sin(Float64(phi2 * -0.5)), t_0, Float64(cos(Float64(phi2 * -0.5)) * t_2)) ^ 2.0))), sqrt(Float64(1.0 - fma(Float64(t_1 * cos(phi2)), cos(phi1), (Float64(Float64(cos(Float64(phi2 * 0.5)) * t_2) - Float64(sin(Float64(phi2 * 0.5)) * t_0)) ^ 2.0))))) * Float64(2.0 * R))
          end
          
          code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$1 + N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$0 + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(t$95$1 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[(N[(N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision] - N[(N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \cos \left(\phi_1 \cdot 0.5\right)\\
          t_1 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\
          t_2 := \sin \left(\phi_1 \cdot 0.5\right)\\
          \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_1, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), t\_0, \cos \left(\phi_2 \cdot -0.5\right) \cdot t\_2\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_1 \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot t\_2 - \sin \left(\phi_2 \cdot 0.5\right) \cdot t\_0\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)
          \end{array}
          \end{array}
          
          Derivation
          1. Initial program 65.5%

            \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. div-subN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. sin-diffN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lower--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            18. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            19. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            20. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            21. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            22. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            23. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            24. lower-*.f6466.2

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. Applied rewrites66.2%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. sub-negN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. distribute-rgt-inN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. sin-sumN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-fma.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          6. Applied rewrites79.1%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          7. Taylor expanded in lambda1 around -inf

            \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
          8. Applied rewrites79.2%

            \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
          9. Final simplification79.2%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(\phi_2 \cdot 0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \]
          10. Add Preprocessing

          Alternative 5: 78.7% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\\ t_1 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_1, t\_0\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_1 \cdot \cos \phi_2, \cos \phi_1, t\_0\right)}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
          (FPCore (R lambda1 lambda2 phi1 phi2)
           :precision binary64
           (let* ((t_0
                   (pow
                    (fma
                     (sin (* phi2 -0.5))
                     (cos (* phi1 0.5))
                     (* (cos (* phi2 -0.5)) (sin (* phi1 0.5))))
                    2.0))
                  (t_1 (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0)))
             (*
              (atan2
               (sqrt (fma (* (cos phi1) (cos phi2)) t_1 t_0))
               (sqrt (- 1.0 (fma (* t_1 (cos phi2)) (cos phi1) t_0))))
              (* 2.0 R))))
          double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
          	double t_0 = pow(fma(sin((phi2 * -0.5)), cos((phi1 * 0.5)), (cos((phi2 * -0.5)) * sin((phi1 * 0.5)))), 2.0);
          	double t_1 = pow(sin(((lambda2 - lambda1) * -0.5)), 2.0);
          	return atan2(sqrt(fma((cos(phi1) * cos(phi2)), t_1, t_0)), sqrt((1.0 - fma((t_1 * cos(phi2)), cos(phi1), t_0)))) * (2.0 * R);
          }
          
          function code(R, lambda1, lambda2, phi1, phi2)
          	t_0 = fma(sin(Float64(phi2 * -0.5)), cos(Float64(phi1 * 0.5)), Float64(cos(Float64(phi2 * -0.5)) * sin(Float64(phi1 * 0.5)))) ^ 2.0
          	t_1 = sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0
          	return Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), t_1, t_0)), sqrt(Float64(1.0 - fma(Float64(t_1 * cos(phi2)), cos(phi1), t_0)))) * Float64(2.0 * R))
          end
          
          code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(t$95$1 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\\
          t_1 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\
          \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_1, t\_0\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_1 \cdot \cos \phi_2, \cos \phi_1, t\_0\right)}} \cdot \left(2 \cdot R\right)
          \end{array}
          \end{array}
          
          Derivation
          1. Initial program 65.5%

            \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. div-subN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. sin-diffN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lower--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-cos.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            18. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            19. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            20. lower-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            21. lower-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            22. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            23. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            24. lower-*.f6466.2

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          4. Applied rewrites66.2%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          5. Step-by-step derivation
            1. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. lift-/.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            3. div-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. metadata-evalN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. lift--.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. sub-negN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            8. distribute-rgt-inN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            9. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            10. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            11. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            12. lift-*.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            13. *-commutativeN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            14. cancel-sign-sub-invN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            15. sin-sumN/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            16. lift-sin.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            17. lower-fma.f64N/A

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          6. Applied rewrites79.1%

            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
          7. Taylor expanded in lambda1 around -inf

            \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
          8. Applied rewrites79.2%

            \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
          9. Step-by-step derivation
            1. Applied rewrites79.2%

              \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \]
            2. Final simplification79.2%

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \]
            3. Add Preprocessing

            Alternative 6: 63.7% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \phi_1 \cdot \cos \phi_2\\ t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, t\_1, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, t\_1, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (* (cos phi1) (cos phi2)))
                    (t_1 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)))
               (*
                (*
                 (atan2
                  (sqrt (fma t_0 t_1 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                  (sqrt
                   (-
                    1.0
                    (fma
                     t_0
                     t_1
                     (pow
                      (fma
                       (sin (* phi2 -0.5))
                       (cos (* -0.5 phi1))
                       (* (cos (* phi2 -0.5)) (sin (* phi1 0.5))))
                      2.0)))))
                 2.0)
                R)))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = cos(phi1) * cos(phi2);
            	double t_1 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
            	return (atan2(sqrt(fma(t_0, t_1, pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((1.0 - fma(t_0, t_1, pow(fma(sin((phi2 * -0.5)), cos((-0.5 * phi1)), (cos((phi2 * -0.5)) * sin((phi1 * 0.5)))), 2.0))))) * 2.0) * R;
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = Float64(cos(phi1) * cos(phi2))
            	t_1 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
            	return Float64(Float64(atan(sqrt(fma(t_0, t_1, (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64(1.0 - fma(t_0, t_1, (fma(sin(Float64(phi2 * -0.5)), cos(Float64(-0.5 * phi1)), Float64(cos(Float64(phi2 * -0.5)) * sin(Float64(phi1 * 0.5)))) ^ 2.0))))) * 2.0) * R)
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * t$95$1 + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * t$95$1 + N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \cos \phi_1 \cdot \cos \phi_2\\
            t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
            \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, t\_1, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, t\_1, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 65.5%

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              3. lift--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              4. div-subN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              5. sin-diffN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              6. lower--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              7. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              8. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              9. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              10. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              11. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              12. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              13. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              14. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              15. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              16. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              17. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              18. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              19. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              20. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              21. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              22. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              23. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              24. lower-*.f6466.2

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. Applied rewrites66.2%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. Taylor expanded in lambda1 around 0

              \[\leadsto R \cdot \color{blue}{\left(2 \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
            6. Applied rewrites66.2%

              \[\leadsto R \cdot \color{blue}{\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(\phi_1 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right)\right)\right)}^{2}\right)}} \cdot 2\right)} \]
            7. Final simplification66.2%

              \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
            8. Add Preprocessing

            Alternative 7: 63.6% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_0, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0 \cdot \cos \phi_2, \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (pow (sin (* (- lambda2 lambda1) -0.5)) 2.0)))
               (*
                (atan2
                 (sqrt
                  (fma
                   (* (cos phi1) (cos phi2))
                   t_0
                   (pow
                    (fma
                     (sin (* phi2 -0.5))
                     (cos (* phi1 0.5))
                     (* (cos (* phi2 -0.5)) (sin (* phi1 0.5))))
                    2.0)))
                 (sqrt
                  (-
                   1.0
                   (fma
                    (* t_0 (cos phi2))
                    (cos phi1)
                    (- 0.5 (* (cos (* (* (- phi1 phi2) 0.5) 2.0)) 0.5))))))
                (* 2.0 R))))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = pow(sin(((lambda2 - lambda1) * -0.5)), 2.0);
            	return atan2(sqrt(fma((cos(phi1) * cos(phi2)), t_0, pow(fma(sin((phi2 * -0.5)), cos((phi1 * 0.5)), (cos((phi2 * -0.5)) * sin((phi1 * 0.5)))), 2.0))), sqrt((1.0 - fma((t_0 * cos(phi2)), cos(phi1), (0.5 - (cos((((phi1 - phi2) * 0.5) * 2.0)) * 0.5)))))) * (2.0 * R);
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = sin(Float64(Float64(lambda2 - lambda1) * -0.5)) ^ 2.0
            	return Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), t_0, (fma(sin(Float64(phi2 * -0.5)), cos(Float64(phi1 * 0.5)), Float64(cos(Float64(phi2 * -0.5)) * sin(Float64(phi1 * 0.5)))) ^ 2.0))), sqrt(Float64(1.0 - fma(Float64(t_0 * cos(phi2)), cos(phi1), Float64(0.5 - Float64(cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0)) * 0.5)))))) * Float64(2.0 * R))
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda2 - lambda1), $MachinePrecision] * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$0 + N[Power[N[(N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(t$95$0 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[(0.5 - N[(N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}\\
            \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t\_0, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0 \cdot \cos \phi_2, \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}} \cdot \left(2 \cdot R\right)
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 65.5%

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              3. lift--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\color{blue}{\phi_1 - \phi_2}}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              4. div-subN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \color{blue}{\left(\frac{\phi_1}{2} - \frac{\phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              5. sin-diffN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              6. lower--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              7. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              8. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              9. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              10. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              11. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              12. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\phi_2}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              13. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              14. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              15. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              16. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              17. lower-cos.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              18. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              19. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              20. lower-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              21. lower-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\phi_2}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              22. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              23. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              24. lower-*.f6466.2

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \color{blue}{\left(\phi_2 \cdot 0.5\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. Applied rewrites66.2%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\color{blue}{\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. Step-by-step derivation
              1. lift-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              3. div-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              4. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              5. *-commutativeN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              6. lift--.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              7. sub-negN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              8. distribute-rgt-inN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              9. lift-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\phi_1 \cdot \frac{1}{2}} + \left(\mathsf{neg}\left(\phi_2\right)\right) \cdot \frac{1}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              10. cancel-sign-sub-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} - \phi_2 \cdot \frac{1}{2}\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              11. lift-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              12. lift-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\phi_2 \cdot \frac{1}{2}}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              13. *-commutativeN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot \frac{1}{2} - \color{blue}{\frac{1}{2} \cdot \phi_2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              14. cancel-sign-sub-invN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              15. sin-sumN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              16. lift-sin.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\color{blue}{\sin \left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right) + \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              17. lower-fma.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            6. Applied rewrites79.1%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right) \cdot \sin \left(-0.5 \cdot \phi_2\right)\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            7. Taylor expanded in lambda1 around -inf

              \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) + \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \left(\lambda_2 + -1 \cdot \lambda_1\right)\right)}^{2}\right) + {\left(\cos \left(\frac{1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right) - \cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_2\right)\right)}^{2}\right)}}\right)} \]
            8. Applied rewrites79.2%

              \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}^{2}\right)}}} \]
            9. Applied rewrites66.1%

              \[\leadsto \left(2 \cdot R\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_1\right) \cdot \cos \left(-0.5 \cdot \phi_2\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)\right)\right)}} \]
            10. Final simplification66.1%

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2}, {\left(\mathsf{fma}\left(\sin \left(\phi_2 \cdot -0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_2 \cdot -0.5\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_2 - \lambda_1\right) \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}} \cdot \left(2 \cdot R\right) \]
            11. Add Preprocessing

            Alternative 8: 63.3% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\right) \cdot 2\right)}{4}}} \cdot 2\right) \cdot R \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0))))
               (*
                (*
                 (atan2
                  (sqrt
                   (+
                    (* (* t_0 (* (cos phi1) (cos phi2))) t_0)
                    (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                  (sqrt
                   (-
                    1.0
                    (/
                     (fma
                      (-
                       (cos (/ 0.0 (/ 2.0 (- phi1 phi2))))
                       (cos (* (* (- phi1 phi2) 0.5) 2.0)))
                      2.0
                      (*
                       (*
                        (+ (cos (+ phi2 phi1)) (cos (- phi1 phi2)))
                        (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                       2.0))
                     4.0))))
                 2.0)
                R)))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = sin(((lambda1 - lambda2) / 2.0));
            	return (atan2(sqrt((((t_0 * (cos(phi1) * cos(phi2))) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((1.0 - (fma((cos((0.0 / (2.0 / (phi1 - phi2)))) - cos((((phi1 - phi2) * 0.5) * 2.0))), 2.0, (((cos((phi2 + phi1)) + cos((phi1 - phi2))) * pow(sin(((lambda1 - lambda2) * 0.5)), 2.0)) * 2.0)) / 4.0)))) * 2.0) * R;
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
            	return Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64(1.0 - Float64(fma(Float64(cos(Float64(0.0 / Float64(2.0 / Float64(phi1 - phi2)))) - cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0))), 2.0, Float64(Float64(Float64(cos(Float64(phi2 + phi1)) + cos(Float64(phi1 - phi2))) * (sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0)) * 2.0)) / 4.0)))) * 2.0) * R)
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[(N[Cos[N[(0.0 / N[(2.0 / N[(phi1 - phi2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0 + N[(N[(N[(N[Cos[N[(phi2 + phi1), $MachinePrecision]], $MachinePrecision] + N[Cos[N[(phi1 - phi2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
            \left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\right) \cdot 2\right)}{4}}} \cdot 2\right) \cdot R
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 65.5%

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. Add Preprocessing
            3. Applied rewrites65.6%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right), 2, 2 \cdot \left(\left(\cos \left(\phi_1 - \phi_2\right) + \cos \left(\phi_2 + \phi_1\right)\right) \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}{4}}}}\right) \]
            4. Final simplification65.6%

              \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\right) \cdot 2\right)}{4}}} \cdot 2\right) \cdot R \]
            5. Add Preprocessing

            Alternative 9: 62.7% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ t_2 := \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, t\_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot t\_1\right)}}{\sqrt{1 - \left(\left(t\_0 \cdot t\_1\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
                    (t_1 (* (cos phi1) (cos phi2)))
                    (t_2 (sin (* (- phi1 phi2) 0.5))))
               (*
                (*
                 (atan2
                  (sqrt (fma t_2 t_2 (* (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0) t_1)))
                  (sqrt
                   (- 1.0 (+ (* (* t_0 t_1) t_0) (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))))
                 2.0)
                R)))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = sin(((lambda1 - lambda2) / 2.0));
            	double t_1 = cos(phi1) * cos(phi2);
            	double t_2 = sin(((phi1 - phi2) * 0.5));
            	return (atan2(sqrt(fma(t_2, t_2, (pow(sin(((lambda1 - lambda2) * 0.5)), 2.0) * t_1))), sqrt((1.0 - (((t_0 * t_1) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))))) * 2.0) * R;
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
            	t_1 = Float64(cos(phi1) * cos(phi2))
            	t_2 = sin(Float64(Float64(phi1 - phi2) * 0.5))
            	return Float64(Float64(atan(sqrt(fma(t_2, t_2, Float64((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0) * t_1))), sqrt(Float64(1.0 - Float64(Float64(Float64(t_0 * t_1) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))))) * 2.0) * R)
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(t$95$2 * t$95$2 + N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[(t$95$0 * t$95$1), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
            t_1 := \cos \phi_1 \cdot \cos \phi_2\\
            t_2 := \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)\\
            \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, t\_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot t\_1\right)}}{\sqrt{1 - \left(\left(t\_0 \cdot t\_1\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R
            \end{array}
            \end{array}
            
            Derivation
            1. Initial program 65.5%

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. lift-pow.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              3. unpow2N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\sin \left(\frac{\phi_1 - \phi_2}{2}\right) \cdot \sin \left(\frac{\phi_1 - \phi_2}{2}\right)} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              4. lower-fma.f6465.5

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\sin \left(\frac{\phi_1 - \phi_2}{2}\right), \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              5. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}, \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              6. clear-numN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \phi_2}}\right)}, \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              7. associate-/r/N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}, \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              8. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\color{blue}{\frac{1}{2}} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              9. lower-*.f6465.5

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \color{blue}{\left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}, \sin \left(\frac{\phi_1 - \phi_2}{2}\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              10. lift-/.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \color{blue}{\left(\frac{\phi_1 - \phi_2}{2}\right)}, \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              11. clear-numN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \phi_2}}\right)}, \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              12. associate-/r/N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \color{blue}{\left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}, \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              13. metadata-evalN/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \left(\color{blue}{\frac{1}{2}} \cdot \left(\phi_1 - \phi_2\right)\right), \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              14. lower-*.f6465.5

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right), \sin \color{blue}{\left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}, \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              15. lift-*.f64N/A

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right), \color{blue}{\left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            4. Applied rewrites65.5%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right), \sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right), {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
            5. Final simplification65.5%

              \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right), \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right), {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right)}}{\sqrt{1 - \left(\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
            6. Add Preprocessing

            Alternative 10: 53.8% accurate, 1.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)\\ t_2 := \sqrt{t\_1}\\ t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;t\_3 \leq -0.02:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_2}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-7}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_3 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_3 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_2}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                    (t_1 (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))
                    (t_2 (sqrt t_1))
                    (t_3 (sin (/ (- lambda1 lambda2) 2.0))))
               (if (<= t_3 -0.02)
                 (*
                  (*
                   (atan2 t_2 (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_0 (cos phi1)))))
                   2.0)
                  R)
                 (if (<= t_3 2e-7)
                   (*
                    (*
                     (atan2
                      (sqrt
                       (+
                        (* (* t_3 (* (cos phi1) (cos phi2))) t_3)
                        (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                      (sqrt (- 1.0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))))
                     2.0)
                    R)
                   (* (* (atan2 t_2 (sqrt (- 1.0 t_1))) 2.0) R)))))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
            	double t_1 = fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0));
            	double t_2 = sqrt(t_1);
            	double t_3 = sin(((lambda1 - lambda2) / 2.0));
            	double tmp;
            	if (t_3 <= -0.02) {
            		tmp = (atan2(t_2, sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_0 * cos(phi1))))) * 2.0) * R;
            	} else if (t_3 <= 2e-7) {
            		tmp = (atan2(sqrt((((t_3 * (cos(phi1) * cos(phi2))) * t_3) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((1.0 - pow(sin(((phi1 - phi2) * 0.5)), 2.0)))) * 2.0) * R;
            	} else {
            		tmp = (atan2(t_2, sqrt((1.0 - t_1))) * 2.0) * R;
            	}
            	return tmp;
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
            	t_1 = fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))
            	t_2 = sqrt(t_1)
            	t_3 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
            	tmp = 0.0
            	if (t_3 <= -0.02)
            		tmp = Float64(Float64(atan(t_2, sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_0 * cos(phi1))))) * 2.0) * R);
            	elseif (t_3 <= 2e-7)
            		tmp = Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_3 * Float64(cos(phi1) * cos(phi2))) * t_3) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64(1.0 - (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)))) * 2.0) * R);
            	else
            		tmp = Float64(Float64(atan(t_2, sqrt(Float64(1.0 - t_1))) * 2.0) * R);
            	end
            	return tmp
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, -0.02], N[(N[(N[ArcTan[t$95$2 / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[t$95$3, 2e-7], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$3 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[t$95$2 / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
            t_1 := \mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)\\
            t_2 := \sqrt{t\_1}\\
            t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
            \mathbf{if}\;t\_3 \leq -0.02:\\
            \;\;\;\;\left(\tan^{-1}_* \frac{t\_2}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
            
            \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-7}:\\
            \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_3 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_3 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(\tan^{-1}_* \frac{t\_2}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))) < -0.0200000000000000004

              1. Initial program 54.9%

                \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in phi2 around 0

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                2. associate--r+N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                3. unpow2N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                4. 1-sub-sinN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                5. unpow2N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                6. lower--.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                7. lower-pow.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                8. metadata-evalN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                9. distribute-lft-neg-inN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                10. cos-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                11. lower-cos.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                13. lower-*.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                14. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
              5. Applied rewrites43.0%

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
              6. Taylor expanded in phi2 around 0

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
              7. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                2. lower-fma.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                3. sub-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                4. mul-1-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                5. lower-pow.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                6. lower-sin.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                7. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                8. lower-*.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                9. mul-1-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                10. sub-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                11. lower--.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                12. lower-cos.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                13. lower-pow.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                14. lower-sin.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                15. lower-*.f6443.5

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
              8. Applied rewrites43.5%

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]

              if -0.0200000000000000004 < (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))) < 1.9999999999999999e-7

              1. Initial program 81.6%

                \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in phi2 around 0

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                2. associate--r+N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                3. unpow2N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                4. 1-sub-sinN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                5. unpow2N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                6. lower--.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                7. lower-pow.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                8. metadata-evalN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                9. distribute-lft-neg-inN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                10. cos-negN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                11. lower-cos.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                12. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                13. lower-*.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                14. *-commutativeN/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                15. lower-*.f64N/A

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
              5. Applied rewrites68.4%

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
              6. Taylor expanded in lambda1 around 0

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 + -1 \cdot \left(\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right)\right)\right) - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
              7. Applied rewrites81.5%

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\mathsf{fma}\left(\lambda_1 \cdot \left(-\cos \phi_1\right), \left(\cos \phi_2 \cdot \sin \left(\lambda_2 \cdot -0.5\right)\right) \cdot \cos \left(0.5 \cdot \lambda_2\right), 1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}\right) \]
              8. Taylor expanded in lambda2 around 0

                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}\right) \]
              9. Step-by-step derivation
                1. Applied rewrites81.5%

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}}\right) \]

                if 1.9999999999999999e-7 < (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))

                1. Initial program 64.9%

                  \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in lambda1 around 0

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. associate-*r*N/A

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  3. associate-*r*N/A

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  4. lower-fma.f64N/A

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                5. Applied rewrites36.7%

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                6. Taylor expanded in lambda2 around 0

                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites16.8%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    3. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    4. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    5. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    6. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    7. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    9. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    10. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    11. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    12. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    13. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                    14. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                    15. lower-*.f6416.4

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                  4. Applied rewrites16.4%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  5. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                  6. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    3. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    4. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    5. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    6. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    7. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    9. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    10. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    11. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    12. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    13. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    14. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                    15. lower-*.f6449.9

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]
                  7. Applied rewrites49.9%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]
                8. Recombined 3 regimes into one program.
                9. Final simplification55.2%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \leq -0.02:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \leq 2 \cdot 10^{-7}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                10. Add Preprocessing

                Alternative 11: 53.8% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{if}\;t\_1 \leq -0.02:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_1 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_1 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                (FPCore (R lambda1 lambda2 phi1 phi2)
                 :precision binary64
                 (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                        (t_1 (sin (/ (- lambda1 lambda2) 2.0)))
                        (t_2
                         (*
                          (*
                           (atan2
                            (sqrt (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_0 (cos phi1)))))
                           2.0)
                          R)))
                   (if (<= t_1 -0.02)
                     t_2
                     (if (<= t_1 2e-7)
                       (*
                        (*
                         (atan2
                          (sqrt
                           (+
                            (* (* t_1 (* (cos phi1) (cos phi2))) t_1)
                            (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                          (sqrt (- 1.0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))))
                         2.0)
                        R)
                       t_2))))
                double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                	double t_1 = sin(((lambda1 - lambda2) / 2.0));
                	double t_2 = (atan2(sqrt(fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))), sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_0 * cos(phi1))))) * 2.0) * R;
                	double tmp;
                	if (t_1 <= -0.02) {
                		tmp = t_2;
                	} else if (t_1 <= 2e-7) {
                		tmp = (atan2(sqrt((((t_1 * (cos(phi1) * cos(phi2))) * t_1) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((1.0 - pow(sin(((phi1 - phi2) * 0.5)), 2.0)))) * 2.0) * R;
                	} else {
                		tmp = t_2;
                	}
                	return tmp;
                }
                
                function code(R, lambda1, lambda2, phi1, phi2)
                	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                	t_1 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                	t_2 = Float64(Float64(atan(sqrt(fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_0 * cos(phi1))))) * 2.0) * R)
                	tmp = 0.0
                	if (t_1 <= -0.02)
                		tmp = t_2;
                	elseif (t_1 <= 2e-7)
                		tmp = Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_1 * Float64(cos(phi1) * cos(phi2))) * t_1) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64(1.0 - (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)))) * 2.0) * R);
                	else
                		tmp = t_2;
                	end
                	return tmp
                end
                
                code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[t$95$1, -0.02], t$95$2, If[LessEqual[t$95$1, 2e-7], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$1 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$2]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                \mathbf{if}\;t\_1 \leq -0.02:\\
                \;\;\;\;t\_2\\
                
                \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-7}:\\
                \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_1 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_1 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_2\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))) < -0.0200000000000000004 or 1.9999999999999999e-7 < (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))

                  1. Initial program 60.5%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                    2. associate--r+N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    3. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    4. 1-sub-sinN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    5. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    6. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    8. metadata-evalN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    9. distribute-lft-neg-inN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    10. cos-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    11. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    12. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    13. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    14. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    15. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  5. Applied rewrites47.2%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  6. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  7. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    3. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    4. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    5. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    6. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    9. mul-1-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    10. sub-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    11. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    12. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    13. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    14. lower-sin.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    15. lower-*.f6447.1

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  8. Applied rewrites47.1%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]

                  if -0.0200000000000000004 < (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))) < 1.9999999999999999e-7

                  1. Initial program 81.6%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                    2. associate--r+N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    3. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    4. 1-sub-sinN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    5. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    6. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    8. metadata-evalN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    9. distribute-lft-neg-inN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    10. cos-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    11. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    12. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    13. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    14. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    15. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  5. Applied rewrites68.4%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  6. Taylor expanded in lambda1 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 + -1 \cdot \left(\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right)\right)\right) - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
                  7. Applied rewrites81.5%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\mathsf{fma}\left(\lambda_1 \cdot \left(-\cos \phi_1\right), \left(\cos \phi_2 \cdot \sin \left(\lambda_2 \cdot -0.5\right)\right) \cdot \cos \left(0.5 \cdot \lambda_2\right), 1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}\right) \]
                  8. Taylor expanded in lambda2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}\right) \]
                  9. Step-by-step derivation
                    1. Applied rewrites81.5%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}}\right) \]
                  10. Recombined 2 regimes into one program.
                  11. Final simplification55.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \leq -0.02:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \leq 2 \cdot 10^{-7}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \]
                  12. Add Preprocessing

                  Alternative 12: 62.8% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \phi_1 \cdot \cos \phi_2\\ t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, t\_0, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - t\_1 \cdot t\_0}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (* (cos phi1) (cos phi2)))
                          (t_1 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)))
                     (*
                      (atan2
                       (sqrt (fma t_1 t_0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                       (sqrt (- (pow (cos (/ (- phi1 phi2) -2.0)) 2.0) (* t_1 t_0))))
                      (* 2.0 R))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = cos(phi1) * cos(phi2);
                  	double t_1 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	return atan2(sqrt(fma(t_1, t_0, pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((pow(cos(((phi1 - phi2) / -2.0)), 2.0) - (t_1 * t_0)))) * (2.0 * R);
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = Float64(cos(phi1) * cos(phi2))
                  	t_1 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	return Float64(atan(sqrt(fma(t_1, t_0, (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64((cos(Float64(Float64(phi1 - phi2) / -2.0)) ^ 2.0) - Float64(t_1 * t_0)))) * Float64(2.0 * R))
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[N[(t$95$1 * t$95$0 + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(N[(phi1 - phi2), $MachinePrecision] / -2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \cos \phi_1 \cdot \cos \phi_2\\
                  t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, t\_0, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - t\_1 \cdot t\_0}} \cdot \left(2 \cdot R\right)
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Initial program 65.5%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Add Preprocessing
                  3. Applied rewrites65.5%

                    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
                  4. Final simplification65.5%

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)}} \cdot \left(2 \cdot R\right) \]
                  5. Add Preprocessing

                  Alternative 13: 62.7% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\\ \tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - t\_0}} \cdot \left(2 \cdot R\right) \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0
                           (fma
                            (* (cos phi1) (cos phi2))
                            (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
                            (pow (sin (* (- phi1 phi2) 0.5)) 2.0))))
                     (* (atan2 (sqrt t_0) (sqrt (- 1.0 t_0))) (* 2.0 R))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = fma((cos(phi1) * cos(phi2)), pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), pow(sin(((phi1 - phi2) * 0.5)), 2.0));
                  	return atan2(sqrt(t_0), sqrt((1.0 - t_0))) * (2.0 * R);
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))
                  	return Float64(atan(sqrt(t_0), sqrt(Float64(1.0 - t_0))) * Float64(2.0 * R))
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[(N[ArcTan[N[Sqrt[t$95$0], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\\
                  \tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - t\_0}} \cdot \left(2 \cdot R\right)
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Initial program 65.5%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in lambda1 around 0

                    \[\leadsto \color{blue}{2 \cdot \left(R \cdot \tan^{-1}_* \frac{\sqrt{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right)} \]
                  4. Applied rewrites65.5%

                    \[\leadsto \color{blue}{\left(R \cdot 2\right) \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}} \]
                  5. Final simplification65.5%

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot \left(2 \cdot R\right) \]
                  6. Add Preprocessing

                  Alternative 14: 63.5% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}\\ t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;\phi_1 \leq -6.5 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot t\_0\right) \cdot 2\right)}{4}}}{t\_1} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_2 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_2 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{t\_1} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_1 (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_0 (cos phi1)))))
                          (t_2 (sin (/ (- lambda1 lambda2) 2.0))))
                     (if (<= phi1 -6.5e-5)
                       (*
                        (*
                         (atan2
                          (sqrt
                           (/
                            (fma
                             (-
                              (cos (/ 0.0 (/ 2.0 (- phi1 phi2))))
                              (cos (* (* (- phi1 phi2) 0.5) 2.0)))
                             2.0
                             (* (* (+ (cos (+ phi2 phi1)) (cos (- phi1 phi2))) t_0) 2.0))
                            4.0))
                          t_1)
                         2.0)
                        R)
                       (if (<= phi1 1.4e-5)
                         (*
                          (*
                           (atan2
                            (sqrt
                             (+
                              (* (* t_2 (* (cos phi1) (cos phi2))) t_2)
                              (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                            (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                           2.0)
                          R)
                         (*
                          (*
                           (atan2 (sqrt (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0))) t_1)
                           2.0)
                          R)))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_1 = sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_0 * cos(phi1))));
                  	double t_2 = sin(((lambda1 - lambda2) / 2.0));
                  	double tmp;
                  	if (phi1 <= -6.5e-5) {
                  		tmp = (atan2(sqrt((fma((cos((0.0 / (2.0 / (phi1 - phi2)))) - cos((((phi1 - phi2) * 0.5) * 2.0))), 2.0, (((cos((phi2 + phi1)) + cos((phi1 - phi2))) * t_0) * 2.0)) / 4.0)), t_1) * 2.0) * R;
                  	} else if (phi1 <= 1.4e-5) {
                  		tmp = (atan2(sqrt((((t_2 * (cos(phi1) * cos(phi2))) * t_2) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	} else {
                  		tmp = (atan2(sqrt(fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))), t_1) * 2.0) * R;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_1 = sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_0 * cos(phi1))))
                  	t_2 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                  	tmp = 0.0
                  	if (phi1 <= -6.5e-5)
                  		tmp = Float64(Float64(atan(sqrt(Float64(fma(Float64(cos(Float64(0.0 / Float64(2.0 / Float64(phi1 - phi2)))) - cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0))), 2.0, Float64(Float64(Float64(cos(Float64(phi2 + phi1)) + cos(Float64(phi1 - phi2))) * t_0) * 2.0)) / 4.0)), t_1) * 2.0) * R);
                  	elseif (phi1 <= 1.4e-5)
                  		tmp = Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_2 * Float64(cos(phi1) * cos(phi2))) * t_2) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R);
                  	else
                  		tmp = Float64(Float64(atan(sqrt(fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))), t_1) * 2.0) * R);
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi1, -6.5e-5], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(N[Cos[N[(0.0 / N[(2.0 / N[(phi1 - phi2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 2.0 + N[(N[(N[(N[Cos[N[(phi2 + phi1), $MachinePrecision]], $MachinePrecision] + N[Cos[N[(phi1 - phi2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / 4.0), $MachinePrecision]], $MachinePrecision] / t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[phi1, 1.4e-5], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$2 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_1 := \sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}\\
                  t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                  \mathbf{if}\;\phi_1 \leq -6.5 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot t\_0\right) \cdot 2\right)}{4}}}{t\_1} \cdot 2\right) \cdot R\\
                  
                  \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_2 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_2 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{t\_1} \cdot 2\right) \cdot R\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if phi1 < -6.49999999999999943e-5

                    1. Initial program 54.0%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites53.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Applied rewrites54.5%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right), 2, 2 \cdot \left(\left(\cos \left(\phi_1 - \phi_2\right) + \cos \left(\phi_2 + \phi_1\right)\right) \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}{4}}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]

                    if -6.49999999999999943e-5 < phi1 < 1.39999999999999998e-5

                    1. Initial program 74.7%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(\phi_2 \cdot \frac{-1}{2}\right)}}^{2}\right)}}\right) \]
                      16. lower-*.f6474.7

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(\phi_2 \cdot -0.5\right)}}^{2}\right)}}\right) \]
                    5. Applied rewrites74.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}}}\right) \]

                    if 1.39999999999999998e-5 < phi1

                    1. Initial program 57.9%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites58.6%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      15. lower-*.f6459.0

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. Applied rewrites59.0%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification65.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -6.5 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\frac{\mathsf{fma}\left(\cos \left(\frac{0}{\frac{2}{\phi_1 - \phi_2}}\right) - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right), 2, \left(\left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_1 - \phi_2\right)\right) \cdot {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\right) \cdot 2\right)}{4}}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 15: 63.3% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\ t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_3 := \sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}\\ \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - \mathsf{fma}\left(t\_2, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
                          (t_1
                           (+
                            (* (* t_0 (* (cos phi1) (cos phi2))) t_0)
                            (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                          (t_2 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_3 (sqrt (fma t_2 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))))
                     (if (<= phi1 -2.1e-5)
                       (* (* (atan2 t_3 (sqrt (- 1.0 t_1))) 2.0) R)
                       (if (<= phi1 1.4e-5)
                         (*
                          (*
                           (atan2
                            (sqrt t_1)
                            (sqrt (- 1.0 (fma t_2 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                           2.0)
                          R)
                         (*
                          (*
                           (atan2
                            t_3
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_2 (cos phi1)))))
                           2.0)
                          R)))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = sin(((lambda1 - lambda2) / 2.0));
                  	double t_1 = ((t_0 * (cos(phi1) * cos(phi2))) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0);
                  	double t_2 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_3 = sqrt(fma(t_2, cos(phi1), pow(sin((phi1 * 0.5)), 2.0)));
                  	double tmp;
                  	if (phi1 <= -2.1e-5) {
                  		tmp = (atan2(t_3, sqrt((1.0 - t_1))) * 2.0) * R;
                  	} else if (phi1 <= 1.4e-5) {
                  		tmp = (atan2(sqrt(t_1), sqrt((1.0 - fma(t_2, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	} else {
                  		tmp = (atan2(t_3, sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_2 * cos(phi1))))) * 2.0) * R;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                  	t_1 = Float64(Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))
                  	t_2 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_3 = sqrt(fma(t_2, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0)))
                  	tmp = 0.0
                  	if (phi1 <= -2.1e-5)
                  		tmp = Float64(Float64(atan(t_3, sqrt(Float64(1.0 - t_1))) * 2.0) * R);
                  	elseif (phi1 <= 1.4e-5)
                  		tmp = Float64(Float64(atan(sqrt(t_1), sqrt(Float64(1.0 - fma(t_2, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R);
                  	else
                  		tmp = Float64(Float64(atan(t_3, sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_2 * cos(phi1))))) * 2.0) * R);
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi1, -2.1e-5], N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[phi1, 1.4e-5], N[(N[(N[ArcTan[N[Sqrt[t$95$1], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$2 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$2 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                  t_1 := \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\
                  t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_3 := \sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}\\
                  \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - \mathsf{fma}\left(t\_2, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if phi1 < -2.09999999999999988e-5

                    1. Initial program 54.0%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      15. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      16. lower-*.f6454.4

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(\phi_1 \cdot 0.5\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites54.4%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]

                    if -2.09999999999999988e-5 < phi1 < 1.39999999999999998e-5

                    1. Initial program 74.7%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(\phi_2 \cdot \frac{-1}{2}\right)}}^{2}\right)}}\right) \]
                      16. lower-*.f6474.7

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(\phi_2 \cdot -0.5\right)}}^{2}\right)}}\right) \]
                    5. Applied rewrites74.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}}}\right) \]

                    if 1.39999999999999998e-5 < phi1

                    1. Initial program 57.9%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites58.6%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      15. lower-*.f6459.0

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. Applied rewrites59.0%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification65.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \left(\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 16: 63.3% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\ t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_3 := \sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}\\ \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - t\_2 \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
                          (t_1
                           (+
                            (* (* t_0 (* (cos phi1) (cos phi2))) t_0)
                            (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                          (t_2 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_3 (sqrt (fma t_2 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))))
                     (if (<= phi1 -2.1e-5)
                       (* (* (atan2 t_3 (sqrt (- 1.0 t_1))) 2.0) R)
                       (if (<= phi1 1.4e-5)
                         (*
                          (*
                           (atan2
                            (sqrt t_1)
                            (sqrt (- (pow (cos (* phi2 0.5)) 2.0) (* t_2 (cos phi2)))))
                           2.0)
                          R)
                         (*
                          (*
                           (atan2
                            t_3
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_2 (cos phi1)))))
                           2.0)
                          R)))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = sin(((lambda1 - lambda2) / 2.0));
                  	double t_1 = ((t_0 * (cos(phi1) * cos(phi2))) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0);
                  	double t_2 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_3 = sqrt(fma(t_2, cos(phi1), pow(sin((phi1 * 0.5)), 2.0)));
                  	double tmp;
                  	if (phi1 <= -2.1e-5) {
                  		tmp = (atan2(t_3, sqrt((1.0 - t_1))) * 2.0) * R;
                  	} else if (phi1 <= 1.4e-5) {
                  		tmp = (atan2(sqrt(t_1), sqrt((pow(cos((phi2 * 0.5)), 2.0) - (t_2 * cos(phi2))))) * 2.0) * R;
                  	} else {
                  		tmp = (atan2(t_3, sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_2 * cos(phi1))))) * 2.0) * R;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                  	t_1 = Float64(Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))
                  	t_2 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_3 = sqrt(fma(t_2, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0)))
                  	tmp = 0.0
                  	if (phi1 <= -2.1e-5)
                  		tmp = Float64(Float64(atan(t_3, sqrt(Float64(1.0 - t_1))) * 2.0) * R);
                  	elseif (phi1 <= 1.4e-5)
                  		tmp = Float64(Float64(atan(sqrt(t_1), sqrt(Float64((cos(Float64(phi2 * 0.5)) ^ 2.0) - Float64(t_2 * cos(phi2))))) * 2.0) * R);
                  	else
                  		tmp = Float64(Float64(atan(t_3, sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_2 * cos(phi1))))) * 2.0) * R);
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi1, -2.1e-5], N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[phi1, 1.4e-5], N[(N[(N[ArcTan[N[Sqrt[t$95$1], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$2 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$2 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                  t_1 := \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\
                  t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_3 := \sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}\\
                  \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - t\_2 \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if phi1 < -2.09999999999999988e-5

                    1. Initial program 54.0%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      15. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      16. lower-*.f6454.4

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(\phi_1 \cdot 0.5\right)}}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites54.4%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]

                    if -2.09999999999999988e-5 < phi1 < 1.39999999999999998e-5

                    1. Initial program 74.7%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2} + \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right) - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)}\right) - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \cos \left(\frac{-1}{2} \cdot \phi_2\right)} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \phi_2\right)}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \phi_2\right)\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_2\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_2\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_2 \cdot \frac{1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_2 \cdot \frac{1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2}}}\right) \]
                    5. Applied rewrites74.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2}}}\right) \]

                    if 1.39999999999999998e-5 < phi1

                    1. Initial program 57.9%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites58.6%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      15. lower-*.f6459.0

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. Applied rewrites59.0%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification65.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \left(\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 17: 63.5% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_1 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - t\_1 \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0)))
                          (t_1 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_2
                           (*
                            (*
                             (atan2
                              (sqrt (fma t_1 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))
                              (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_1 (cos phi1)))))
                             2.0)
                            R)))
                     (if (<= phi1 -2.1e-5)
                       t_2
                       (if (<= phi1 1.4e-5)
                         (*
                          (*
                           (atan2
                            (sqrt
                             (+
                              (* (* t_0 (* (cos phi1) (cos phi2))) t_0)
                              (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                            (sqrt (- (pow (cos (* phi2 0.5)) 2.0) (* t_1 (cos phi2)))))
                           2.0)
                          R)
                         t_2))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = sin(((lambda1 - lambda2) / 2.0));
                  	double t_1 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_2 = (atan2(sqrt(fma(t_1, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))), sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_1 * cos(phi1))))) * 2.0) * R;
                  	double tmp;
                  	if (phi1 <= -2.1e-5) {
                  		tmp = t_2;
                  	} else if (phi1 <= 1.4e-5) {
                  		tmp = (atan2(sqrt((((t_0 * (cos(phi1) * cos(phi2))) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((pow(cos((phi2 * 0.5)), 2.0) - (t_1 * cos(phi2))))) * 2.0) * R;
                  	} else {
                  		tmp = t_2;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                  	t_1 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_2 = Float64(Float64(atan(sqrt(fma(t_1, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_1 * cos(phi1))))) * 2.0) * R)
                  	tmp = 0.0
                  	if (phi1 <= -2.1e-5)
                  		tmp = t_2;
                  	elseif (phi1 <= 1.4e-5)
                  		tmp = Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64((cos(Float64(phi2 * 0.5)) ^ 2.0) - Float64(t_1 * cos(phi2))))) * 2.0) * R);
                  	else
                  		tmp = t_2;
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[ArcTan[N[Sqrt[N[(t$95$1 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$1 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi1, -2.1e-5], t$95$2, If[LessEqual[phi1, 1.4e-5], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$1 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$2]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                  t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_1 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                  \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\
                  \;\;\;\;t\_2\\
                  
                  \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - t\_1 \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_2\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if phi1 < -2.09999999999999988e-5 or 1.39999999999999998e-5 < phi1

                    1. Initial program 56.0%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites56.1%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      15. lower-*.f6456.7

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. Applied rewrites56.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]

                    if -2.09999999999999988e-5 < phi1 < 1.39999999999999998e-5

                    1. Initial program 74.7%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2} + \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right) - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \phi_2\right)}\right) - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_2\right) \cdot \cos \left(\frac{-1}{2} \cdot \phi_2\right)} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \phi_2\right)}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \phi_2\right)\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_2\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_2\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_2 \cdot \frac{1}{2}\right)}}^{2} - \cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_2 \cdot \frac{1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_2 \cdot \frac{1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2}}}\right) \]
                    5. Applied rewrites74.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2}}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification65.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -2.1 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot 0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 18: 58.4% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ t_2 := \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)\\ t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {t\_2}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, t\_2, t\_0 \cdot t\_1\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_1 (* (cos phi1) (cos phi2)))
                          (t_2 (sin (* (- phi1 phi2) 0.5)))
                          (t_3
                           (*
                            (*
                             (atan2
                              (sqrt (fma t_1 (pow (sin (* lambda1 0.5)) 2.0) (pow t_2 2.0)))
                              (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                             2.0)
                            R)))
                     (if (<= phi2 -0.0105)
                       t_3
                       (if (<= phi2 2700000000.0)
                         (*
                          (*
                           (atan2
                            (sqrt (fma t_2 t_2 (* t_0 t_1)))
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_0 (cos phi1)))))
                           2.0)
                          R)
                         t_3))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_1 = cos(phi1) * cos(phi2);
                  	double t_2 = sin(((phi1 - phi2) * 0.5));
                  	double t_3 = (atan2(sqrt(fma(t_1, pow(sin((lambda1 * 0.5)), 2.0), pow(t_2, 2.0))), sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	double tmp;
                  	if (phi2 <= -0.0105) {
                  		tmp = t_3;
                  	} else if (phi2 <= 2700000000.0) {
                  		tmp = (atan2(sqrt(fma(t_2, t_2, (t_0 * t_1))), sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_0 * cos(phi1))))) * 2.0) * R;
                  	} else {
                  		tmp = t_3;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_1 = Float64(cos(phi1) * cos(phi2))
                  	t_2 = sin(Float64(Float64(phi1 - phi2) * 0.5))
                  	t_3 = Float64(Float64(atan(sqrt(fma(t_1, (sin(Float64(lambda1 * 0.5)) ^ 2.0), (t_2 ^ 2.0))), sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R)
                  	tmp = 0.0
                  	if (phi2 <= -0.0105)
                  		tmp = t_3;
                  	elseif (phi2 <= 2700000000.0)
                  		tmp = Float64(Float64(atan(sqrt(fma(t_2, t_2, Float64(t_0 * t_1))), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_0 * cos(phi1))))) * 2.0) * R);
                  	else
                  		tmp = t_3;
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[ArcTan[N[Sqrt[N[(t$95$1 * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi2, -0.0105], t$95$3, If[LessEqual[phi2, 2700000000.0], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$2 * t$95$2 + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$3]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_1 := \cos \phi_1 \cdot \cos \phi_2\\
                  t_2 := \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)\\
                  t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {t\_2}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  \mathbf{if}\;\phi_2 \leq -0.0105:\\
                  \;\;\;\;t\_3\\
                  
                  \mathbf{elif}\;\phi_2 \leq 2700000000:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, t\_2, t\_0 \cdot t\_1\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_3\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if phi2 < -0.0105000000000000007 or 2.7e9 < phi2

                    1. Initial program 49.2%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in lambda2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2} \cdot \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 + \color{blue}{-1 \cdot \phi_2}\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 + -1 \cdot \phi_2\right)\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites35.9%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. lower-*.f6436.1

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                    8. Applied rewrites36.1%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}\right) \]

                    if -0.0105000000000000007 < phi2 < 2.7e9

                    1. Initial program 78.6%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites77.3%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Applied rewrites77.3%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right), \sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right), {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification59.0%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right), \sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right), {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 19: 58.3% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ t_2 := \cos \phi_1 \cdot \cos \phi_2\\ t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_1\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, t\_2, t\_1\right)}}{\sqrt{\mathsf{fma}\left(-\cos \phi_1, t\_0, {\cos \left(-0.5 \cdot \phi_1\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_1 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                          (t_2 (* (cos phi1) (cos phi2)))
                          (t_3
                           (*
                            (*
                             (atan2
                              (sqrt (fma t_2 (pow (sin (* lambda1 0.5)) 2.0) t_1))
                              (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                             2.0)
                            R)))
                     (if (<= phi2 -0.0105)
                       t_3
                       (if (<= phi2 2700000000.0)
                         (*
                          (atan2
                           (sqrt (fma t_0 t_2 t_1))
                           (sqrt (fma (- (cos phi1)) t_0 (pow (cos (* -0.5 phi1)) 2.0))))
                          (* 2.0 R))
                         t_3))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_1 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
                  	double t_2 = cos(phi1) * cos(phi2);
                  	double t_3 = (atan2(sqrt(fma(t_2, pow(sin((lambda1 * 0.5)), 2.0), t_1)), sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	double tmp;
                  	if (phi2 <= -0.0105) {
                  		tmp = t_3;
                  	} else if (phi2 <= 2700000000.0) {
                  		tmp = atan2(sqrt(fma(t_0, t_2, t_1)), sqrt(fma(-cos(phi1), t_0, pow(cos((-0.5 * phi1)), 2.0)))) * (2.0 * R);
                  	} else {
                  		tmp = t_3;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_1 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
                  	t_2 = Float64(cos(phi1) * cos(phi2))
                  	t_3 = Float64(Float64(atan(sqrt(fma(t_2, (sin(Float64(lambda1 * 0.5)) ^ 2.0), t_1)), sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R)
                  	tmp = 0.0
                  	if (phi2 <= -0.0105)
                  		tmp = t_3;
                  	elseif (phi2 <= 2700000000.0)
                  		tmp = Float64(atan(sqrt(fma(t_0, t_2, t_1)), sqrt(fma(Float64(-cos(phi1)), t_0, (cos(Float64(-0.5 * phi1)) ^ 2.0)))) * Float64(2.0 * R));
                  	else
                  		tmp = t_3;
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[ArcTan[N[Sqrt[N[(t$95$2 * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi2, -0.0105], t$95$3, If[LessEqual[phi2, 2700000000.0], N[(N[ArcTan[N[Sqrt[N[(t$95$0 * t$95$2 + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[((-N[Cos[phi1], $MachinePrecision]) * t$95$0 + N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_1 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
                  t_2 := \cos \phi_1 \cdot \cos \phi_2\\
                  t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_1\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  \mathbf{if}\;\phi_2 \leq -0.0105:\\
                  \;\;\;\;t\_3\\
                  
                  \mathbf{elif}\;\phi_2 \leq 2700000000:\\
                  \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, t\_2, t\_1\right)}}{\sqrt{\mathsf{fma}\left(-\cos \phi_1, t\_0, {\cos \left(-0.5 \cdot \phi_1\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_3\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if phi2 < -0.0105000000000000007 or 2.7e9 < phi2

                    1. Initial program 49.2%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in lambda2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2} \cdot \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 + \color{blue}{-1 \cdot \phi_2}\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 + -1 \cdot \phi_2\right)\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites35.9%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. lower-*.f6436.1

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                    8. Applied rewrites36.1%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}\right) \]

                    if -0.0105000000000000007 < phi2 < 2.7e9

                    1. Initial program 78.6%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites77.3%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Applied rewrites77.3%

                      \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{\mathsf{fma}\left(-\cos \phi_1, {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, {\cos \left(-0.5 \cdot \phi_1\right)}^{2}\right)}} \cdot \left(R \cdot 2\right)} \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification58.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1 \cdot \cos \phi_2, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{\mathsf{fma}\left(-\cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\cos \left(-0.5 \cdot \phi_1\right)}^{2}\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 20: 58.4% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := t\_0 \cdot \cos \phi_1\\ t_2 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_2\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_1, t\_2\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_1 (* t_0 (cos phi1)))
                          (t_2 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                          (t_3
                           (*
                            (*
                             (atan2
                              (sqrt
                               (fma
                                (* (cos phi1) (cos phi2))
                                (pow (sin (* lambda1 0.5)) 2.0)
                                t_2))
                              (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                             2.0)
                            R)))
                     (if (<= phi2 -0.0105)
                       t_3
                       (if (<= phi2 2700000000.0)
                         (*
                          (*
                           (atan2
                            (sqrt (fma (cos phi2) t_1 t_2))
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) t_1)))
                           2.0)
                          R)
                         t_3))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_1 = t_0 * cos(phi1);
                  	double t_2 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
                  	double t_3 = (atan2(sqrt(fma((cos(phi1) * cos(phi2)), pow(sin((lambda1 * 0.5)), 2.0), t_2)), sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	double tmp;
                  	if (phi2 <= -0.0105) {
                  		tmp = t_3;
                  	} else if (phi2 <= 2700000000.0) {
                  		tmp = (atan2(sqrt(fma(cos(phi2), t_1, t_2)), sqrt((pow(cos((-0.5 * phi1)), 2.0) - t_1))) * 2.0) * R;
                  	} else {
                  		tmp = t_3;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_1 = Float64(t_0 * cos(phi1))
                  	t_2 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
                  	t_3 = Float64(Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(lambda1 * 0.5)) ^ 2.0), t_2)), sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R)
                  	tmp = 0.0
                  	if (phi2 <= -0.0105)
                  		tmp = t_3;
                  	elseif (phi2 <= 2700000000.0)
                  		tmp = Float64(Float64(atan(sqrt(fma(cos(phi2), t_1, t_2)), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - t_1))) * 2.0) * R);
                  	else
                  		tmp = t_3;
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi2, -0.0105], t$95$3, If[LessEqual[phi2, 2700000000.0], N[(N[(N[ArcTan[N[Sqrt[N[(N[Cos[phi2], $MachinePrecision] * t$95$1 + t$95$2), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$3]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_1 := t\_0 \cdot \cos \phi_1\\
                  t_2 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
                  t_3 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_2\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  \mathbf{if}\;\phi_2 \leq -0.0105:\\
                  \;\;\;\;t\_3\\
                  
                  \mathbf{elif}\;\phi_2 \leq 2700000000:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_1, t\_2\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_1}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_3\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if phi2 < -0.0105000000000000007 or 2.7e9 < phi2

                    1. Initial program 49.2%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in lambda2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2} \cdot \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 + \color{blue}{-1 \cdot \phi_2}\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 + -1 \cdot \phi_2\right)\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites35.9%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. lower-*.f6436.1

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                    8. Applied rewrites36.1%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}\right) \]

                    if -0.0105000000000000007 < phi2 < 2.7e9

                    1. Initial program 78.6%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites77.3%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Applied rewrites77.3%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_2, {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1, {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification58.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -0.0105:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 2700000000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 21: 56.7% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -0.00035:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\phi_2 \leq 1.05 \cdot 10^{-33}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                          (t_1
                           (*
                            (*
                             (atan2
                              (sqrt
                               (fma
                                (* (cos phi1) (cos phi2))
                                (pow (sin (* lambda1 0.5)) 2.0)
                                (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                              (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                             2.0)
                            R)))
                     (if (<= phi2 -0.00035)
                       t_1
                       (if (<= phi2 1.05e-33)
                         (*
                          (*
                           (atan2
                            (sqrt (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))
                            (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_0 (cos phi1)))))
                           2.0)
                          R)
                         t_1))))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                  	double t_1 = (atan2(sqrt(fma((cos(phi1) * cos(phi2)), pow(sin((lambda1 * 0.5)), 2.0), pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                  	double tmp;
                  	if (phi2 <= -0.00035) {
                  		tmp = t_1;
                  	} else if (phi2 <= 1.05e-33) {
                  		tmp = (atan2(sqrt(fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))), sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_0 * cos(phi1))))) * 2.0) * R;
                  	} else {
                  		tmp = t_1;
                  	}
                  	return tmp;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	t_1 = Float64(Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(lambda1 * 0.5)) ^ 2.0), (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R)
                  	tmp = 0.0
                  	if (phi2 <= -0.00035)
                  		tmp = t_1;
                  	elseif (phi2 <= 1.05e-33)
                  		tmp = Float64(Float64(atan(sqrt(fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_0 * cos(phi1))))) * 2.0) * R);
                  	else
                  		tmp = t_1;
                  	end
                  	return tmp
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi2, -0.00035], t$95$1, If[LessEqual[phi2, 1.05e-33], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$1]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                  t_1 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                  \mathbf{if}\;\phi_2 \leq -0.00035:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;\phi_2 \leq 1.05 \cdot 10^{-33}:\\
                  \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0 \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if phi2 < -3.49999999999999996e-4 or 1.05e-33 < phi2

                    1. Initial program 50.7%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in lambda2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \phi_2} \cdot \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      8. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      9. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      10. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      11. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      12. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 + \color{blue}{-1 \cdot \phi_2}\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 + -1 \cdot \phi_2\right)\right)}^{2}}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites36.7%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    6. Taylor expanded in phi1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                      3. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      4. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      5. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                      15. lower-*.f6436.4

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                    8. Applied rewrites36.4%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}\right) \]

                    if -3.49999999999999996e-4 < phi2 < 1.05e-33

                    1. Initial program 79.8%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                      2. associate--r+N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      3. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      4. 1-sub-sinN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      5. unpow2N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      6. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                      7. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      8. metadata-evalN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      9. distribute-lft-neg-inN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      10. cos-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      11. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      12. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      13. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                      14. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                      15. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    5. Applied rewrites79.5%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    6. Taylor expanded in phi2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      3. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      4. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      5. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      6. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      8. lower-*.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      9. mul-1-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      10. sub-negN/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      11. lower--.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      12. lower-cos.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      13. lower-pow.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      14. lower-sin.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_1}}\right) \]
                      15. lower-*.f6478.1

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                    8. Applied rewrites78.1%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification57.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -0.00035:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 1.05 \cdot 10^{-33}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 22: 34.6% accurate, 1.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R \end{array} \end{array} \]
                  (FPCore (R lambda1 lambda2 phi1 phi2)
                   :precision binary64
                   (let* ((t_0 (sin (/ (- lambda1 lambda2) 2.0))))
                     (*
                      (*
                       (atan2
                        (sqrt
                         (+
                          (* (* t_0 (* (cos phi1) (cos phi2))) t_0)
                          (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))
                        (sqrt (- 1.0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))))
                       2.0)
                      R)))
                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = sin(((lambda1 - lambda2) / 2.0));
                  	return (atan2(sqrt((((t_0 * (cos(phi1) * cos(phi2))) * t_0) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))), sqrt((1.0 - pow(sin(((phi1 - phi2) * 0.5)), 2.0)))) * 2.0) * R;
                  }
                  
                  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
                      t_0 = sin(((lambda1 - lambda2) / 2.0d0))
                      code = (atan2(sqrt((((t_0 * (cos(phi1) * cos(phi2))) * t_0) + (sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0))), sqrt((1.0d0 - (sin(((phi1 - phi2) * 0.5d0)) ** 2.0d0)))) * 2.0d0) * r
                  end function
                  
                  public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                  	double t_0 = Math.sin(((lambda1 - lambda2) / 2.0));
                  	return (Math.atan2(Math.sqrt((((t_0 * (Math.cos(phi1) * Math.cos(phi2))) * t_0) + Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0))), Math.sqrt((1.0 - Math.pow(Math.sin(((phi1 - phi2) * 0.5)), 2.0)))) * 2.0) * R;
                  }
                  
                  def code(R, lambda1, lambda2, phi1, phi2):
                  	t_0 = math.sin(((lambda1 - lambda2) / 2.0))
                  	return (math.atan2(math.sqrt((((t_0 * (math.cos(phi1) * math.cos(phi2))) * t_0) + math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0))), math.sqrt((1.0 - math.pow(math.sin(((phi1 - phi2) * 0.5)), 2.0)))) * 2.0) * R
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
                  	return Float64(Float64(atan(sqrt(Float64(Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))), sqrt(Float64(1.0 - (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)))) * 2.0) * R)
                  end
                  
                  function tmp = code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(((lambda1 - lambda2) / 2.0));
                  	tmp = (atan2(sqrt((((t_0 * (cos(phi1) * cos(phi2))) * t_0) + (sin(((phi1 - phi2) / 2.0)) ^ 2.0))), sqrt((1.0 - (sin(((phi1 - phi2) * 0.5)) ^ 2.0)))) * 2.0) * R;
                  end
                  
                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
                  \left(\tan^{-1}_* \frac{\sqrt{\left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Initial program 65.5%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in phi2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{1 - \left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2} + \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)}}}\right) \]
                    2. associate--r+N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 - {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    3. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\left(1 - \color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)}\right) - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    4. 1-sub-sinN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    5. unpow2N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    6. lower--.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}}\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\frac{1}{2} \cdot \phi_1\right)}^{2}} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    8. metadata-evalN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2}\right)\right)} \cdot \phi_1\right)}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    9. distribute-lft-neg-inN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{2} \cdot \phi_1\right)\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    10. cos-negN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    11. lower-cos.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\color{blue}{\cos \left(\frac{-1}{2} \cdot \phi_1\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    12. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    13. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \color{blue}{\left(\phi_1 \cdot \frac{-1}{2}\right)}}^{2} - \cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]
                    14. *-commutativeN/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                    15. lower-*.f64N/A

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{{\cos \left(\phi_1 \cdot \frac{-1}{2}\right)}^{2} - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  5. Applied rewrites52.1%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{{\cos \left(\phi_1 \cdot -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}}\right) \]
                  6. Taylor expanded in lambda1 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\left(1 + -1 \cdot \left(\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right)\right)\right) - \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
                  7. Applied rewrites44.8%

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\color{blue}{\mathsf{fma}\left(\lambda_1 \cdot \left(-\cos \phi_1\right), \left(\cos \phi_2 \cdot \sin \left(\lambda_2 \cdot -0.5\right)\right) \cdot \cos \left(0.5 \cdot \lambda_2\right), 1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}\right) \]
                  8. Taylor expanded in lambda2 around 0

                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}\right) \]
                  9. Step-by-step derivation
                    1. Applied rewrites35.6%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \color{blue}{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}}\right) \]
                    2. Final simplification35.6%

                      \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{\left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R \]
                    3. Add Preprocessing

                    Alternative 23: 29.2% accurate, 1.5× speedup?

                    \[\begin{array}{l} \\ \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)}} \cdot R\right) \cdot 2 \end{array} \]
                    (FPCore (R lambda1 lambda2 phi1 phi2)
                     :precision binary64
                     (*
                      (*
                       (atan2
                        (sqrt (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                        (sqrt
                         (-
                          (pow (cos (/ (- phi1 phi2) -2.0)) 2.0)
                          (*
                           (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
                           (* (cos phi1) (cos phi2))))))
                       R)
                      2.0))
                    double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                    	return (atan2(sqrt(pow(sin(((phi1 - phi2) * 0.5)), 2.0)), sqrt((pow(cos(((phi1 - phi2) / -2.0)), 2.0) - (pow(sin(((lambda1 - lambda2) * 0.5)), 2.0) * (cos(phi1) * cos(phi2)))))) * R) * 2.0;
                    }
                    
                    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 = (atan2(sqrt((sin(((phi1 - phi2) * 0.5d0)) ** 2.0d0)), sqrt(((cos(((phi1 - phi2) / (-2.0d0))) ** 2.0d0) - ((sin(((lambda1 - lambda2) * 0.5d0)) ** 2.0d0) * (cos(phi1) * cos(phi2)))))) * r) * 2.0d0
                    end function
                    
                    public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                    	return (Math.atan2(Math.sqrt(Math.pow(Math.sin(((phi1 - phi2) * 0.5)), 2.0)), Math.sqrt((Math.pow(Math.cos(((phi1 - phi2) / -2.0)), 2.0) - (Math.pow(Math.sin(((lambda1 - lambda2) * 0.5)), 2.0) * (Math.cos(phi1) * Math.cos(phi2)))))) * R) * 2.0;
                    }
                    
                    def code(R, lambda1, lambda2, phi1, phi2):
                    	return (math.atan2(math.sqrt(math.pow(math.sin(((phi1 - phi2) * 0.5)), 2.0)), math.sqrt((math.pow(math.cos(((phi1 - phi2) / -2.0)), 2.0) - (math.pow(math.sin(((lambda1 - lambda2) * 0.5)), 2.0) * (math.cos(phi1) * math.cos(phi2)))))) * R) * 2.0
                    
                    function code(R, lambda1, lambda2, phi1, phi2)
                    	return Float64(Float64(atan(sqrt((sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)), sqrt(Float64((cos(Float64(Float64(phi1 - phi2) / -2.0)) ^ 2.0) - Float64((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0) * Float64(cos(phi1) * cos(phi2)))))) * R) * 2.0)
                    end
                    
                    function tmp = code(R, lambda1, lambda2, phi1, phi2)
                    	tmp = (atan2(sqrt((sin(((phi1 - phi2) * 0.5)) ^ 2.0)), sqrt(((cos(((phi1 - phi2) / -2.0)) ^ 2.0) - ((sin(((lambda1 - lambda2) * 0.5)) ^ 2.0) * (cos(phi1) * cos(phi2)))))) * R) * 2.0;
                    end
                    
                    code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[(N[ArcTan[N[Sqrt[N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(N[(phi1 - phi2), $MachinePrecision] / -2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * R), $MachinePrecision] * 2.0), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)}} \cdot R\right) \cdot 2
                    \end{array}
                    
                    Derivation
                    1. Initial program 65.5%

                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in lambda1 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      3. associate-*r*N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. lower-fma.f64N/A

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    5. Applied rewrites45.5%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    6. Taylor expanded in lambda2 around 0

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites30.6%

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. Applied rewrites30.6%

                        \[\leadsto \color{blue}{\left(R \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}}\right) \cdot 2} \]
                      3. Final simplification30.6%

                        \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{{\cos \left(\frac{\phi_1 - \phi_2}{-2}\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)}} \cdot R\right) \cdot 2 \]
                      4. Add Preprocessing

                      Alternative 24: 29.2% accurate, 1.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2, t\_0\right)}} \cdot 2\right) \cdot R \end{array} \end{array} \]
                      (FPCore (R lambda1 lambda2 phi1 phi2)
                       :precision binary64
                       (let* ((t_0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                         (*
                          (*
                           (atan2
                            (sqrt t_0)
                            (sqrt
                             (-
                              1.0
                              (fma
                               (cos phi1)
                               (* (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0) (cos phi2))
                               t_0))))
                           2.0)
                          R)))
                      double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                      	double t_0 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
                      	return (atan2(sqrt(t_0), sqrt((1.0 - fma(cos(phi1), (pow(sin(((lambda1 - lambda2) * 0.5)), 2.0) * cos(phi2)), t_0)))) * 2.0) * R;
                      }
                      
                      function code(R, lambda1, lambda2, phi1, phi2)
                      	t_0 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
                      	return Float64(Float64(atan(sqrt(t_0), sqrt(Float64(1.0 - fma(cos(phi1), Float64((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0) * cos(phi2)), t_0)))) * 2.0) * R)
                      end
                      
                      code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[t$95$0], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[Cos[phi1], $MachinePrecision] * N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
                      \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2, t\_0\right)}} \cdot 2\right) \cdot R
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Initial program 65.5%

                        \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in lambda1 around 0

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        2. associate-*r*N/A

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        3. associate-*r*N/A

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        4. lower-fma.f64N/A

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      5. Applied rewrites45.5%

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      6. Taylor expanded in lambda2 around 0

                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites30.6%

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        2. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}}\right) \]
                          2. +-commutativeN/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}}}\right) \]
                        3. Applied rewrites30.6%

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_1, \cos \phi_2 \cdot {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}\right) \]
                        4. Final simplification30.6%

                          \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1, {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_2, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
                        5. Add Preprocessing

                        Alternative 25: 29.1% accurate, 1.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_0\right)}} \cdot 2\right) \cdot R \end{array} \end{array} \]
                        (FPCore (R lambda1 lambda2 phi1 phi2)
                         :precision binary64
                         (let* ((t_0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                           (*
                            (*
                             (atan2
                              (sqrt t_0)
                              (sqrt
                               (-
                                1.0
                                (fma (* (cos phi1) (cos phi2)) (pow (sin (* lambda1 0.5)) 2.0) t_0))))
                             2.0)
                            R)))
                        double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                        	double t_0 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
                        	return (atan2(sqrt(t_0), sqrt((1.0 - fma((cos(phi1) * cos(phi2)), pow(sin((lambda1 * 0.5)), 2.0), t_0)))) * 2.0) * R;
                        }
                        
                        function code(R, lambda1, lambda2, phi1, phi2)
                        	t_0 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
                        	return Float64(Float64(atan(sqrt(t_0), sqrt(Float64(1.0 - fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(lambda1 * 0.5)) ^ 2.0), t_0)))) * 2.0) * R)
                        end
                        
                        code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[t$95$0], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
                        \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, t\_0\right)}} \cdot 2\right) \cdot R
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Initial program 65.5%

                          \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in lambda1 around 0

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        4. Step-by-step derivation
                          1. associate-*r*N/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                          2. associate-*r*N/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                          3. associate-*r*N/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                          4. lower-fma.f64N/A

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        5. Applied rewrites45.5%

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        6. Taylor expanded in lambda2 around 0

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                        7. Step-by-step derivation
                          1. Applied rewrites30.6%

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                          2. Taylor expanded in lambda2 around 0

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
                          3. Step-by-step derivation
                            1. associate-*r*N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            2. lower-fma.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
                            3. *-commutativeN/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            4. lower-*.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            5. lower-cos.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{\cos \phi_2} \cdot \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            6. lower-cos.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            7. lower-pow.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            8. lower-sin.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            9. *-commutativeN/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            10. lower-*.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
                            11. sub-negN/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\phi_1 + \left(\mathsf{neg}\left(\phi_2\right)\right)\right)}\right)}^{2}\right)}}\right) \]
                            12. mul-1-negN/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 + \color{blue}{-1 \cdot \phi_2}\right)\right)}^{2}\right)}}\right) \]
                            13. lower-pow.f64N/A

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2}, \color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 + -1 \cdot \phi_2\right)\right)}^{2}}\right)}}\right) \]
                          4. Applied rewrites30.5%

                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}\right) \]
                          5. Final simplification30.5%

                            \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
                          6. Add Preprocessing

                          Alternative 26: 23.4% accurate, 1.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_1 := \sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, t\_0\right)}\\ t_2 := \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{t\_1} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_1 \leq -5 \cdot 10^{-36}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\phi_1 \leq 2.95 \cdot 10^{-6}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{t\_1} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                          (FPCore (R lambda1 lambda2 phi1 phi2)
                           :precision binary64
                           (let* ((t_0 (pow (sin (* phi1 0.5)) 2.0))
                                  (t_1
                                   (sqrt
                                    (-
                                     1.0
                                     (fma (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0) (cos phi1) t_0))))
                                  (t_2 (* (* (atan2 (sqrt t_0) t_1) 2.0) R)))
                             (if (<= phi1 -5e-36)
                               t_2
                               (if (<= phi1 2.95e-6)
                                 (* (* (atan2 (sqrt (pow (sin (* phi2 -0.5)) 2.0)) t_1) 2.0) R)
                                 t_2))))
                          double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                          	double t_0 = pow(sin((phi1 * 0.5)), 2.0);
                          	double t_1 = sqrt((1.0 - fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), cos(phi1), t_0)));
                          	double t_2 = (atan2(sqrt(t_0), t_1) * 2.0) * R;
                          	double tmp;
                          	if (phi1 <= -5e-36) {
                          		tmp = t_2;
                          	} else if (phi1 <= 2.95e-6) {
                          		tmp = (atan2(sqrt(pow(sin((phi2 * -0.5)), 2.0)), t_1) * 2.0) * R;
                          	} else {
                          		tmp = t_2;
                          	}
                          	return tmp;
                          }
                          
                          function code(R, lambda1, lambda2, phi1, phi2)
                          	t_0 = sin(Float64(phi1 * 0.5)) ^ 2.0
                          	t_1 = sqrt(Float64(1.0 - fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), cos(phi1), t_0)))
                          	t_2 = Float64(Float64(atan(sqrt(t_0), t_1) * 2.0) * R)
                          	tmp = 0.0
                          	if (phi1 <= -5e-36)
                          		tmp = t_2;
                          	elseif (phi1 <= 2.95e-6)
                          		tmp = Float64(Float64(atan(sqrt((sin(Float64(phi2 * -0.5)) ^ 2.0)), t_1) * 2.0) * R);
                          	else
                          		tmp = t_2;
                          	end
                          	return tmp
                          end
                          
                          code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 - N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[ArcTan[N[Sqrt[t$95$0], $MachinePrecision] / t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[phi1, -5e-36], t$95$2, If[LessEqual[phi1, 2.95e-6], N[(N[(N[ArcTan[N[Sqrt[N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$2]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\
                          t_1 := \sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, t\_0\right)}\\
                          t_2 := \left(\tan^{-1}_* \frac{\sqrt{t\_0}}{t\_1} \cdot 2\right) \cdot R\\
                          \mathbf{if}\;\phi_1 \leq -5 \cdot 10^{-36}:\\
                          \;\;\;\;t\_2\\
                          
                          \mathbf{elif}\;\phi_1 \leq 2.95 \cdot 10^{-6}:\\
                          \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{t\_1} \cdot 2\right) \cdot R\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_2\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if phi1 < -5.00000000000000004e-36 or 2.95000000000000013e-6 < phi1

                            1. Initial program 56.3%

                              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                            2. Add Preprocessing
                            3. Taylor expanded in lambda1 around 0

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                            4. Step-by-step derivation
                              1. associate-*r*N/A

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                              2. associate-*r*N/A

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                              3. associate-*r*N/A

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                              4. lower-fma.f64N/A

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                            5. Applied rewrites40.8%

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                            6. Taylor expanded in lambda2 around 0

                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                            7. Step-by-step derivation
                              1. Applied rewrites34.4%

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                              2. Taylor expanded in phi2 around 0

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                              3. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                2. lower-fma.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                3. lower-pow.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                4. sub-negN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                5. mul-1-negN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                6. lower-sin.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                7. *-commutativeN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                8. lower-*.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                9. mul-1-negN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                10. sub-negN/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                11. lower--.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                12. lower-cos.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                13. lower-pow.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                14. lower-sin.f64N/A

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                15. lower-*.f6434.5

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                              4. Applied rewrites34.5%

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                              5. Taylor expanded in phi2 around 0

                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                              6. Step-by-step derivation
                                1. Applied rewrites34.3%

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(0.5 \cdot \phi_1\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]

                                if -5.00000000000000004e-36 < phi1 < 2.95000000000000013e-6

                                1. Initial program 75.4%

                                  \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in lambda1 around 0

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                4. Step-by-step derivation
                                  1. associate-*r*N/A

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                  2. associate-*r*N/A

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                  3. associate-*r*N/A

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                  4. lower-fma.f64N/A

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                5. Applied rewrites50.7%

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                6. Taylor expanded in lambda2 around 0

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                7. Step-by-step derivation
                                  1. Applied rewrites26.5%

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                  2. Taylor expanded in phi2 around 0

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                  3. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    2. lower-fma.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                    3. lower-pow.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    4. sub-negN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    5. mul-1-negN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    6. lower-sin.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    7. *-commutativeN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    8. lower-*.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    9. mul-1-negN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    10. sub-negN/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    11. lower--.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    12. lower-cos.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                    13. lower-pow.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                    14. lower-sin.f64N/A

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                    15. lower-*.f6419.5

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                  4. Applied rewrites19.5%

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                  5. Taylor expanded in phi1 around 0

                                    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites17.6%

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(-0.5 \cdot \phi_2\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                  7. Recombined 2 regimes into one program.
                                  8. Final simplification26.3%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -5 \cdot 10^{-36}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 2.95 \cdot 10^{-6}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                                  9. Add Preprocessing

                                  Alternative 27: 27.2% accurate, 1.7× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_1 := \sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}\\ \mathbf{if}\;\phi_2 \leq -7 \cdot 10^{-19}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_1}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_1}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
                                  (FPCore (R lambda1 lambda2 phi1 phi2)
                                   :precision binary64
                                   (let* ((t_0 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                                          (t_1 (sqrt (pow (sin (* (- phi1 phi2) 0.5)) 2.0))))
                                     (if (<= phi2 -7e-19)
                                       (*
                                        (*
                                         (atan2
                                          t_1
                                          (sqrt (- 1.0 (fma t_0 (cos phi2) (pow (sin (* phi2 -0.5)) 2.0)))))
                                         2.0)
                                        R)
                                       (*
                                        (*
                                         (atan2
                                          t_1
                                          (sqrt (- 1.0 (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))))
                                         2.0)
                                        R))))
                                  double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                                  	double t_0 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                                  	double t_1 = sqrt(pow(sin(((phi1 - phi2) * 0.5)), 2.0));
                                  	double tmp;
                                  	if (phi2 <= -7e-19) {
                                  		tmp = (atan2(t_1, sqrt((1.0 - fma(t_0, cos(phi2), pow(sin((phi2 * -0.5)), 2.0))))) * 2.0) * R;
                                  	} else {
                                  		tmp = (atan2(t_1, sqrt((1.0 - fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))))) * 2.0) * R;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(R, lambda1, lambda2, phi1, phi2)
                                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                                  	t_1 = sqrt((sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))
                                  	tmp = 0.0
                                  	if (phi2 <= -7e-19)
                                  		tmp = Float64(Float64(atan(t_1, sqrt(Float64(1.0 - fma(t_0, cos(phi2), (sin(Float64(phi2 * -0.5)) ^ 2.0))))) * 2.0) * R);
                                  	else
                                  		tmp = Float64(Float64(atan(t_1, sqrt(Float64(1.0 - fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))))) * 2.0) * R);
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi2, -7e-19], N[(N[(N[ArcTan[t$95$1 / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[t$95$1 / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                                  t_1 := \sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}\\
                                  \mathbf{if}\;\phi_2 \leq -7 \cdot 10^{-19}:\\
                                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_1}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(\tan^{-1}_* \frac{t\_1}{\sqrt{1 - \mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if phi2 < -7.00000000000000031e-19

                                    1. Initial program 49.0%

                                      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in lambda1 around 0

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                    4. Step-by-step derivation
                                      1. associate-*r*N/A

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      2. associate-*r*N/A

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      3. associate-*r*N/A

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      4. lower-fma.f64N/A

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                    5. Applied rewrites37.3%

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                    6. Taylor expanded in lambda2 around 0

                                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites27.7%

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      2. Taylor expanded in phi1 around 0

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                                      3. Step-by-step derivation
                                        1. *-commutativeN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        2. lower-fma.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}\right) \]
                                        3. lower-pow.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        4. sub-negN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        5. mul-1-negN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        6. lower-sin.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        7. *-commutativeN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        8. lower-*.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        9. mul-1-negN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        10. sub-negN/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        11. lower--.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        12. lower-cos.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}\right) \]
                                        13. lower-pow.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}\right) \]
                                        14. lower-sin.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                                        15. lower-*.f6428.2

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}\right) \]
                                      4. Applied rewrites28.2%

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}\right) \]

                                      if -7.00000000000000031e-19 < phi2

                                      1. Initial program 71.2%

                                        \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in lambda1 around 0

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      4. Step-by-step derivation
                                        1. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        2. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        3. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        4. lower-fma.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      5. Applied rewrites48.4%

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      6. Taylor expanded in lambda2 around 0

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites31.6%

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        2. Taylor expanded in phi2 around 0

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                        3. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          2. lower-fma.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                          3. lower-pow.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          4. sub-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          5. mul-1-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          6. lower-sin.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          7. *-commutativeN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          8. lower-*.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          9. mul-1-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          10. sub-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          11. lower--.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          12. lower-cos.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          13. lower-pow.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                          14. lower-sin.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                          15. lower-*.f6429.8

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                        4. Applied rewrites29.8%

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                      8. Recombined 2 regimes into one program.
                                      9. Final simplification29.4%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -7 \cdot 10^{-19}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_2, {\sin \left(\phi_2 \cdot -0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
                                      10. Add Preprocessing

                                      Alternative 28: 24.8% accurate, 1.7× speedup?

                                      \[\begin{array}{l} \\ \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \end{array} \]
                                      (FPCore (R lambda1 lambda2 phi1 phi2)
                                       :precision binary64
                                       (*
                                        (*
                                         (atan2
                                          (sqrt (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                                          (sqrt
                                           (-
                                            1.0
                                            (fma
                                             (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
                                             (cos phi1)
                                             (pow (sin (* phi1 0.5)) 2.0)))))
                                         2.0)
                                        R))
                                      double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                                      	return (atan2(sqrt(pow(sin(((phi1 - phi2) * 0.5)), 2.0)), sqrt((1.0 - fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), cos(phi1), pow(sin((phi1 * 0.5)), 2.0))))) * 2.0) * R;
                                      }
                                      
                                      function code(R, lambda1, lambda2, phi1, phi2)
                                      	return Float64(Float64(atan(sqrt((sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)), sqrt(Float64(1.0 - fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))))) * 2.0) * R)
                                      end
                                      
                                      code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[(N[ArcTan[N[Sqrt[N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 65.5%

                                        \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in lambda1 around 0

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      4. Step-by-step derivation
                                        1. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        2. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        3. associate-*r*N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        4. lower-fma.f64N/A

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      5. Applied rewrites45.5%

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      6. Taylor expanded in lambda2 around 0

                                        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites30.6%

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        2. Taylor expanded in phi2 around 0

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                        3. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          2. lower-fma.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                          3. lower-pow.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          4. sub-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          5. mul-1-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          6. lower-sin.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          7. *-commutativeN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          8. lower-*.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          9. mul-1-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          10. sub-negN/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          11. lower--.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          12. lower-cos.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          13. lower-pow.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                          14. lower-sin.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                          15. lower-*.f6427.3

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                        4. Applied rewrites27.3%

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                        5. Final simplification27.3%

                                          \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
                                        6. Add Preprocessing

                                        Alternative 29: 24.7% accurate, 1.7× speedup?

                                        \[\begin{array}{l} \\ \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \end{array} \]
                                        (FPCore (R lambda1 lambda2 phi1 phi2)
                                         :precision binary64
                                         (*
                                          (*
                                           (atan2
                                            (sqrt (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                                            (sqrt
                                             (-
                                              1.0
                                              (fma
                                               (pow (sin (* lambda2 -0.5)) 2.0)
                                               (cos phi1)
                                               (pow (sin (* phi1 0.5)) 2.0)))))
                                           2.0)
                                          R))
                                        double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                                        	return (atan2(sqrt(pow(sin(((phi1 - phi2) * 0.5)), 2.0)), sqrt((1.0 - fma(pow(sin((lambda2 * -0.5)), 2.0), cos(phi1), pow(sin((phi1 * 0.5)), 2.0))))) * 2.0) * R;
                                        }
                                        
                                        function code(R, lambda1, lambda2, phi1, phi2)
                                        	return Float64(Float64(atan(sqrt((sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)), sqrt(Float64(1.0 - fma((sin(Float64(lambda2 * -0.5)) ^ 2.0), cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))))) * 2.0) * R)
                                        end
                                        
                                        code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[(N[ArcTan[N[Sqrt[N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[Power[N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 65.5%

                                          \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in lambda1 around 0

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        4. Step-by-step derivation
                                          1. associate-*r*N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                          2. associate-*r*N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                          3. associate-*r*N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                          4. lower-fma.f64N/A

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        5. Applied rewrites45.5%

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        6. Taylor expanded in lambda2 around 0

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites30.6%

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                          2. Taylor expanded in phi2 around 0

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                          3. Step-by-step derivation
                                            1. *-commutativeN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            2. lower-fma.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                            3. lower-pow.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            4. sub-negN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            5. mul-1-negN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            6. lower-sin.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            7. *-commutativeN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            8. lower-*.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            9. mul-1-negN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            10. sub-negN/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            11. lower--.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            12. lower-cos.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            13. lower-pow.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                            14. lower-sin.f64N/A

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                            15. lower-*.f6427.3

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                          4. Applied rewrites27.3%

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                          5. Taylor expanded in lambda1 around 0

                                            \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites27.2%

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                            2. Final simplification27.2%

                                              \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
                                            3. Add Preprocessing

                                            Alternative 30: 14.5% accurate, 1.7× speedup?

                                            \[\begin{array}{l} \\ \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \end{array} \]
                                            (FPCore (R lambda1 lambda2 phi1 phi2)
                                             :precision binary64
                                             (*
                                              (*
                                               (atan2
                                                (sqrt (pow (sin (* phi2 -0.5)) 2.0))
                                                (sqrt
                                                 (-
                                                  1.0
                                                  (fma
                                                   (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
                                                   (cos phi1)
                                                   (pow (sin (* phi1 0.5)) 2.0)))))
                                               2.0)
                                              R))
                                            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                                            	return (atan2(sqrt(pow(sin((phi2 * -0.5)), 2.0)), sqrt((1.0 - fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), cos(phi1), pow(sin((phi1 * 0.5)), 2.0))))) * 2.0) * R;
                                            }
                                            
                                            function code(R, lambda1, lambda2, phi1, phi2)
                                            	return Float64(Float64(atan(sqrt((sin(Float64(phi2 * -0.5)) ^ 2.0)), sqrt(Float64(1.0 - fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))))) * 2.0) * R)
                                            end
                                            
                                            code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[(N[ArcTan[N[Sqrt[N[Power[N[Sin[N[(phi2 * -0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 65.5%

                                              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in lambda1 around 0

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\lambda_1 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)\right) + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                            4. Step-by-step derivation
                                              1. associate-*r*N/A

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{-1}{2} \cdot \lambda_2\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                              2. associate-*r*N/A

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \color{blue}{\left(\left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                              3. associate-*r*N/A

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right)\right) \cdot \sin \left(\frac{-1}{2} \cdot \lambda_2\right)} + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                              4. lower-fma.f64N/A

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\lambda_1 \cdot \cos \phi_1\right) \cdot \left(\cos \phi_2 \cdot \cos \left(\frac{-1}{2} \cdot \lambda_2\right)\right), \sin \left(\frac{-1}{2} \cdot \lambda_2\right), \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                            5. Applied rewrites45.5%

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(\left(\cos \phi_1 \cdot \lambda_1\right) \cdot \left(\cos \left(0.5 \cdot \lambda_2\right) \cdot \cos \phi_2\right), \sin \left(\lambda_2 \cdot -0.5\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)\right)}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                            6. Taylor expanded in lambda2 around 0

                                              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites30.6%

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
                                              2. Taylor expanded in phi2 around 0

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\left(\cos \phi_1 \cdot {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                              3. Step-by-step derivation
                                                1. *-commutativeN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot \cos \phi_1} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                2. lower-fma.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                                3. lower-pow.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                4. sub-negN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \color{blue}{\left(\lambda_1 + \left(\mathsf{neg}\left(\lambda_2\right)\right)\right)}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                5. mul-1-negN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + \color{blue}{-1 \cdot \lambda_2}\right)\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                6. lower-sin.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \left(\lambda_1 + -1 \cdot \lambda_2\right)\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                7. *-commutativeN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                8. lower-*.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 + -1 \cdot \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                9. mul-1-negN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 + \color{blue}{\left(\mathsf{neg}\left(\lambda_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                10. sub-negN/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                11. lower--.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                12. lower-cos.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \color{blue}{\cos \phi_1}, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                13. lower-pow.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, \color{blue}{{\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}}\right)}}\right) \]
                                                14. lower-sin.f64N/A

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot \frac{1}{2}\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                                15. lower-*.f6427.3

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2}\right)}}\right) \]
                                              4. Applied rewrites27.3%

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                              5. Taylor expanded in phi1 around 0

                                                \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}, \cos \phi_1, {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites14.3%

                                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(-0.5 \cdot \phi_2\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(0.5 \cdot \phi_1\right)}^{2}\right)}}\right) \]
                                                2. Final simplification14.3%

                                                  \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R \]
                                                3. Add Preprocessing

                                                Reproduce

                                                ?
                                                herbie shell --seed 2024270 
                                                (FPCore (R lambda1 lambda2 phi1 phi2)
                                                  :name "Distance on a great circle"
                                                  :precision binary64
                                                  (* R (* 2.0 (atan2 (sqrt (+ (pow (sin (/ (- phi1 phi2) 2.0)) 2.0) (* (* (* (cos phi1) (cos phi2)) (sin (/ (- lambda1 lambda2) 2.0))) (sin (/ (- lambda1 lambda2) 2.0))))) (sqrt (- 1.0 (+ (pow (sin (/ (- phi1 phi2) 2.0)) 2.0) (* (* (* (cos phi1) (cos phi2)) (sin (/ (- lambda1 lambda2) 2.0))) (sin (/ (- lambda1 lambda2) 2.0))))))))))