Distance on a great circle

Percentage Accurate: 62.3% → 79.5%
Time: 42.4s
Alternatives: 24
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 24 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.3% 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.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_1 := \sin \left(\phi_2 \cdot 0.5\right)\\ t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_3 := \cos \phi_1 \cdot \cos \phi_2\\ t_4 := \sin \left(\phi_1 \cdot 0.5\right)\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\cos \left(\lambda_2 \cdot 0.5\right) \cdot \sin \left(0.5 \cdot \lambda_1\right) - \sin \left(\lambda_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \lambda_1\right)\right)}^{2}, t\_3, {\left(\mathsf{fma}\left(-t\_0, t\_1, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_4\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\left(t\_2 \cdot t\_3\right) \cdot t\_2 + {\left(t\_4 \cdot \cos \left(\phi_2 \cdot 0.5\right) - t\_1 \cdot t\_0\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 0.5)))
        (t_1 (sin (* phi2 0.5)))
        (t_2 (sin (/ (- lambda1 lambda2) 2.0)))
        (t_3 (* (cos phi1) (cos phi2)))
        (t_4 (sin (* phi1 0.5))))
   (*
    (*
     (atan2
      (sqrt
       (fma
        (pow
         (-
          (* (cos (* lambda2 0.5)) (sin (* 0.5 lambda1)))
          (* (sin (* lambda2 0.5)) (cos (* 0.5 lambda1))))
         2.0)
        t_3
        (pow (fma (- t_0) t_1 (* (cos (* -0.5 phi2)) t_4)) 2.0)))
      (sqrt
       (-
        1.0
        (+
         (* (* t_2 t_3) t_2)
         (pow (- (* t_4 (cos (* phi2 0.5))) (* t_1 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 = sin((phi2 * 0.5));
	double t_2 = sin(((lambda1 - lambda2) / 2.0));
	double t_3 = cos(phi1) * cos(phi2);
	double t_4 = sin((phi1 * 0.5));
	return (atan2(sqrt(fma(pow(((cos((lambda2 * 0.5)) * sin((0.5 * lambda1))) - (sin((lambda2 * 0.5)) * cos((0.5 * lambda1)))), 2.0), t_3, pow(fma(-t_0, t_1, (cos((-0.5 * phi2)) * t_4)), 2.0))), sqrt((1.0 - (((t_2 * t_3) * t_2) + pow(((t_4 * cos((phi2 * 0.5))) - (t_1 * 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(phi2 * 0.5))
	t_2 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_3 = Float64(cos(phi1) * cos(phi2))
	t_4 = sin(Float64(phi1 * 0.5))
	return Float64(Float64(atan(sqrt(fma((Float64(Float64(cos(Float64(lambda2 * 0.5)) * sin(Float64(0.5 * lambda1))) - Float64(sin(Float64(lambda2 * 0.5)) * cos(Float64(0.5 * lambda1)))) ^ 2.0), t_3, (fma(Float64(-t_0), t_1, Float64(cos(Float64(-0.5 * phi2)) * t_4)) ^ 2.0))), sqrt(Float64(1.0 - Float64(Float64(Float64(t_2 * t_3) * t_2) + (Float64(Float64(t_4 * cos(Float64(phi2 * 0.5))) - Float64(t_1 * t_0)) ^ 2.0))))) * 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[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[(N[(N[Cos[N[(lambda2 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[(lambda2 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * t$95$3 + N[Power[N[((-t$95$0) * t$95$1 + N[(N[Cos[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[(t$95$2 * t$95$3), $MachinePrecision] * t$95$2), $MachinePrecision] + N[Power[N[(N[(t$95$4 * N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]]]
\begin{array}{l}

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

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6467.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 rewrites67.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. clear-numN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
    4. associate-/r/N/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) \]
    5. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
    8. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
    9. 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) \]
    10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6481.0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
  6. Applied rewrites81.0%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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. Applied rewrites81.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
  8. Step-by-step derivation
    1. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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{\mathsf{fma}\left({\sin \color{blue}{\left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \color{blue}{\frac{1}{2}}\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\frac{\lambda_1 - \lambda_2}{2}\right)}}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. lift--.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\frac{\color{blue}{\lambda_1 - \lambda_2}}{2}\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. div-subN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \color{blue}{\left(\frac{\lambda_1}{2} - \frac{\lambda_2}{2}\right)}}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. sin-diffN/A

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

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

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

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\color{blue}{\sin \left(\frac{\lambda_1}{2}\right)} \cdot \cos \left(\frac{\lambda_2}{2}\right) - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)} \cdot \cos \left(\frac{\lambda_2}{2}\right) - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \cos \left(\frac{\lambda_2}{2}\right) - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. lift-*.f64N/A

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

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\cos \left(\frac{\lambda_2}{2}\right)} - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \color{blue}{\left(\lambda_2 \cdot \frac{1}{2}\right)} - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \color{blue}{\frac{1}{2}}\right) - \cos \left(\frac{\lambda_1}{2}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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-*.f64N/A

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

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

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\frac{\lambda_1}{2}\right)} \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    20. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \cos \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    21. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \cos \left(\lambda_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\frac{\lambda_2}{2}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    22. lift-*.f64N/A

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

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \cos \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\frac{\lambda_2}{2}\right)}\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    24. div-invN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \cos \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(\lambda_2 \cdot \frac{1}{2}\right)}\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    25. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\left(\sin \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\lambda_2 \cdot \frac{1}{2}\right) - \cos \left(\lambda_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\lambda_2 \cdot \color{blue}{\frac{1}{2}}\right)\right)}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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. Applied rewrites81.5%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\color{blue}{\left(\sin \left(\lambda_1 \cdot 0.5\right) \cdot \cos \left(\lambda_2 \cdot 0.5\right) - \cos \left(\lambda_1 \cdot 0.5\right) \cdot \sin \left(\lambda_2 \cdot 0.5\right)\right)}}^{2}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
  10. Final simplification81.5%

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

Alternative 2: 78.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_2 := \sin \left(\phi_2 \cdot 0.5\right)\\ t_3 := \cos \phi_1 \cdot \cos \phi_2\\ t_4 := \sin \left(\phi_1 \cdot 0.5\right)\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, t\_3, {\left(\mathsf{fma}\left(-t\_1, t\_2, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_4\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\left(t\_0 \cdot t\_3\right) \cdot t\_0 + {\left(t\_4 \cdot \cos \left(\phi_2 \cdot 0.5\right) - t\_2 \cdot t\_1\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 0.5)))
        (t_2 (sin (* phi2 0.5)))
        (t_3 (* (cos phi1) (cos phi2)))
        (t_4 (sin (* phi1 0.5))))
   (*
    (*
     (atan2
      (sqrt
       (fma
        (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
        t_3
        (pow (fma (- t_1) t_2 (* (cos (* -0.5 phi2)) t_4)) 2.0)))
      (sqrt
       (-
        1.0
        (+
         (* (* t_0 t_3) t_0)
         (pow (- (* t_4 (cos (* phi2 0.5))) (* t_2 t_1)) 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 * 0.5));
	double t_2 = sin((phi2 * 0.5));
	double t_3 = cos(phi1) * cos(phi2);
	double t_4 = sin((phi1 * 0.5));
	return (atan2(sqrt(fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), t_3, pow(fma(-t_1, t_2, (cos((-0.5 * phi2)) * t_4)), 2.0))), sqrt((1.0 - (((t_0 * t_3) * t_0) + pow(((t_4 * cos((phi2 * 0.5))) - (t_2 * t_1)), 2.0))))) * 2.0) * R;
}
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_1 = cos(Float64(phi1 * 0.5))
	t_2 = sin(Float64(phi2 * 0.5))
	t_3 = Float64(cos(phi1) * cos(phi2))
	t_4 = sin(Float64(phi1 * 0.5))
	return Float64(Float64(atan(sqrt(fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), t_3, (fma(Float64(-t_1), t_2, Float64(cos(Float64(-0.5 * phi2)) * t_4)) ^ 2.0))), sqrt(Float64(1.0 - Float64(Float64(Float64(t_0 * t_3) * t_0) + (Float64(Float64(t_4 * cos(Float64(phi2 * 0.5))) - Float64(t_2 * t_1)) ^ 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[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * t$95$3 + N[Power[N[((-t$95$1) * t$95$2 + N[(N[Cos[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[(t$95$0 * t$95$3), $MachinePrecision] * t$95$0), $MachinePrecision] + N[Power[N[(N[(t$95$4 * N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * t$95$1), $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 \left(\phi_1 \cdot 0.5\right)\\
t_2 := \sin \left(\phi_2 \cdot 0.5\right)\\
t_3 := \cos \phi_1 \cdot \cos \phi_2\\
t_4 := \sin \left(\phi_1 \cdot 0.5\right)\\
\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, t\_3, {\left(\mathsf{fma}\left(-t\_1, t\_2, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_4\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\left(t\_0 \cdot t\_3\right) \cdot t\_0 + {\left(t\_4 \cdot \cos \left(\phi_2 \cdot 0.5\right) - t\_2 \cdot t\_1\right)}^{2}\right)}} \cdot 2\right) \cdot R
\end{array}
\end{array}
Derivation
  1. Initial program 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6467.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 rewrites67.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. clear-numN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
    4. associate-/r/N/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) \]
    5. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
    8. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
    9. 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) \]
    10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6481.0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
  6. Applied rewrites81.0%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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. Applied rewrites81.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
  8. Final simplification81.0%

    \[\leadsto \left(\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, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_2 \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)}}{\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(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \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 \]
  9. Add Preprocessing

Alternative 3: 78.8% 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 := \sin \left(\phi_2 \cdot 0.5\right)\\ t_3 := \sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1 \cdot \cos \phi_2, {\left(\mathsf{fma}\left(-t\_1, t\_2, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_0\right)\right)}^{2}\right)}\\ t_4 := {\left(\mathsf{fma}\left(-t\_2, t\_1, t\_0 \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\right)}^{2}\\ t_5 := \left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_4\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\lambda_1 \leq -1.15 \cdot 10^{-5}:\\ \;\;\;\;t\_5\\ \mathbf{elif}\;\lambda_1 \leq 5.6 \cdot 10^{-6}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - \mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_4\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;t\_5\\ \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 (sin (* phi2 0.5)))
        (t_3
         (sqrt
          (fma
           (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
           (* (cos phi1) (cos phi2))
           (pow (fma (- t_1) t_2 (* (cos (* -0.5 phi2)) t_0)) 2.0))))
        (t_4 (pow (fma (- t_2) t_1 (* t_0 (cos (* phi2 0.5)))) 2.0))
        (t_5
         (*
          (*
           (atan2
            t_3
            (sqrt
             (-
              1.0
              (fma
               (* (pow (sin (* 0.5 lambda1)) 2.0) (cos phi2))
               (cos phi1)
               t_4))))
           2.0)
          R)))
   (if (<= lambda1 -1.15e-5)
     t_5
     (if (<= lambda1 5.6e-6)
       (*
        (*
         (atan2
          t_3
          (sqrt
           (-
            1.0
            (fma
             (* (pow (sin (* -0.5 lambda2)) 2.0) (cos phi2))
             (cos phi1)
             t_4))))
         2.0)
        R)
       t_5))))
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 = sin((phi2 * 0.5));
	double t_3 = sqrt(fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), (cos(phi1) * cos(phi2)), pow(fma(-t_1, t_2, (cos((-0.5 * phi2)) * t_0)), 2.0)));
	double t_4 = pow(fma(-t_2, t_1, (t_0 * cos((phi2 * 0.5)))), 2.0);
	double t_5 = (atan2(t_3, sqrt((1.0 - fma((pow(sin((0.5 * lambda1)), 2.0) * cos(phi2)), cos(phi1), t_4)))) * 2.0) * R;
	double tmp;
	if (lambda1 <= -1.15e-5) {
		tmp = t_5;
	} else if (lambda1 <= 5.6e-6) {
		tmp = (atan2(t_3, sqrt((1.0 - fma((pow(sin((-0.5 * lambda2)), 2.0) * cos(phi2)), cos(phi1), t_4)))) * 2.0) * R;
	} else {
		tmp = t_5;
	}
	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 = sin(Float64(phi2 * 0.5))
	t_3 = sqrt(fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), Float64(cos(phi1) * cos(phi2)), (fma(Float64(-t_1), t_2, Float64(cos(Float64(-0.5 * phi2)) * t_0)) ^ 2.0)))
	t_4 = fma(Float64(-t_2), t_1, Float64(t_0 * cos(Float64(phi2 * 0.5)))) ^ 2.0
	t_5 = Float64(Float64(atan(t_3, sqrt(Float64(1.0 - fma(Float64((sin(Float64(0.5 * lambda1)) ^ 2.0) * cos(phi2)), cos(phi1), t_4)))) * 2.0) * R)
	tmp = 0.0
	if (lambda1 <= -1.15e-5)
		tmp = t_5;
	elseif (lambda1 <= 5.6e-6)
		tmp = Float64(Float64(atan(t_3, sqrt(Float64(1.0 - fma(Float64((sin(Float64(-0.5 * lambda2)) ^ 2.0) * cos(phi2)), cos(phi1), t_4)))) * 2.0) * R);
	else
		tmp = t_5;
	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[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[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] + N[Power[N[((-t$95$1) * t$95$2 + N[(N[Cos[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[((-t$95$2) * t$95$1 + N[(t$95$0 * N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[lambda1, -1.15e-5], t$95$5, If[LessEqual[lambda1, 5.6e-6], N[(N[(N[ArcTan[t$95$3 / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], t$95$5]]]]]]]]
\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 := \sin \left(\phi_2 \cdot 0.5\right)\\
t_3 := \sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, \cos \phi_1 \cdot \cos \phi_2, {\left(\mathsf{fma}\left(-t\_1, t\_2, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_0\right)\right)}^{2}\right)}\\
t_4 := {\left(\mathsf{fma}\left(-t\_2, t\_1, t\_0 \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\right)}^{2}\\
t_5 := \left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_4\right)}} \cdot 2\right) \cdot R\\
\mathbf{if}\;\lambda_1 \leq -1.15 \cdot 10^{-5}:\\
\;\;\;\;t\_5\\

\mathbf{elif}\;\lambda_1 \leq 5.6 \cdot 10^{-6}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{t\_3}{\sqrt{1 - \mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, t\_4\right)}} \cdot 2\right) \cdot R\\

\mathbf{else}:\\
\;\;\;\;t\_5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if lambda1 < -1.15e-5 or 5.59999999999999975e-6 < lambda1

    1. Initial program 54.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-*.f6455.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 rewrites55.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. clear-numN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
      4. associate-/r/N/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) \]
      5. metadata-evalN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
      8. lift-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
      9. 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) \]
      10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6464.0

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
    6. Applied rewrites64.0%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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. Applied rewrites64.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
    8. Taylor expanded in lambda2 around 0

      \[\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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    9. Step-by-step derivation
      1. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) \cdot \cos \phi_1} + {\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) \]
      2. lower-fma.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, \cos \phi_1, {\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) \]
      3. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      4. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      5. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} \cdot \cos \phi_2, \cos \phi_1, {\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. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      7. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      9. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \color{blue}{\cos \phi_2}, \cos \phi_1, {\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) \]
      10. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_2, \color{blue}{\cos \phi_1}, {\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) \]
      11. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, \color{blue}{{\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) \]
    10. Applied rewrites63.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\lambda_1 \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(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)}}}\right) \]

    if -1.15e-5 < lambda1 < 5.59999999999999975e-6

    1. Initial program 80.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. 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.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 rewrites80.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. clear-numN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
      4. associate-/r/N/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) \]
      5. metadata-evalN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
      8. lift-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
      9. 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) \]
      10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6498.2

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
    6. Applied rewrites98.2%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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. Applied rewrites98.2%

      \[\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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
    8. Taylor expanded in lambda1 around 0

      \[\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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\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)}}}\right) \]
    9. Step-by-step derivation
      1. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}\right) \cdot \cos \phi_1} + {\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) \]
      2. lower-fma.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}, \cos \phi_1, {\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) \]
      3. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      4. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      5. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}} \cdot \cos \phi_2, \cos \phi_1, {\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. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      7. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_2 \cdot \frac{-1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_2 \cdot \frac{-1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      9. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2} \cdot \color{blue}{\cos \phi_2}, \cos \phi_1, {\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) \]
      10. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2} \cdot \cos \phi_2, \color{blue}{\cos \phi_1}, {\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) \]
      11. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, \color{blue}{{\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) \]
    10. Applied rewrites98.2%

      \[\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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\lambda_2 \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(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)}}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 \leq -1.15 \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 \cdot \cos \phi_2, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_2 \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)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\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), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\lambda_1 \leq 5.6 \cdot 10^{-6}:\\ \;\;\;\;\left(\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, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_2 \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)}}{\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(-\sin \left(\phi_2 \cdot 0.5\right), \cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\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 \cdot \cos \phi_2, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_2 \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)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\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), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \phi_1 \cdot \cos \phi_2\\ t_1 := \left(-0.5\right) \cdot \phi_2\\ t_2 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_4 := \left(t\_3 \cdot t\_0\right) \cdot t\_3\\ t_5 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_6 := t\_5 \cdot \cos \left(\phi_2 \cdot 0.5\right)\\ t_7 := \sin \left(\phi_2 \cdot 0.5\right)\\ \mathbf{if}\;\lambda_2 \leq -2.05 \cdot 10^{+22}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(t\_5, \cos t\_1, \sin t\_1 \cdot t\_2\right)\right)}^{2} + t\_4}}{\sqrt{1 - \mathsf{fma}\left(t\_0, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\lambda_2 \leq 3.9 \cdot 10^{-19}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, t\_0, {\left(\mathsf{fma}\left(-t\_2, t\_7, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_5\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(-t\_7, t\_2, t\_6\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t\_4}}{\sqrt{1 - \left(t\_4 + {\left(t\_6 - t\_7 \cdot t\_2\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 (* (- 0.5) phi2))
        (t_2 (cos (* phi1 0.5)))
        (t_3 (sin (/ (- lambda1 lambda2) 2.0)))
        (t_4 (* (* t_3 t_0) t_3))
        (t_5 (sin (* phi1 0.5)))
        (t_6 (* t_5 (cos (* phi2 0.5))))
        (t_7 (sin (* phi2 0.5))))
   (if (<= lambda2 -2.05e+22)
     (*
      (*
       (atan2
        (sqrt (+ (pow (fma t_5 (cos t_1) (* (sin t_1) t_2)) 2.0) t_4))
        (sqrt
         (-
          1.0
          (fma
           t_0
           (pow (sin (* -0.5 lambda2)) 2.0)
           (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))))
       2.0)
      R)
     (if (<= lambda2 3.9e-19)
       (*
        (*
         (atan2
          (sqrt
           (fma
            (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)
            t_0
            (pow (fma (- t_2) t_7 (* (cos (* -0.5 phi2)) t_5)) 2.0)))
          (sqrt
           (-
            1.0
            (fma
             (* (pow (sin (* 0.5 lambda1)) 2.0) (cos phi2))
             (cos phi1)
             (pow (fma (- t_7) t_2 t_6) 2.0)))))
         2.0)
        R)
       (*
        (*
         (atan2
          (sqrt (+ (pow (sin (/ (- phi1 phi2) 2.0)) 2.0) t_4))
          (sqrt (- 1.0 (+ t_4 (pow (- t_6 (* t_7 t_2)) 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 = -0.5 * phi2;
	double t_2 = cos((phi1 * 0.5));
	double t_3 = sin(((lambda1 - lambda2) / 2.0));
	double t_4 = (t_3 * t_0) * t_3;
	double t_5 = sin((phi1 * 0.5));
	double t_6 = t_5 * cos((phi2 * 0.5));
	double t_7 = sin((phi2 * 0.5));
	double tmp;
	if (lambda2 <= -2.05e+22) {
		tmp = (atan2(sqrt((pow(fma(t_5, cos(t_1), (sin(t_1) * t_2)), 2.0) + t_4)), sqrt((1.0 - fma(t_0, pow(sin((-0.5 * lambda2)), 2.0), pow(sin(((phi1 - phi2) * 0.5)), 2.0))))) * 2.0) * R;
	} else if (lambda2 <= 3.9e-19) {
		tmp = (atan2(sqrt(fma(pow(sin(((lambda1 - lambda2) * 0.5)), 2.0), t_0, pow(fma(-t_2, t_7, (cos((-0.5 * phi2)) * t_5)), 2.0))), sqrt((1.0 - fma((pow(sin((0.5 * lambda1)), 2.0) * cos(phi2)), cos(phi1), pow(fma(-t_7, t_2, t_6), 2.0))))) * 2.0) * R;
	} else {
		tmp = (atan2(sqrt((pow(sin(((phi1 - phi2) / 2.0)), 2.0) + t_4)), sqrt((1.0 - (t_4 + pow((t_6 - (t_7 * t_2)), 2.0))))) * 2.0) * R;
	}
	return tmp;
}
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = Float64(cos(phi1) * cos(phi2))
	t_1 = Float64(Float64(-0.5) * phi2)
	t_2 = cos(Float64(phi1 * 0.5))
	t_3 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_4 = Float64(Float64(t_3 * t_0) * t_3)
	t_5 = sin(Float64(phi1 * 0.5))
	t_6 = Float64(t_5 * cos(Float64(phi2 * 0.5)))
	t_7 = sin(Float64(phi2 * 0.5))
	tmp = 0.0
	if (lambda2 <= -2.05e+22)
		tmp = Float64(Float64(atan(sqrt(Float64((fma(t_5, cos(t_1), Float64(sin(t_1) * t_2)) ^ 2.0) + t_4)), sqrt(Float64(1.0 - fma(t_0, (sin(Float64(-0.5 * lambda2)) ^ 2.0), (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))))) * 2.0) * R);
	elseif (lambda2 <= 3.9e-19)
		tmp = Float64(Float64(atan(sqrt(fma((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0), t_0, (fma(Float64(-t_2), t_7, Float64(cos(Float64(-0.5 * phi2)) * t_5)) ^ 2.0))), sqrt(Float64(1.0 - fma(Float64((sin(Float64(0.5 * lambda1)) ^ 2.0) * cos(phi2)), cos(phi1), (fma(Float64(-t_7), t_2, t_6) ^ 2.0))))) * 2.0) * R);
	else
		tmp = Float64(Float64(atan(sqrt(Float64((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + t_4)), sqrt(Float64(1.0 - Float64(t_4 + (Float64(t_6 - Float64(t_7 * t_2)) ^ 2.0))))) * 2.0) * R);
	end
	return tmp
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[((-0.5) * phi2), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 * t$95$0), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[lambda2, -2.05e+22], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[(t$95$5 * N[Cos[t$95$1], $MachinePrecision] + N[(N[Sin[t$95$1], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$0 * N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[lambda2, 3.9e-19], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * t$95$0 + N[Power[N[((-t$95$2) * t$95$7 + N[(N[Cos[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Power[N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + N[Power[N[((-t$95$7) * t$95$2 + t$95$6), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$4 + N[Power[N[(t$95$6 - N[(t$95$7 * t$95$2), $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 := \left(-0.5\right) \cdot \phi_2\\
t_2 := \cos \left(\phi_1 \cdot 0.5\right)\\
t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_4 := \left(t\_3 \cdot t\_0\right) \cdot t\_3\\
t_5 := \sin \left(\phi_1 \cdot 0.5\right)\\
t_6 := t\_5 \cdot \cos \left(\phi_2 \cdot 0.5\right)\\
t_7 := \sin \left(\phi_2 \cdot 0.5\right)\\
\mathbf{if}\;\lambda_2 \leq -2.05 \cdot 10^{+22}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(t\_5, \cos t\_1, \sin t\_1 \cdot t\_2\right)\right)}^{2} + t\_4}}{\sqrt{1 - \mathsf{fma}\left(t\_0, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\

\mathbf{elif}\;\lambda_2 \leq 3.9 \cdot 10^{-19}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}, t\_0, {\left(\mathsf{fma}\left(-t\_2, t\_7, \cos \left(-0.5 \cdot \phi_2\right) \cdot t\_5\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, {\left(\mathsf{fma}\left(-t\_7, t\_2, t\_6\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\

\mathbf{else}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t\_4}}{\sqrt{1 - \left(t\_4 + {\left(t\_6 - t\_7 \cdot t\_2\right)}^{2}\right)}} \cdot 2\right) \cdot R\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if lambda2 < -2.0499999999999999e22

    1. Initial program 49.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{{\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-/.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{\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)}}{\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. div-subN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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. sub-negN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{\phi_1}{2} + \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. sin-sumN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right) + \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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-fma.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\frac{\phi_1}{2}\right), \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\color{blue}{\sin \left(\frac{\phi_1}{2}\right)}, \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)}, \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right), \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\sin \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)}, \cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \color{blue}{\cos \left(\mathsf{neg}\left(\frac{\phi_2}{2}\right)\right)}, \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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-neg.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \color{blue}{\left(-\frac{\phi_2}{2}\right)}, \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. div-invN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\color{blue}{\phi_2 \cdot \frac{1}{2}}\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. metadata-evalN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \color{blue}{\frac{1}{2}}\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\color{blue}{\phi_2 \cdot \frac{1}{2}}\right), \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \color{blue}{\cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. lower-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \color{blue}{\cos \left(\frac{\phi_1}{2}\right)} \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. div-invN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. metadata-evalN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \cos \left(\phi_1 \cdot \color{blue}{\frac{1}{2}}\right) \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \cos \color{blue}{\left(\phi_1 \cdot \frac{1}{2}\right)} \cdot \sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. lower-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\sin \left(\mathsf{neg}\left(\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. lower-neg.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \cos \left(-\phi_2 \cdot \frac{1}{2}\right), \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \color{blue}{\left(-\frac{\phi_2}{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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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. div-invN/A

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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) \]
      26. lower-*.f6450.5

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot 0.5\right), \cos \left(-\phi_2 \cdot 0.5\right), \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(-\color{blue}{\phi_2 \cdot 0.5}\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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.5%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot 0.5\right), \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)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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) \]
    5. Taylor expanded in lambda1 around 0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\frac{-1}{2} \cdot \lambda_2\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{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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_1 \cdot \cos \phi_2, {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}\right) \]
      3. lower-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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}{\cos \phi_1 \cdot \cos \phi_2}, {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
      4. lower-cos.f64N/A

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

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

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \color{blue}{\left(\lambda_2 \cdot \frac{-1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \]
      9. lower-*.f64N/A

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \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) \]
      11. mul-1-negN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \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) \]
      12. lower-pow.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \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) \]
      13. lower-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \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) \]
      14. *-commutativeN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2}, {\sin \color{blue}{\left(\left(\phi_1 + -1 \cdot \phi_2\right) \cdot \frac{1}{2}\right)}}^{2}\right)}}\right) \]
      15. lower-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2}, {\sin \color{blue}{\left(\left(\phi_1 + -1 \cdot \phi_2\right) \cdot \frac{1}{2}\right)}}^{2}\right)}}\right) \]
      16. mul-1-negN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2}, {\sin \left(\left(\phi_1 + \color{blue}{\left(\mathsf{neg}\left(\phi_2\right)\right)}\right) \cdot \frac{1}{2}\right)}^{2}\right)}}\right) \]
      17. sub-negN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot \frac{-1}{2}\right)}^{2}, {\sin \left(\color{blue}{\left(\phi_1 - \phi_2\right)} \cdot \frac{1}{2}\right)}^{2}\right)}}\right) \]
      18. lower--.f6450.7

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot 0.5\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\color{blue}{\left(\phi_1 - \phi_2\right)} \cdot 0.5\right)}^{2}\right)}}\right) \]
    7. Applied rewrites50.7%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot 0.5\right), \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)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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_1 \cdot \cos \phi_2, {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}\right) \]

    if -2.0499999999999999e22 < lambda2 < 3.89999999999999995e-19

    1. Initial program 78.1%

      \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6478.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 - \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 rewrites78.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 - \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. clear-numN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
      4. associate-/r/N/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) \]
      5. metadata-evalN/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
      8. lift-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
      9. 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) \]
      10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6496.1

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
    6. Applied rewrites96.1%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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. Applied rewrites96.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{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) \]
    8. Taylor expanded in lambda2 around 0

      \[\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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{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) \]
    9. Step-by-step derivation
      1. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \left(\color{blue}{\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}\right) \cdot \cos \phi_1} + {\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) \]
      2. lower-fma.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left(\cos \phi_2 \cdot {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}, \cos \phi_1, {\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) \]
      3. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      4. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2} \cdot \cos \phi_2}, \cos \phi_1, {\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) \]
      5. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left(\color{blue}{{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}} \cdot \cos \phi_2, \cos \phi_1, {\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. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\color{blue}{\sin \left(\frac{1}{2} \cdot \lambda_1\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      7. *-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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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. lower-*.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}}^{2} \cdot \cos \phi_2, \cos \phi_1, {\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) \]
      9. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \color{blue}{\cos \phi_2}, \cos \phi_1, {\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) \]
      10. 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}, \cos \phi_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_2, \color{blue}{\cos \phi_1}, {\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) \]
      11. 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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot \frac{1}{2}\right), \sin \left(\frac{1}{2} \cdot \phi_2\right), \sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{-1}{2}\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(\lambda_1 \cdot \frac{1}{2}\right)}^{2} \cdot \cos \phi_2, \cos \phi_1, \color{blue}{{\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) \]
    10. Applied rewrites95.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_2 \cdot \cos \phi_1, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(0.5 \cdot \phi_2\right), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)\right)}^{2}\right)}}{\sqrt{1 - \color{blue}{\mathsf{fma}\left({\sin \left(\lambda_1 \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(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)}}}\right) \]

    if 3.89999999999999995e-19 < lambda2

    1. Initial program 57.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. 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-*.f6458.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 rewrites58.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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_2 \leq -2.05 \cdot 10^{+22}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\left(\mathsf{fma}\left(\sin \left(\phi_1 \cdot 0.5\right), \cos \left(\left(-0.5\right) \cdot \phi_2\right), \sin \left(\left(-0.5\right) \cdot \phi_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2} + \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)}}{\sqrt{1 - \mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\lambda_2 \leq 3.9 \cdot 10^{-19}:\\ \;\;\;\;\left(\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, {\left(\mathsf{fma}\left(-\cos \left(\phi_1 \cdot 0.5\right), \sin \left(\phi_2 \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)}}{\sqrt{1 - \mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\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), \sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right)\right)\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \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)}}{\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(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \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} \]
  5. Add Preprocessing

Alternative 5: 78.9% accurate, 0.7× speedup?

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

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6467.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 rewrites67.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. clear-numN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(\frac{1}{\frac{2}{\phi_1 - \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) \]
    4. associate-/r/N/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) \]
    5. metadata-evalN/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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. distribute-rgt-out--N/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) \]
    8. lift-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\color{blue}{\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) \]
    9. 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) \]
    10. sin-diffN/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(\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)}}{\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-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(\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)}}{\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-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \color{blue}{\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)}}{\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. lift-*.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(\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)}}{\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. lift-cos.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift-sin.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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(\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)}}{\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-*.f64N/A

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \cos \left(\phi_2 \cdot \frac{1}{2}\right) - \color{blue}{\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)}}{\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. lift--.f6481.0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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)}}{\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) \]
  6. Applied rewrites81.0%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\left(\cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(0.5 \cdot \phi_1\right) - \sin \left(\phi_2 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_1\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \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 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) + {\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_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)} \]
  8. Applied rewrites80.9%

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

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

Alternative 6: 63.3% accurate, 0.8× 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\\ \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t\_1}}{\sqrt{1 - \left(t\_1 + {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \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} \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)))
   (*
    (*
     (atan2
      (sqrt (+ (pow (sin (/ (- phi1 phi2) 2.0)) 2.0) t_1))
      (sqrt
       (-
        1.0
        (+
         t_1
         (pow
          (-
           (* (sin (* phi1 0.5)) (cos (* phi2 0.5)))
           (* (sin (* phi2 0.5)) (cos (* phi1 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));
	double t_1 = (t_0 * (cos(phi1) * cos(phi2))) * t_0;
	return (atan2(sqrt((pow(sin(((phi1 - phi2) / 2.0)), 2.0) + t_1)), sqrt((1.0 - (t_1 + pow(((sin((phi1 * 0.5)) * cos((phi2 * 0.5))) - (sin((phi2 * 0.5)) * cos((phi1 * 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
    real(8) :: t_1
    t_0 = sin(((lambda1 - lambda2) / 2.0d0))
    t_1 = (t_0 * (cos(phi1) * cos(phi2))) * t_0
    code = (atan2(sqrt(((sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0) + t_1)), sqrt((1.0d0 - (t_1 + (((sin((phi1 * 0.5d0)) * cos((phi2 * 0.5d0))) - (sin((phi2 * 0.5d0)) * cos((phi1 * 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));
	double t_1 = (t_0 * (Math.cos(phi1) * Math.cos(phi2))) * t_0;
	return (Math.atan2(Math.sqrt((Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0) + t_1)), Math.sqrt((1.0 - (t_1 + Math.pow(((Math.sin((phi1 * 0.5)) * Math.cos((phi2 * 0.5))) - (Math.sin((phi2 * 0.5)) * Math.cos((phi1 * 0.5)))), 2.0))))) * 2.0) * R;
}
def code(R, lambda1, lambda2, phi1, phi2):
	t_0 = math.sin(((lambda1 - lambda2) / 2.0))
	t_1 = (t_0 * (math.cos(phi1) * math.cos(phi2))) * t_0
	return (math.atan2(math.sqrt((math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0) + t_1)), math.sqrt((1.0 - (t_1 + math.pow(((math.sin((phi1 * 0.5)) * math.cos((phi2 * 0.5))) - (math.sin((phi2 * 0.5)) * math.cos((phi1 * 0.5)))), 2.0))))) * 2.0) * R
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_1 = Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0)
	return Float64(Float64(atan(sqrt(Float64((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + t_1)), sqrt(Float64(1.0 - Float64(t_1 + (Float64(Float64(sin(Float64(phi1 * 0.5)) * cos(Float64(phi2 * 0.5))) - Float64(sin(Float64(phi2 * 0.5)) * cos(Float64(phi1 * 0.5)))) ^ 2.0))))) * 2.0) * R)
end
function tmp = code(R, lambda1, lambda2, phi1, phi2)
	t_0 = sin(((lambda1 - lambda2) / 2.0));
	t_1 = (t_0 * (cos(phi1) * cos(phi2))) * t_0;
	tmp = (atan2(sqrt(((sin(((phi1 - phi2) / 2.0)) ^ 2.0) + t_1)), sqrt((1.0 - (t_1 + (((sin((phi1 * 0.5)) * cos((phi2 * 0.5))) - (sin((phi2 * 0.5)) * cos((phi1 * 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]}, Block[{t$95$1 = N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(t$95$1 + N[Power[N[(N[(N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[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 := \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\\
\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t\_1}}{\sqrt{1 - \left(t\_1 + {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \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}
\end{array}
Derivation
  1. Initial program 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6467.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 rewrites67.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. Final simplification67.8%

    \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \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)}}{\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(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \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 \]
  6. Add Preprocessing

Alternative 7: 63.3% accurate, 0.8× 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\\ \left(2 \cdot R\right) \cdot \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{1 - \mathsf{fma}\left(t\_1, t\_0, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \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))))
   (*
    (* 2.0 R)
    (atan2
     (sqrt (fma t_1 t_0 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
     (sqrt
      (-
       1.0
       (fma
        t_1
        t_0
        (pow
         (fma
          (sin (* -0.5 phi2))
          (cos (* -0.5 phi1))
          (* (cos (* -0.5 phi2)) (sin (* phi1 0.5))))
         2.0))))))))
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);
	return (2.0 * R) * atan2(sqrt(fma(t_1, t_0, pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((1.0 - fma(t_1, t_0, pow(fma(sin((-0.5 * phi2)), cos((-0.5 * phi1)), (cos((-0.5 * phi2)) * sin((phi1 * 0.5)))), 2.0)))));
}
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))
	return Float64(Float64(2.0 * R) * atan(sqrt(fma(t_1, t_0, (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64(1.0 - fma(t_1, t_0, (fma(sin(Float64(-0.5 * phi2)), cos(Float64(-0.5 * phi1)), Float64(cos(Float64(-0.5 * phi2)) * sin(Float64(phi1 * 0.5)))) ^ 2.0))))))
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]}, N[(N[(2.0 * R), $MachinePrecision] * 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[(1.0 - N[(t$95$1 * t$95$0 + N[Power[N[(N[Sin[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision] + N[(N[Cos[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\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\\
\left(2 \cdot R\right) \cdot \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{1 - \mathsf{fma}\left(t\_1, t\_0, {\left(\mathsf{fma}\left(\sin \left(-0.5 \cdot \phi_2\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}}
\end{array}
\end{array}
Derivation
  1. Initial program 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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-*.f6467.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 rewrites67.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. 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) + {\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 rewrites67.8%

    \[\leadsto \color{blue}{\left(2 \cdot R\right) \cdot \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(-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)}}} \]
  7. Final simplification67.8%

    \[\leadsto \left(2 \cdot R\right) \cdot \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(-0.5 \cdot \phi_2\right), \cos \left(-0.5 \cdot \phi_1\right), \cos \left(-0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right)\right)\right)}^{2}\right)}} \]
  8. Add Preprocessing

Alternative 8: 62.9% 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{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0}}{\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_1 + \phi_2\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
       (+
        (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)
        (* (* t_0 (* (cos phi1) (cos phi2))) t_0)))
      (sqrt
       (-
        1.0
        (/
         (fma
          (-
           (cos (/ 0.0 (/ 2.0 (- phi1 phi2))))
           (cos (* (* (- phi1 phi2) 0.5) 2.0)))
          2.0
          (*
           (*
            (+ (cos (+ phi1 phi2)) (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((pow(sin(((phi1 - phi2) / 2.0)), 2.0) + ((t_0 * (cos(phi1) * cos(phi2))) * t_0))), sqrt((1.0 - (fma((cos((0.0 / (2.0 / (phi1 - phi2)))) - cos((((phi1 - phi2) * 0.5) * 2.0))), 2.0, (((cos((phi1 + phi2)) + 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((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + Float64(Float64(t_0 * Float64(cos(phi1) * cos(phi2))) * t_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(phi1 + phi2)) + 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[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$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[(phi1 + phi2), $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{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(t\_0 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) \cdot t\_0}}{\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_1 + \phi_2\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 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 rewrites67.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}{\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 simplification67.5%

    \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \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)}}{\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_1 + \phi_2\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.4% 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}\\ \left(2 \cdot R\right) \cdot \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}} \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)))
   (*
    (* 2.0 R)
    (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)))))))
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 (2.0 * R) * 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))));
}
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(2.0 * R) * 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)))))
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[(2.0 * R), $MachinePrecision] * 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]), $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(2 \cdot R\right) \cdot \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}}
\end{array}
\end{array}
Derivation
  1. Initial program 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 rewrites67.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{{\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 simplification67.3%

    \[\leadsto \left(2 \cdot R\right) \cdot \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)}} \]
  5. Add Preprocessing

Alternative 10: 62.3% 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 67.1%

    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 rewrites67.1%

    \[\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 simplification67.1%

    \[\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 11: 63.0% 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\\ t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ t_3 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_4 := \sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}\\ \mathbf{if}\;\phi_1 \leq -4.9 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_3 + t\_1}}{t\_4} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_1 \leq 0.00053:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + 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{\sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, t\_3\right)}}{t\_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)))
        (t_1 (* (* t_0 (* (cos phi1) (cos phi2))) t_0))
        (t_2 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
        (t_3 (pow (sin (* phi1 0.5)) 2.0))
        (t_4 (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) (* t_2 (cos phi1))))))
   (if (<= phi1 -4.9e-5)
     (* (* (atan2 (sqrt (+ t_3 t_1)) t_4) 2.0) R)
     (if (<= phi1 0.00053)
       (*
        (*
         (atan2
          (sqrt (+ (pow (sin (/ (- phi1 phi2) 2.0)) 2.0) t_1))
          (sqrt (- (pow (cos (* phi2 0.5)) 2.0) (* t_2 (cos phi2)))))
         2.0)
        R)
       (* (* (atan2 (sqrt (fma t_2 (cos phi1) t_3)) t_4) 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;
	double t_2 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
	double t_3 = pow(sin((phi1 * 0.5)), 2.0);
	double t_4 = sqrt((pow(cos((-0.5 * phi1)), 2.0) - (t_2 * cos(phi1))));
	double tmp;
	if (phi1 <= -4.9e-5) {
		tmp = (atan2(sqrt((t_3 + t_1)), t_4) * 2.0) * R;
	} else if (phi1 <= 0.00053) {
		tmp = (atan2(sqrt((pow(sin(((phi1 - phi2) / 2.0)), 2.0) + t_1)), sqrt((pow(cos((phi2 * 0.5)), 2.0) - (t_2 * cos(phi2))))) * 2.0) * R;
	} else {
		tmp = (atan2(sqrt(fma(t_2, cos(phi1), t_3)), t_4) * 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(t_0 * Float64(cos(phi1) * cos(phi2))) * t_0)
	t_2 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
	t_3 = sin(Float64(phi1 * 0.5)) ^ 2.0
	t_4 = sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - Float64(t_2 * cos(phi1))))
	tmp = 0.0
	if (phi1 <= -4.9e-5)
		tmp = Float64(Float64(atan(sqrt(Float64(t_3 + t_1)), t_4) * 2.0) * R);
	elseif (phi1 <= 0.00053)
		tmp = Float64(Float64(atan(sqrt(Float64((sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0) + t_1)), sqrt(Float64((cos(Float64(phi2 * 0.5)) ^ 2.0) - Float64(t_2 * cos(phi2))))) * 2.0) * R);
	else
		tmp = Float64(Float64(atan(sqrt(fma(t_2, cos(phi1), t_3)), t_4) * 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[(t$95$0 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $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[Power[N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$4 = 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]}, If[LessEqual[phi1, -4.9e-5], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$3 + t$95$1), $MachinePrecision]], $MachinePrecision] / t$95$4], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[phi1, 0.00053], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + t$95$1), $MachinePrecision]], $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[N[Sqrt[N[(t$95$2 * N[Cos[phi1], $MachinePrecision] + t$95$3), $MachinePrecision]], $MachinePrecision] / t$95$4], $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\\
t_2 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
t_3 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\
t_4 := \sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_2 \cdot \cos \phi_1}\\
\mathbf{if}\;\phi_1 \leq -4.9 \cdot 10^{-5}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_3 + t\_1}}{t\_4} \cdot 2\right) \cdot R\\

\mathbf{elif}\;\phi_1 \leq 0.00053:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + 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{\sqrt{\mathsf{fma}\left(t\_2, \cos \phi_1, t\_3\right)}}{t\_4} \cdot 2\right) \cdot R\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if phi1 < -4.9e-5

    1. Initial program 59.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 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 rewrites60.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}{{\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}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_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) \]
    7. Step-by-step derivation
      1. lower-sin.f64N/A

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(\frac{1}{2} \cdot \phi_1\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_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. lower-*.f6460.9

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \color{blue}{\left(0.5 \cdot \phi_1\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_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 -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]
    8. Applied rewrites60.9%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\color{blue}{\sin \left(0.5 \cdot \phi_1\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_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 -0.5\right)}^{2} - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2} \cdot \cos \phi_1}}\right) \]

    if -4.9e-5 < phi1 < 5.29999999999999981e-4

    1. Initial program 79.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 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 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_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 5.29999999999999981e-4 < phi1

    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 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 rewrites51.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-*.f6451.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 rewrites51.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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_1 \leq -4.9 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\phi_1 \cdot 0.5\right)}^{2} + \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)}}{\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 0.00053:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \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)}}{\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 12: 58.0% 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 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -115:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\phi_2 \leq 0.106:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_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} - 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 (* (- lambda1 lambda2) 0.5)) 2.0))
        (t_1 (* t_0 (cos phi1)))
        (t_2
         (*
          (*
           (atan2
            (sqrt (fma t_0 (cos phi2) (pow (sin (* -0.5 phi2)) 2.0)))
            (sqrt
             (-
              1.0
              (+
               (*
                (sin (* 0.5 lambda1))
                (*
                 (sin (/ (- lambda1 lambda2) 2.0))
                 (* (cos phi1) (cos phi2))))
               (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))))
           2.0)
          R)))
   (if (<= phi2 -115.0)
     t_2
     (if (<= phi2 0.106)
       (*
        (*
         (atan2
          (sqrt (fma (cos phi2) t_1 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
          (sqrt (- (pow (cos (* -0.5 phi1)) 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(((lambda1 - lambda2) * 0.5)), 2.0);
	double t_1 = t_0 * cos(phi1);
	double t_2 = (atan2(sqrt(fma(t_0, cos(phi2), pow(sin((-0.5 * phi2)), 2.0))), sqrt((1.0 - ((sin((0.5 * lambda1)) * (sin(((lambda1 - lambda2) / 2.0)) * (cos(phi1) * cos(phi2)))) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))))) * 2.0) * R;
	double tmp;
	if (phi2 <= -115.0) {
		tmp = t_2;
	} else if (phi2 <= 0.106) {
		tmp = (atan2(sqrt(fma(cos(phi2), t_1, pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((pow(cos((-0.5 * phi1)), 2.0) - t_1))) * 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 = Float64(t_0 * cos(phi1))
	t_2 = Float64(Float64(atan(sqrt(fma(t_0, cos(phi2), (sin(Float64(-0.5 * phi2)) ^ 2.0))), sqrt(Float64(1.0 - Float64(Float64(sin(Float64(0.5 * lambda1)) * Float64(sin(Float64(Float64(lambda1 - lambda2) / 2.0)) * Float64(cos(phi1) * cos(phi2)))) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))))) * 2.0) * R)
	tmp = 0.0
	if (phi2 <= -115.0)
		tmp = t_2;
	elseif (phi2 <= 0.106)
		tmp = Float64(Float64(atan(sqrt(fma(cos(phi2), t_1, (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 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[(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[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]}, If[LessEqual[phi2, -115.0], t$95$2, If[LessEqual[phi2, 0.106], N[(N[(N[ArcTan[N[Sqrt[N[(N[Cos[phi2], $MachinePrecision] * t$95$1 + 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[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - t$95$1), $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 := t\_0 \cdot \cos \phi_1\\
t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
\mathbf{if}\;\phi_2 \leq -115:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\phi_2 \leq 0.106:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_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} - t\_1}} \cdot 2\right) \cdot R\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if phi2 < -115 or 0.105999999999999997 < phi2

    1. Initial program 52.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 inf

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 \color{blue}{\left(\frac{1}{2} \cdot \lambda_1\right)}\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}\right)}}\right) \]
      2. lower-*.f6446.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
    5. Applied rewrites46.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
    6. Taylor expanded in phi1 around 0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\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}}}}{\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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\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_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2}, {\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{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_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
      15. lower-*.f6446.6

        \[\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_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]
    8. Applied rewrites46.6%

      \[\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_2, {\sin \left(-0.5 \cdot \phi_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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]

    if -115 < phi2 < 0.105999999999999997

    1. Initial program 79.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 rewrites79.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. 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) \]
      3. lift-*.f64N/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 rewrites79.0%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\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(\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 simplification64.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -115:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 0.106:\\ \;\;\;\;\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({\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)}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 53.1% 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} \cdot \cos \phi_1\\ t_1 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ t_2 := \left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -175:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\phi_2 \leq 0.27:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_0, t\_1\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0}} \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) (cos phi1)))
        (t_1 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
        (t_2
         (*
          (*
           (atan2
            (sqrt t_1)
            (sqrt
             (-
              1.0
              (+
               (*
                (sin (* 0.5 lambda1))
                (*
                 (sin (/ (- lambda1 lambda2) 2.0))
                 (* (cos phi1) (cos phi2))))
               (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))))
           2.0)
          R)))
   (if (<= phi2 -175.0)
     t_2
     (if (<= phi2 0.27)
       (*
        (*
         (atan2
          (sqrt (fma (cos phi2) t_0 t_1))
          (sqrt (- (pow (cos (* -0.5 phi1)) 2.0) t_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) * cos(phi1);
	double t_1 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
	double t_2 = (atan2(sqrt(t_1), sqrt((1.0 - ((sin((0.5 * lambda1)) * (sin(((lambda1 - lambda2) / 2.0)) * (cos(phi1) * cos(phi2)))) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))))) * 2.0) * R;
	double tmp;
	if (phi2 <= -175.0) {
		tmp = t_2;
	} else if (phi2 <= 0.27) {
		tmp = (atan2(sqrt(fma(cos(phi2), t_0, t_1)), sqrt((pow(cos((-0.5 * phi1)), 2.0) - t_0))) * 2.0) * R;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(R, lambda1, lambda2, phi1, phi2)
	t_0 = Float64((sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0) * cos(phi1))
	t_1 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
	t_2 = Float64(Float64(atan(sqrt(t_1), sqrt(Float64(1.0 - Float64(Float64(sin(Float64(0.5 * lambda1)) * Float64(sin(Float64(Float64(lambda1 - lambda2) / 2.0)) * Float64(cos(phi1) * cos(phi2)))) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))))) * 2.0) * R)
	tmp = 0.0
	if (phi2 <= -175.0)
		tmp = t_2;
	elseif (phi2 <= 0.27)
		tmp = Float64(Float64(atan(sqrt(fma(cos(phi2), t_0, t_1)), sqrt(Float64((cos(Float64(-0.5 * phi1)) ^ 2.0) - t_0))) * 2.0) * R);
	else
		tmp = t_2;
	end
	return tmp
end
code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $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[(N[ArcTan[N[Sqrt[t$95$1], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]}, If[LessEqual[phi2, -175.0], t$95$2, If[LessEqual[phi2, 0.27], N[(N[(N[ArcTan[N[Sqrt[N[(N[Cos[phi2], $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Power[N[Cos[N[(-0.5 * phi1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] - t$95$0), $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} \cdot \cos \phi_1\\
t_1 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
t_2 := \left(\tan^{-1}_* \frac{\sqrt{t\_1}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
\mathbf{if}\;\phi_2 \leq -175:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;\phi_2 \leq 0.27:\\
\;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_2, t\_0, t\_1\right)}}{\sqrt{{\cos \left(-0.5 \cdot \phi_1\right)}^{2} - t\_0}} \cdot 2\right) \cdot R\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if phi2 < -175 or 0.27000000000000002 < phi2

    1. Initial program 51.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 inf

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 \color{blue}{\left(\frac{1}{2} \cdot \lambda_1\right)}\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}\right)}}\right) \]
      2. lower-*.f6445.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
    5. Applied rewrites45.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
    6. Taylor expanded in lambda2 around 0

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{-1 \cdot \left(\lambda_2 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \lambda_1\right) \cdot \sin \left(\frac{1}{2} \cdot \lambda_1\right)\right)\right)\right)\right) + \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)}}}{\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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
    7. Applied rewrites42.2%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(-\lambda_2 \cdot \cos \phi_1, \left(\cos \phi_2 \cdot \cos \left(\lambda_1 \cdot -0.5\right)\right) \cdot \sin \left(\lambda_1 \cdot 0.5\right), \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)\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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]
    8. Taylor expanded in lambda1 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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
    9. Step-by-step derivation
      1. Applied rewrites33.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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]

      if -175 < phi2 < 0.27000000000000002

      1. Initial program 79.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 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 rewrites78.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) \]
        3. lift-*.f64N/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 rewrites78.3%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\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(\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) \]
    10. Recombined 2 regimes into one program.
    11. Final simplification58.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -175:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 0.27:\\ \;\;\;\;\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{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
    12. Add Preprocessing

    Alternative 14: 41.6% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\\ t_1 := {t\_0}^{2}\\ t_2 := \sqrt{1 - t\_1}\\ t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_4 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\ \mathbf{if}\;t\_3 \leq -0.02:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\left(t\_0 \cdot \cos \phi_1\right) \cdot \cos \phi_2, t\_0, t\_4\right)}}{t\_2} \cdot 2\right) \cdot R\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-40}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_4}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(t\_3 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1, t\_1 \cdot \cos \phi_2, t\_4\right)}}{t\_2} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
    (FPCore (R lambda1 lambda2 phi1 phi2)
     :precision binary64
     (let* ((t_0 (sin (* (- lambda1 lambda2) 0.5)))
            (t_1 (pow t_0 2.0))
            (t_2 (sqrt (- 1.0 t_1)))
            (t_3 (sin (/ (- lambda1 lambda2) 2.0)))
            (t_4 (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
       (if (<= t_3 -0.02)
         (*
          (*
           (atan2 (sqrt (fma (* (* t_0 (cos phi1)) (cos phi2)) t_0 t_4)) t_2)
           2.0)
          R)
         (if (<= t_3 2e-40)
           (*
            (*
             (atan2
              (sqrt t_4)
              (sqrt
               (-
                1.0
                (+
                 (* (sin (* 0.5 lambda1)) (* t_3 (* (cos phi1) (cos phi2))))
                 (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))))
             2.0)
            R)
           (*
            (* (atan2 (sqrt (fma (cos phi1) (* t_1 (cos phi2)) t_4)) t_2) 2.0)
            R)))))
    double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
    	double t_0 = sin(((lambda1 - lambda2) * 0.5));
    	double t_1 = pow(t_0, 2.0);
    	double t_2 = sqrt((1.0 - t_1));
    	double t_3 = sin(((lambda1 - lambda2) / 2.0));
    	double t_4 = pow(sin(((phi1 - phi2) * 0.5)), 2.0);
    	double tmp;
    	if (t_3 <= -0.02) {
    		tmp = (atan2(sqrt(fma(((t_0 * cos(phi1)) * cos(phi2)), t_0, t_4)), t_2) * 2.0) * R;
    	} else if (t_3 <= 2e-40) {
    		tmp = (atan2(sqrt(t_4), sqrt((1.0 - ((sin((0.5 * lambda1)) * (t_3 * (cos(phi1) * cos(phi2)))) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))))) * 2.0) * R;
    	} else {
    		tmp = (atan2(sqrt(fma(cos(phi1), (t_1 * cos(phi2)), t_4)), t_2) * 2.0) * R;
    	}
    	return tmp;
    }
    
    function code(R, lambda1, lambda2, phi1, phi2)
    	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5))
    	t_1 = t_0 ^ 2.0
    	t_2 = sqrt(Float64(1.0 - t_1))
    	t_3 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
    	t_4 = sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0
    	tmp = 0.0
    	if (t_3 <= -0.02)
    		tmp = Float64(Float64(atan(sqrt(fma(Float64(Float64(t_0 * cos(phi1)) * cos(phi2)), t_0, t_4)), t_2) * 2.0) * R);
    	elseif (t_3 <= 2e-40)
    		tmp = Float64(Float64(atan(sqrt(t_4), sqrt(Float64(1.0 - Float64(Float64(sin(Float64(0.5 * lambda1)) * Float64(t_3 * Float64(cos(phi1) * cos(phi2)))) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))))) * 2.0) * R);
    	else
    		tmp = Float64(Float64(atan(sqrt(fma(cos(phi1), Float64(t_1 * cos(phi2)), t_4)), t_2) * 2.0) * R);
    	end
    	return tmp
    end
    
    code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$3, -0.02], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[(t$95$0 * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$0 + t$95$4), $MachinePrecision]], $MachinePrecision] / t$95$2], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], If[LessEqual[t$95$3, 2e-40], N[(N[(N[ArcTan[N[Sqrt[t$95$4], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision] * N[(t$95$3 * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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], N[(N[(N[ArcTan[N[Sqrt[N[(N[Cos[phi1], $MachinePrecision] * N[(t$95$1 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]], $MachinePrecision] / t$95$2], $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)\\
    t_1 := {t\_0}^{2}\\
    t_2 := \sqrt{1 - t\_1}\\
    t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
    t_4 := {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\\
    \mathbf{if}\;t\_3 \leq -0.02:\\
    \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\left(t\_0 \cdot \cos \phi_1\right) \cdot \cos \phi_2, t\_0, t\_4\right)}}{t\_2} \cdot 2\right) \cdot R\\
    
    \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-40}:\\
    \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{t\_4}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(t\_3 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1, t\_1 \cdot \cos \phi_2, t\_4\right)}}{t\_2} \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 67.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
      4. Step-by-step derivation
        1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
        2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
        3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
        4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
        5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
      5. Applied rewrites51.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
      6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
      7. Step-by-step derivation
        1. Applied rewrites34.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
        2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
          3. lift-*.f64N/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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
          4. lower-fma.f6434.3

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

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

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

        1. Initial program 79.1%

          \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 inf

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 \color{blue}{\left(\frac{1}{2} \cdot \lambda_1\right)}\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}\right)}}\right) \]
          2. lower-*.f6477.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 - \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 \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
        5. Applied rewrites77.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 - \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 \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
        6. Taylor expanded in lambda2 around 0

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{-1 \cdot \left(\lambda_2 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \lambda_1\right) \cdot \sin \left(\frac{1}{2} \cdot \lambda_1\right)\right)\right)\right)\right) + \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)}}}{\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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
        7. Applied rewrites76.8%

          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(-\lambda_2 \cdot \cos \phi_1, \left(\cos \phi_2 \cdot \cos \left(\lambda_1 \cdot -0.5\right)\right) \cdot \sin \left(\lambda_1 \cdot 0.5\right), \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)\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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]
        8. Taylor expanded in lambda1 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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
        9. Step-by-step derivation
          1. Applied rewrites70.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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]

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

          1. Initial program 58.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 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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
          4. Step-by-step derivation
            1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
            2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
            3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
            4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
            5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
          5. Applied rewrites41.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
          6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
          7. Step-by-step derivation
            1. Applied rewrites36.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
            2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
            3. Applied rewrites36.5%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\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)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
          8. Recombined 3 regimes into one program.
          9. Final simplification44.7%

            \[\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(\left(\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right) \cdot \cos \phi_1\right) \cdot \cos \phi_2, \sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right), {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \leq 2 \cdot 10^{-40}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \end{array} \]
          10. Add Preprocessing

          Alternative 15: 51.3% accurate, 1.2× 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{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\phi_2 \leq -1.1 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\phi_2 \leq 0.165:\\ \;\;\;\;\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 (pow (sin (* (- phi1 phi2) 0.5)) 2.0))
                      (sqrt
                       (-
                        1.0
                        (+
                         (*
                          (sin (* 0.5 lambda1))
                          (*
                           (sin (/ (- lambda1 lambda2) 2.0))
                           (* (cos phi1) (cos phi2))))
                         (pow (sin (/ (- phi1 phi2) 2.0)) 2.0)))))
                     2.0)
                    R)))
             (if (<= phi2 -1.1e-24)
               t_1
               (if (<= phi2 0.165)
                 (*
                  (*
                   (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(pow(sin(((phi1 - phi2) * 0.5)), 2.0)), sqrt((1.0 - ((sin((0.5 * lambda1)) * (sin(((lambda1 - lambda2) / 2.0)) * (cos(phi1) * cos(phi2)))) + pow(sin(((phi1 - phi2) / 2.0)), 2.0))))) * 2.0) * R;
          	double tmp;
          	if (phi2 <= -1.1e-24) {
          		tmp = t_1;
          	} else if (phi2 <= 0.165) {
          		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((sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0)), sqrt(Float64(1.0 - Float64(Float64(sin(Float64(0.5 * lambda1)) * Float64(sin(Float64(Float64(lambda1 - lambda2) / 2.0)) * Float64(cos(phi1) * cos(phi2)))) + (sin(Float64(Float64(phi1 - phi2) / 2.0)) ^ 2.0))))) * 2.0) * R)
          	tmp = 0.0
          	if (phi2 <= -1.1e-24)
          		tmp = t_1;
          	elseif (phi2 <= 0.165)
          		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[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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]}, If[LessEqual[phi2, -1.1e-24], t$95$1, If[LessEqual[phi2, 0.165], 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{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\
          \mathbf{if}\;\phi_2 \leq -1.1 \cdot 10^{-24}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;\phi_2 \leq 0.165:\\
          \;\;\;\;\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 < -1.10000000000000001e-24 or 0.165000000000000008 < phi2

            1. Initial program 52.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 inf

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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 \color{blue}{\left(\frac{1}{2} \cdot \lambda_1\right)}\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot \frac{1}{2}\right)}\right)}}\right) \]
              2. lower-*.f6446.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
            5. Applied rewrites46.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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \color{blue}{\left(\lambda_1 \cdot 0.5\right)}\right)}}\right) \]
            6. Taylor expanded in lambda2 around 0

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{-1 \cdot \left(\lambda_2 \cdot \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \lambda_1\right) \cdot \sin \left(\frac{1}{2} \cdot \lambda_1\right)\right)\right)\right)\right) + \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)}}}{\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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
            7. Applied rewrites42.7%

              \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left(-\lambda_2 \cdot \cos \phi_1, \left(\cos \phi_2 \cdot \cos \left(\lambda_1 \cdot -0.5\right)\right) \cdot \sin \left(\lambda_1 \cdot 0.5\right), \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)\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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]
            8. Taylor expanded in lambda1 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(\lambda_1 \cdot \frac{1}{2}\right)\right)}}\right) \]
            9. Step-by-step derivation
              1. Applied rewrites34.0%

                \[\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(\lambda_1 \cdot 0.5\right)\right)}}\right) \]

              if -1.10000000000000001e-24 < phi2 < 0.165000000000000008

              1. Initial program 80.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 rewrites80.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-*.f6479.2

                  \[\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 rewrites79.2%

                \[\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) \]
            10. Recombined 2 regimes into one program.
            11. Final simplification58.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -1.1 \cdot 10^{-24}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \mathbf{elif}\;\phi_2 \leq 0.165:\\ \;\;\;\;\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{{\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}}}{\sqrt{1 - \left(\sin \left(0.5 \cdot \lambda_1\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}} \cdot 2\right) \cdot R\\ \end{array} \]
            12. Add Preprocessing

            Alternative 16: 34.8% accurate, 1.5× speedup?

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

              \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
            4. Step-by-step derivation
              1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
              2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
              3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
              4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
              5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
            5. Applied rewrites47.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
            6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
            7. Step-by-step derivation
              1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
              2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                3. lift-*.f64N/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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                4. lower-fma.f6435.5

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

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

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

              Alternative 17: 32.7% accurate, 1.5× 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{1 - t\_0}\\ \mathbf{if}\;\phi_2 \leq -1.25 \cdot 10^{-79}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{t\_1} \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 (- 1.0 t_0))))
                 (if (<= phi2 -1.25e-79)
                   (*
                    (*
                     (atan2
                      (sqrt
                       (fma
                        (* (cos phi1) (cos phi2))
                        (pow (sin (* -0.5 lambda2)) 2.0)
                        (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                      t_1)
                     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((1.0 - t_0));
              	double tmp;
              	if (phi2 <= -1.25e-79) {
              		tmp = (atan2(sqrt(fma((cos(phi1) * cos(phi2)), pow(sin((-0.5 * lambda2)), 2.0), pow(sin(((phi1 - phi2) * 0.5)), 2.0))), t_1) * 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(1.0 - t_0))
              	tmp = 0.0
              	if (phi2 <= -1.25e-79)
              		tmp = Float64(Float64(atan(sqrt(fma(Float64(cos(phi1) * cos(phi2)), (sin(Float64(-0.5 * lambda2)) ^ 2.0), (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), t_1) * 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[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi2, -1.25e-79], N[(N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1], $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{1 - t\_0}\\
              \mathbf{if}\;\phi_2 \leq -1.25 \cdot 10^{-79}:\\
              \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{t\_1} \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 2 regimes
              2. if phi2 < -1.25e-79

                1. Initial program 51.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                4. Step-by-step derivation
                  1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                  2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                  3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                  4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                  5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                5. Applied rewrites22.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites27.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                  2. Taylor expanded in lambda1 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_2\right)}^{2}\right) + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                  3. 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_2\right)}^{2}} + {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}^{2}}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2 \cdot \frac{-1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2 \cdot \frac{-1}{2}\right)}}^{2}, {\sin \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2 \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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2 \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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2 \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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                  4. Applied rewrites28.1%

                    \[\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_2 \cdot -0.5\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]

                  if -1.25e-79 < phi2

                  1. Initial program 74.1%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                  4. Step-by-step derivation
                    1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                    2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                    3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                    4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                    5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  5. Applied rewrites58.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                  6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites38.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                    2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                    3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                      15. lower-*.f6437.8

                        \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                    4. Applied rewrites37.8%

                      \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification34.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -1.25 \cdot 10^{-79}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 18: 34.8% accurate, 1.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1, t\_0 \cdot \cos \phi_2, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - t\_0}} \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)))
                     (*
                      (*
                       (atan2
                        (sqrt
                         (fma
                          (cos phi1)
                          (* t_0 (cos phi2))
                          (pow (sin (* (- phi1 phi2) 0.5)) 2.0)))
                        (sqrt (- 1.0 t_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);
                  	return (atan2(sqrt(fma(cos(phi1), (t_0 * cos(phi2)), pow(sin(((phi1 - phi2) * 0.5)), 2.0))), sqrt((1.0 - t_0))) * 2.0) * R;
                  }
                  
                  function code(R, lambda1, lambda2, phi1, phi2)
                  	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                  	return Float64(Float64(atan(sqrt(fma(cos(phi1), Float64(t_0 * cos(phi2)), (sin(Float64(Float64(phi1 - phi2) * 0.5)) ^ 2.0))), sqrt(Float64(1.0 - t_0))) * 2.0) * R)
                  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]}, N[(N[(N[ArcTan[N[Sqrt[N[(N[Cos[phi1], $MachinePrecision] * N[(t$95$0 * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$0), $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}\\
                  \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\cos \phi_1, t\_0 \cdot \cos \phi_2, {\sin \left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - t\_0}} \cdot 2\right) \cdot R
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Initial program 67.1%

                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                  4. Step-by-step derivation
                    1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                    2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                    3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                    4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                    5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                  5. Applied rewrites47.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                  6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                    2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                    3. Applied rewrites35.5%

                      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\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)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                    4. Final simplification35.5%

                      \[\leadsto \left(\tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R \]
                    5. Add Preprocessing

                    Alternative 19: 32.4% accurate, 1.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ 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({\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, \cos \phi_1, t\_0\right)}}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\ \mathbf{if}\;\lambda_2 \leq -9 \cdot 10^{+50}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\lambda_2 \leq 1.4 \cdot 10^{-5}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, t\_0\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \lambda_1\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 (* phi1 0.5)) 2.0))
                            (t_1 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))
                            (t_2
                             (*
                              (*
                               (atan2
                                (sqrt (fma (pow (sin (* -0.5 lambda2)) 2.0) (cos phi1) t_0))
                                (sqrt (- 1.0 t_1)))
                               2.0)
                              R)))
                       (if (<= lambda2 -9e+50)
                         t_2
                         (if (<= lambda2 1.4e-5)
                           (*
                            (*
                             (atan2
                              (sqrt (fma t_1 (cos phi1) t_0))
                              (sqrt (- 1.0 (pow (sin (* 0.5 lambda1)) 2.0))))
                             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 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                    	double t_2 = (atan2(sqrt(fma(pow(sin((-0.5 * lambda2)), 2.0), cos(phi1), t_0)), sqrt((1.0 - t_1))) * 2.0) * R;
                    	double tmp;
                    	if (lambda2 <= -9e+50) {
                    		tmp = t_2;
                    	} else if (lambda2 <= 1.4e-5) {
                    		tmp = (atan2(sqrt(fma(t_1, cos(phi1), t_0)), sqrt((1.0 - pow(sin((0.5 * lambda1)), 2.0)))) * 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 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                    	t_2 = Float64(Float64(atan(sqrt(fma((sin(Float64(-0.5 * lambda2)) ^ 2.0), cos(phi1), t_0)), sqrt(Float64(1.0 - t_1))) * 2.0) * R)
                    	tmp = 0.0
                    	if (lambda2 <= -9e+50)
                    		tmp = t_2;
                    	elseif (lambda2 <= 1.4e-5)
                    		tmp = Float64(Float64(atan(sqrt(fma(t_1, cos(phi1), t_0)), sqrt(Float64(1.0 - (sin(Float64(0.5 * lambda1)) ^ 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[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $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[(N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[lambda2, -9e+50], t$95$2, If[LessEqual[lambda2, 1.4e-5], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$1 * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[Sin[N[(0.5 * lambda1), $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(\phi_1 \cdot 0.5\right)}^{2}\\
                    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({\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, \cos \phi_1, t\_0\right)}}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\
                    \mathbf{if}\;\lambda_2 \leq -9 \cdot 10^{+50}:\\
                    \;\;\;\;t\_2\\
                    
                    \mathbf{elif}\;\lambda_2 \leq 1.4 \cdot 10^{-5}:\\
                    \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, t\_0\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \lambda_1\right)}^{2}}} \cdot 2\right) \cdot R\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_2\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if lambda2 < -9.00000000000000027e50 or 1.39999999999999998e-5 < lambda2

                      1. Initial program 52.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                      4. Step-by-step derivation
                        1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                        2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                        3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                        4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                        5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                      5. Applied rewrites41.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{1 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                      6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                        2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                        3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                          15. lower-*.f6435.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                        4. Applied rewrites35.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                        5. Taylor expanded in lambda1 around 0

                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                        6. Step-by-step derivation
                          1. Applied rewrites35.3%

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

                          if -9.00000000000000027e50 < lambda2 < 1.39999999999999998e-5

                          1. Initial program 78.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 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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                          4. Step-by-step derivation
                            1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                            2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                            3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                            4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                            5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                          5. Applied rewrites52.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{1 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                          6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                            2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                            3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                              15. lower-*.f6431.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(0.5 \cdot \phi_1\right)}}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                            4. Applied rewrites31.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(0.5 \cdot \phi_1\right)}^{2}\right)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                            5. Taylor expanded in lambda2 around 0

                              \[\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 \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\frac{1}{2} \cdot \lambda_1\right)}^{2}}}\right) \]
                            6. Step-by-step derivation
                              1. Applied rewrites31.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 \left(0.5 \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\lambda_1 \cdot 0.5\right)}^{2}}}\right) \]
                            7. Recombined 2 regimes into one program.
                            8. Final simplification33.1%

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

                            Alternative 20: 31.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}\\ t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, \cos \phi_1, t\_0\right)}}{t\_1} \cdot 2\right) \cdot R\\ \mathbf{if}\;\lambda_2 \leq -10000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\lambda_2 \leq 2 \cdot 10^{-6}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2}, \cos \phi_1, t\_0\right)}}{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 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0))))
                                    (t_2
                                     (*
                                      (*
                                       (atan2
                                        (sqrt (fma (pow (sin (* -0.5 lambda2)) 2.0) (cos phi1) t_0))
                                        t_1)
                                       2.0)
                                      R)))
                               (if (<= lambda2 -10000000.0)
                                 t_2
                                 (if (<= lambda2 2e-6)
                                   (*
                                    (*
                                     (atan2
                                      (sqrt (fma (pow (sin (* 0.5 lambda1)) 2.0) (cos phi1) t_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 - pow(sin(((lambda1 - lambda2) * 0.5)), 2.0)));
                            	double t_2 = (atan2(sqrt(fma(pow(sin((-0.5 * lambda2)), 2.0), cos(phi1), t_0)), t_1) * 2.0) * R;
                            	double tmp;
                            	if (lambda2 <= -10000000.0) {
                            		tmp = t_2;
                            	} else if (lambda2 <= 2e-6) {
                            		tmp = (atan2(sqrt(fma(pow(sin((0.5 * lambda1)), 2.0), cos(phi1), t_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 - (sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0)))
                            	t_2 = Float64(Float64(atan(sqrt(fma((sin(Float64(-0.5 * lambda2)) ^ 2.0), cos(phi1), t_0)), t_1) * 2.0) * R)
                            	tmp = 0.0
                            	if (lambda2 <= -10000000.0)
                            		tmp = t_2;
                            	elseif (lambda2 <= 2e-6)
                            		tmp = Float64(Float64(atan(sqrt(fma((sin(Float64(0.5 * lambda1)) ^ 2.0), cos(phi1), t_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[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / t$95$1], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]}, If[LessEqual[lambda2, -10000000.0], t$95$2, If[LessEqual[lambda2, 2e-6], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}\\
                            t_2 := \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(-0.5 \cdot \lambda_2\right)}^{2}, \cos \phi_1, t\_0\right)}}{t\_1} \cdot 2\right) \cdot R\\
                            \mathbf{if}\;\lambda_2 \leq -10000000:\\
                            \;\;\;\;t\_2\\
                            
                            \mathbf{elif}\;\lambda_2 \leq 2 \cdot 10^{-6}:\\
                            \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2}, \cos \phi_1, t\_0\right)}}{t\_1} \cdot 2\right) \cdot R\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_2\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if lambda2 < -1e7 or 1.99999999999999991e-6 < lambda2

                              1. Initial program 52.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                              4. Step-by-step derivation
                                1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                              5. Applied rewrites41.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{1 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                              6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                              7. Step-by-step derivation
                                1. Applied rewrites34.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                  15. lower-*.f6434.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                4. Applied rewrites34.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                5. Taylor expanded in lambda1 around 0

                                  \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                6. Step-by-step derivation
                                  1. Applied rewrites34.6%

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

                                  if -1e7 < lambda2 < 1.99999999999999991e-6

                                  1. Initial program 78.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                  4. Step-by-step derivation
                                    1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                    2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                    3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                    4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                    5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                  5. Applied rewrites52.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                  6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites36.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                    2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                    3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                      15. lower-*.f6431.8

                                        \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                    4. Applied rewrites31.8%

                                      \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                    5. Taylor expanded in lambda2 around 0

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

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

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

                                    Alternative 21: 33.6% 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{1 - t\_0}\\ \mathbf{if}\;\phi_2 \leq -8.8 \cdot 10^{-80}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}{t\_1} \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 (- 1.0 t_0))))
                                       (if (<= phi2 -8.8e-80)
                                         (*
                                          (*
                                           (atan2 (sqrt (fma t_0 (cos phi2) (pow (sin (* -0.5 phi2)) 2.0))) t_1)
                                           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((1.0 - t_0));
                                    	double tmp;
                                    	if (phi2 <= -8.8e-80) {
                                    		tmp = (atan2(sqrt(fma(t_0, cos(phi2), pow(sin((-0.5 * phi2)), 2.0))), t_1) * 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(1.0 - t_0))
                                    	tmp = 0.0
                                    	if (phi2 <= -8.8e-80)
                                    		tmp = Float64(Float64(atan(sqrt(fma(t_0, cos(phi2), (sin(Float64(-0.5 * phi2)) ^ 2.0))), t_1) * 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[(1.0 - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[phi2, -8.8e-80], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$0 * N[Cos[phi2], $MachinePrecision] + N[Power[N[Sin[N[(-0.5 * phi2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1], $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{1 - t\_0}\\
                                    \mathbf{if}\;\phi_2 \leq -8.8 \cdot 10^{-80}:\\
                                    \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}{t\_1} \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 2 regimes
                                    2. if phi2 < -8.80000000000000041e-80

                                      1. Initial program 51.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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                      4. Step-by-step derivation
                                        1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                        2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                        3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                        4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                        5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                      5. Applied rewrites22.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                      6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites27.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                        2. Taylor expanded in phi1 around 0

                                          \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\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}}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                        3. 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_2} + {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2}, {\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, \color{blue}{{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}^{2}}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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_2, {\color{blue}{\sin \left(\frac{-1}{2} \cdot \phi_2\right)}}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                          15. lower-*.f6427.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_2, {\sin \color{blue}{\left(-0.5 \cdot \phi_2\right)}}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                        4. Applied rewrites27.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_2, {\sin \left(-0.5 \cdot \phi_2\right)}^{2}\right)}}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]

                                        if -8.80000000000000041e-80 < phi2

                                        1. Initial program 74.1%

                                          \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                        4. Step-by-step derivation
                                          1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                          2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                          3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                          4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                          5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                        5. Applied rewrites58.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                        6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites38.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                          2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                          3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                            15. lower-*.f6437.8

                                              \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                          4. Applied rewrites37.8%

                                            \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                        8. Recombined 2 regimes into one program.
                                        9. Final simplification34.7%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -8.8 \cdot 10^{-80}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\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)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R\\ \end{array} \]
                                        10. Add Preprocessing

                                        Alternative 22: 30.4% accurate, 1.7× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\ \mathbf{if}\;\lambda_1 \leq -125000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2}, \cos \phi_1, t\_0\right)}}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\ \mathbf{else}:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, t\_0\right)}}{\sqrt{1 - {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}}} \cdot 2\right) \cdot R\\ \end{array} \end{array} \]
                                        (FPCore (R lambda1 lambda2 phi1 phi2)
                                         :precision binary64
                                         (let* ((t_0 (pow (sin (* phi1 0.5)) 2.0))
                                                (t_1 (pow (sin (* (- lambda1 lambda2) 0.5)) 2.0)))
                                           (if (<= lambda1 -125000.0)
                                             (*
                                              (*
                                               (atan2
                                                (sqrt (fma (pow (sin (* 0.5 lambda1)) 2.0) (cos phi1) t_0))
                                                (sqrt (- 1.0 t_1)))
                                               2.0)
                                              R)
                                             (*
                                              (*
                                               (atan2
                                                (sqrt (fma t_1 (cos phi1) t_0))
                                                (sqrt (- 1.0 (pow (sin (* -0.5 lambda2)) 2.0))))
                                               2.0)
                                              R))))
                                        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 = pow(sin(((lambda1 - lambda2) * 0.5)), 2.0);
                                        	double tmp;
                                        	if (lambda1 <= -125000.0) {
                                        		tmp = (atan2(sqrt(fma(pow(sin((0.5 * lambda1)), 2.0), cos(phi1), t_0)), sqrt((1.0 - t_1))) * 2.0) * R;
                                        	} else {
                                        		tmp = (atan2(sqrt(fma(t_1, cos(phi1), t_0)), sqrt((1.0 - pow(sin((-0.5 * lambda2)), 2.0)))) * 2.0) * R;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(R, lambda1, lambda2, phi1, phi2)
                                        	t_0 = sin(Float64(phi1 * 0.5)) ^ 2.0
                                        	t_1 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                                        	tmp = 0.0
                                        	if (lambda1 <= -125000.0)
                                        		tmp = Float64(Float64(atan(sqrt(fma((sin(Float64(0.5 * lambda1)) ^ 2.0), cos(phi1), t_0)), sqrt(Float64(1.0 - t_1))) * 2.0) * R);
                                        	else
                                        		tmp = Float64(Float64(atan(sqrt(fma(t_1, cos(phi1), t_0)), sqrt(Float64(1.0 - (sin(Float64(-0.5 * lambda2)) ^ 2.0)))) * 2.0) * R);
                                        	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[Power[N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[lambda1, -125000.0], N[(N[(N[ArcTan[N[Sqrt[N[(N[Power[N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision], N[(N[(N[ArcTan[N[Sqrt[N[(t$95$1 * N[Cos[phi1], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(1.0 - N[Power[N[Sin[N[(-0.5 * lambda2), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * R), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\
                                        t_1 := {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}\\
                                        \mathbf{if}\;\lambda_1 \leq -125000:\\
                                        \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2}, \cos \phi_1, t\_0\right)}}{\sqrt{1 - t\_1}} \cdot 2\right) \cdot R\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_1, \cos \phi_1, t\_0\right)}}{\sqrt{1 - {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}}} \cdot 2\right) \cdot R\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 2 regimes
                                        2. if lambda1 < -125000

                                          1. Initial program 61.1%

                                            \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                          4. Step-by-step derivation
                                            1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                            2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                            3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                            4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                            5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                          5. Applied rewrites44.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{1 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                          6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites31.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                            2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                            3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                              15. lower-*.f6431.6

                                                \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                            4. Applied rewrites31.6%

                                              \[\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                            5. Taylor expanded in lambda2 around 0

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

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

                                              if -125000 < lambda1

                                              1. Initial program 69.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 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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                              4. Step-by-step derivation
                                                1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                                2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                                3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                                4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                                5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                              5. Applied rewrites48.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 - \color{blue}{\mathsf{fma}\left(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                              6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites36.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                                2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                  15. lower-*.f6433.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                4. Applied rewrites33.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                5. Taylor expanded in lambda1 around 0

                                                  \[\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 \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\frac{-1}{2} \cdot \lambda_2\right)}^{2}}}\right) \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites31.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 \left(0.5 \cdot \phi_1\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}}}\right) \]
                                                7. Recombined 2 regimes into one program.
                                                8. Final simplification31.7%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 \leq -125000:\\ \;\;\;\;\left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left({\sin \left(0.5 \cdot \lambda_1\right)}^{2}, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - {\sin \left(\left(\lambda_1 - \lambda_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 - {\sin \left(-0.5 \cdot \lambda_2\right)}^{2}}} \cdot 2\right) \cdot R\\ \end{array} \]
                                                9. Add Preprocessing

                                                Alternative 23: 32.7% 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}\\ \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - t\_0}} \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)))
                                                   (*
                                                    (*
                                                     (atan2
                                                      (sqrt (fma t_0 (cos phi1) (pow (sin (* phi1 0.5)) 2.0)))
                                                      (sqrt (- 1.0 t_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);
                                                	return (atan2(sqrt(fma(t_0, cos(phi1), pow(sin((phi1 * 0.5)), 2.0))), sqrt((1.0 - t_0))) * 2.0) * R;
                                                }
                                                
                                                function code(R, lambda1, lambda2, phi1, phi2)
                                                	t_0 = sin(Float64(Float64(lambda1 - lambda2) * 0.5)) ^ 2.0
                                                	return Float64(Float64(atan(sqrt(fma(t_0, cos(phi1), (sin(Float64(phi1 * 0.5)) ^ 2.0))), sqrt(Float64(1.0 - t_0))) * 2.0) * R)
                                                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]}, 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[(1.0 - t$95$0), $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}\\
                                                \left(\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t\_0, \cos \phi_1, {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}{\sqrt{1 - t\_0}} \cdot 2\right) \cdot R
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 67.1%

                                                  \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                                4. Step-by-step derivation
                                                  1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                                  2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                                  3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                                  4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                                  5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                                5. Applied rewrites47.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                                6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                                  2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                  3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                    15. lower-*.f6433.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                  4. Applied rewrites33.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                  5. Final simplification33.0%

                                                    \[\leadsto \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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}} \cdot 2\right) \cdot R \]
                                                  6. Add Preprocessing

                                                  Alternative 24: 24.7% accurate, 1.7× speedup?

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

                                                    \[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \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{1 - \color{blue}{\left(-1 \cdot \left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) + \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)}}}\right) \]
                                                  4. Step-by-step derivation
                                                    1. 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 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \left(\cos \left(\frac{1}{2} \cdot \phi_1\right) \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right)\right)} + \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)}}\right) \]
                                                    2. *-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(\left(\mathsf{neg}\left(\phi_2 \cdot \color{blue}{\left(\sin \left(\frac{1}{2} \cdot \phi_1\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)\right)}\right)\right) + \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)}}\right) \]
                                                    3. 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{1 - \left(\left(\mathsf{neg}\left(\color{blue}{\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)}\right)\right) + \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)}}\right) \]
                                                    4. 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{1 - \left(\color{blue}{\left(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right)\right) \cdot \cos \left(\frac{1}{2} \cdot \phi_1\right)} + \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)}}\right) \]
                                                    5. 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(\mathsf{neg}\left(\phi_2 \cdot \sin \left(\frac{1}{2} \cdot \phi_1\right)\right), \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} + {\sin \left(\frac{1}{2} \cdot \phi_1\right)}^{2}\right)}}}\right) \]
                                                  5. Applied rewrites47.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(\left(-\phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right), \cos \left(\phi_1 \cdot -0.5\right), \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)\right)}}}\right) \]
                                                  6. 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 - {\sin \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{\color{blue}{2}}}}\right) \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites35.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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{\color{blue}{2}}}}\right) \]
                                                    2. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                    3. 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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\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 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)}^{2}}}\right) \]
                                                      15. lower-*.f6433.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                    4. Applied rewrites33.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{1 - {\sin \left(\left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)}^{2}}}\right) \]
                                                    5. Taylor expanded in lambda2 around 0

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

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

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

                                                      Reproduce

                                                      ?
                                                      herbie shell --seed 2024254 
                                                      (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))))))))))