Distance on a great circle

Percentage Accurate: 61.9% → 78.9%
Time: 45.7s
Alternatives: 24
Speedup: 1.2×

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

\\
\begin{array}{l}
t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_1 := \cos \phi_2 \cdot \cos \phi_1\\
\left(\tan^{-1}_* \frac{\sqrt{\left(t\_1 \cdot t\_0\right) \cdot t\_0 + {\left(\cos \left(\phi_2 \cdot 0.5\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}}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \mathsf{fma}\left(\sin \lambda_2, \sin \lambda_1, \cos \lambda_1 \cdot \cos \lambda_2\right), 0.5\right), \left(-\cos \phi_2\right) \cdot \cos \phi_1, \mathsf{fma}\left(\sin \phi_2 \cdot \sin \phi_1 + t\_1, 0.5, 0.5\right)\right)}} \cdot 2\right) \cdot R
\end{array}
\end{array}
Derivation
  1. Initial program 66.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. 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. sin-diffN/A

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

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

    \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  5. Applied rewrites67.8%

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
  6. Step-by-step derivation
    1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    14. lower-sin.f6479.4

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

    \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, 0.5, 0.5\right)\right)}}\right) \]
  8. Step-by-step derivation
    1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)}, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)}, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\cos \lambda_1 \cdot \cos \lambda_2 + \sin \lambda_1 \cdot \sin \lambda_2}, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    4. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\sin \lambda_1 \cdot \sin \lambda_2 + \cos \lambda_1 \cdot \cos \lambda_2}, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    5. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\sin \lambda_2 \cdot \sin \lambda_1} + \cos \lambda_1 \cdot \cos \lambda_2, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    6. lower-fma.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\mathsf{fma}\left(\sin \lambda_2, \sin \lambda_1, \cos \lambda_1 \cdot \cos \lambda_2\right)}, \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    7. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \mathsf{fma}\left(\color{blue}{\sin \lambda_2}, \sin \lambda_1, \cos \lambda_1 \cdot \cos \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    8. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \mathsf{fma}\left(\sin \lambda_2, \color{blue}{\sin \lambda_1}, \cos \lambda_1 \cdot \cos \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    9. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \mathsf{fma}\left(\sin \lambda_2, \sin \lambda_1, \color{blue}{\cos \lambda_1} \cdot \cos \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    10. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \mathsf{fma}\left(\sin \lambda_2, \sin \lambda_1, \color{blue}{\cos \lambda_2 \cdot \cos \lambda_1}\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    11. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \mathsf{fma}\left(\sin \lambda_2, \sin \lambda_1, \color{blue}{\cos \lambda_2 \cdot \cos \lambda_1}\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
    12. lower-cos.f6479.9

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

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

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

Alternative 2: 61.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \cos \left(\phi_2 - \phi_1\right)\\
t_1 := \mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right)\\
t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_3 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_2 \cdot \cos \phi_1\right) \cdot t\_2\right) \cdot t\_2\\
t_4 := \sqrt{t\_3}\\
\mathbf{if}\;\tan^{-1}_* \frac{t\_4}{\sqrt{1 - t\_3}} \leq 2 \cdot 10^{-16}:\\
\;\;\;\;\left(\tan^{-1}_* \frac{t\_4}{\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(\left(\cos \left(\phi_2 + \phi_1\right) + t\_0\right) \cdot t\_1, 0.5, 0.5 - t\_0 \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(t\_1, \left(-\cos \phi_2\right) \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}} \cdot 2\right) \cdot R\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (atan2.f64 (sqrt.f64 (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))))) (sqrt.f64 (-.f64 #s(literal 1 binary64) (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))))))) < 2e-16

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

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

      if 2e-16 < (atan2.f64 (sqrt.f64 (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))))) (sqrt.f64 (-.f64 #s(literal 1 binary64) (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))))))))

      1. Initial program 65.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{{\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. sin-diffN/A

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

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

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

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

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

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

    Alternative 3: 59.9% accurate, 0.6× speedup?

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

      1. Initial program 93.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. Applied rewrites10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2e-16 < (atan2.f64 (sqrt.f64 (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))))) (sqrt.f64 (-.f64 #s(literal 1 binary64) (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))))))))

      1. Initial program 65.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{{\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. sin-diffN/A

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

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

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

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

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

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

    Alternative 4: 59.5% accurate, 0.6× speedup?

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

      1. Initial program 93.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. Applied rewrites10.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2e-16 < (atan2.f64 (sqrt.f64 (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))))) (sqrt.f64 (-.f64 #s(literal 1 binary64) (+.f64 (pow.f64 (sin.f64 (/.f64 (-.f64 phi1 phi2) #s(literal 2 binary64))) #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 (cos.f64 phi1) (cos.f64 phi2)) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64)))) (sin.f64 (/.f64 (-.f64 lambda1 lambda2) #s(literal 2 binary64))))))))

      1. Initial program 65.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{{\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. sin-diffN/A

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

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

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

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

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

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

    Alternative 5: 77.8% accurate, 0.8× speedup?

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

      1. Initial program 53.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. 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. sin-diffN/A

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

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

        \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Applied rewrites54.7%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
      6. Step-by-step derivation
        1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        14. lower-sin.f6462.5

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

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

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

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

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

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

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

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

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

      if -0.38 < lambda2 < 8.1999999999999995e-18

      1. Initial program 80.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. 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. sin-diffN/A

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

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

        \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Applied rewrites81.7%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
      6. Step-by-step derivation
        1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        14. lower-sin.f6497.4

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

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

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\sin \phi_2, \sin \phi_1, \cos \phi_2 \cdot \cos \phi_1\right), 0.5, \mathsf{fma}\left(-\cos \phi_1, \mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right) \cdot \cos \phi_2, 0.5\right)\right)}}}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification79.5%

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

    Alternative 6: 78.3% accurate, 0.8× speedup?

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

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

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

      \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    5. Applied rewrites67.8%

      \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
    6. Step-by-step derivation
      1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      7. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_2 \cdot \cos \phi_1 + \color{blue}{\sin \phi_2 \cdot \sin \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      8. lower-fma.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \phi_2, \cos \phi_1, \sin \phi_2 \cdot \sin \phi_1\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\mathsf{fma}\left(\cos \phi_2, \cos \phi_1, \color{blue}{\sin \phi_1 \cdot \sin \phi_2}\right), \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      10. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\mathsf{fma}\left(\cos \phi_2, \cos \phi_1, \color{blue}{\sin \phi_1 \cdot \sin \phi_2}\right), \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      11. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\mathsf{fma}\left(\cos \phi_2, \cos \phi_1, \color{blue}{\sin \phi_1} \cdot \sin \phi_2\right), \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
      12. lower-sin.f6479.4

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

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

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

    Alternative 7: 76.7% accurate, 0.8× speedup?

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

      1. Initial program 48.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. 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. sin-diffN/A

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

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

        \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Applied rewrites49.8%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
      6. Step-by-step derivation
        1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        14. lower-sin.f6459.6

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

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

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

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

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

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

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

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

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

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

      if -0.029999999999999999 < lambda1 < 6.9999999999999993e-24

      1. Initial program 82.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. 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. sin-diffN/A

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

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

        \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Applied rewrites83.8%

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
      6. Step-by-step derivation
        1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        14. lower-sin.f6497.2

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

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

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

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

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

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

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

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\color{blue}{\mathsf{fma}\left({\sin \left(\lambda_2 \cdot -0.5\right)}^{2} \cdot \cos \phi_2, \cos \phi_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)}}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, 0.5, 0.5\right)\right)}}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification78.3%

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

    Alternative 8: 71.4% accurate, 0.8× speedup?

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

      1. Initial program 54.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. 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. sin-diffN/A

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

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

        \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
      5. Applied rewrites55.7%

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

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

      if -3.5499999999999999e-31 < lambda2 < 2.8e-40

      1. Initial program 80.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. 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. sin-diffN/A

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

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

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right), -\cos \phi_2 \cdot \cos \phi_1, \mathsf{fma}\left(\cos \left(\phi_1 - \phi_2\right), 0.5, 0.5\right)\right)}}}\right) \]
      6. Step-by-step derivation
        1. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        2. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \color{blue}{\left(\phi_1 - \phi_2\right)}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        3. cos-diffN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1 \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        4. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_1} \cdot \cos \phi_2 + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        5. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\cos \phi_1 \cdot \color{blue}{\cos \phi_2} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        6. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        7. 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) - \cos \left(\phi_1 \cdot \frac{1}{2}\right) \cdot \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\cos \phi_2 \cdot \cos \phi_1} + \sin \phi_1 \cdot \sin \phi_2, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        8. +-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        9. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        10. lower-+.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_2 \cdot \sin \phi_1 + \cos \phi_2 \cdot \cos \phi_1}, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        11. *-commutativeN/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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        12. lower-*.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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1 \cdot \sin \phi_2} + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        13. lower-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 \sin \left(\phi_2 \cdot \frac{1}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, \cos \left(\lambda_1 - \lambda_2\right), \frac{1}{2}\right), \mathsf{neg}\left(\cos \phi_2 \cdot \cos \phi_1\right), \mathsf{fma}\left(\color{blue}{\sin \phi_1} \cdot \sin \phi_2 + \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2}, \frac{1}{2}\right)\right)}}\right) \]
        14. lower-sin.f6498.6

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

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

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

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

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

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

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

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

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

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

      if 2.8e-40 < lambda2

      1. Initial program 58.4%

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

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

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

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

        \[\leadsto R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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{\color{blue}{\frac{\left(\cos \left(\phi_1 - \phi_2\right) + 1\right) - \mathsf{fma}\left(-0.5, \cos \left(\lambda_1 - \lambda_2\right), 0.5\right) \cdot \left(\cos \left(\phi_2 + \phi_1\right) + \cos \left(\phi_2 - \phi_1\right)\right)}{2}}}}\right) \]
    3. Recombined 3 regimes into one program.
    4. Final simplification74.3%

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

    Alternative 9: 63.4% accurate, 0.9× speedup?

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

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

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

      \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    5. Applied rewrites68.1%

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

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

    Alternative 10: 62.9% accurate, 0.9× speedup?

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

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

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

      \[\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({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    5. Applied rewrites67.8%

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

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

    Alternative 11: 62.3% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

    Alternative 12: 60.0% accurate, 1.6× speedup?

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

      1. Initial program 55.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. Applied rewrites55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.5e5 < phi2 < 3.8e-6

      1. Initial program 76.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. Applied rewrites67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.8e-6 < phi2

      1. Initial program 59.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. Applied rewrites58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 13: 60.0% accurate, 1.6× speedup?

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

      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. Applied rewrites57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.5e5 < phi2 < 3.8e-6

      1. Initial program 76.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. Applied rewrites67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 14: 56.7% accurate, 1.8× speedup?

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

      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. Applied rewrites54.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -8.2e8 < phi1 < 5.40000000000000007e39

      1. Initial program 76.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. Applied rewrites68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 15: 53.1% accurate, 1.8× speedup?

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

      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. Applied rewrites57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.5e5 < phi2 < 0.00165

      1. Initial program 76.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. Applied rewrites67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 16: 42.3% accurate, 1.8× speedup?

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

      1. Initial program 55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.34999999999999976e-35 < phi1 < 4.79999999999999997e-8

      1. Initial program 79.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. Applied rewrites71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.79999999999999997e-8 < phi1

      1. Initial program 50.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. Applied rewrites50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 17: 42.7% accurate, 1.8× speedup?

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

      1. Initial program 53.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. Applied rewrites53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -8.5e8 < phi1 < 4.79999999999999997e-8

      1. Initial program 78.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. Applied rewrites70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.79999999999999997e-8 < phi1

      1. Initial program 50.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. Applied rewrites50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 18: 42.7% accurate, 1.8× speedup?

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

      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. Applied rewrites57.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.5e5 < phi2 < 7.9999999999999996e-7

      1. Initial program 76.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. Applied rewrites67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 19: 33.4% accurate, 1.8× speedup?

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

      1. Initial program 54.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. Applied rewrites55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.45e-5 < phi2 < 8.9999999999999998e-4

        1. Initial program 77.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. Applied rewrites67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 8.9999999999999998e-4 < phi2

        1. Initial program 59.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. Applied rewrites58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 20: 33.4% accurate, 1.8× speedup?

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

        1. Initial program 57.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. Applied rewrites57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -1.45e-5 < phi2 < 1.1000000000000001e-6

          1. Initial program 77.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. Applied rewrites67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            3. +-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            4. *-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            5. lower-fma.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            6. lower-cos.f6447.4

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          9. Applied rewrites47.4%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          10. Taylor expanded in phi2 around 0

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \phi_1}\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          11. Step-by-step derivation
            1. lower--.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \phi_1}\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            2. *-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \color{blue}{\cos \phi_1 \cdot \frac{1}{2}}\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            3. lower-*.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \color{blue}{\cos \phi_1 \cdot \frac{1}{2}}\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            4. lower-cos.f6447.4

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \color{blue}{\cos \phi_1} \cdot 0.5\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          12. Applied rewrites47.4%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, \color{blue}{0.5 - \cos \phi_1 \cdot 0.5}\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
        12. Recombined 2 regimes into one program.
        13. Final simplification33.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -1.45 \cdot 10^{-5}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{elif}\;\phi_2 \leq 1.1 \cdot 10^{-6}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \phi_1 \cdot 0.5\right)}}{\sqrt{\left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\ \end{array} \]
        14. Add Preprocessing

        Alternative 21: 33.3% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\left(\cos \lambda_1 \cdot 0.5\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right) \end{array} \]
        (FPCore (R lambda1 lambda2 phi1 phi2)
         :precision binary64
         (*
          (atan2
           (sqrt
            (fma
             (fma (cos lambda1) -0.5 0.5)
             (* (cos phi2) (cos phi1))
             (- 0.5 (* (cos (* (* (- phi1 phi2) 0.5) 2.0)) 0.5))))
           (sqrt (+ (* (* (cos lambda1) 0.5) (cos phi1)) 0.5)))
          (* 2.0 R)))
        double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
        	return atan2(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), (cos(phi2) * cos(phi1)), (0.5 - (cos((((phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt((((cos(lambda1) * 0.5) * cos(phi1)) + 0.5))) * (2.0 * R);
        }
        
        function code(R, lambda1, lambda2, phi1, phi2)
        	return Float64(atan(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), Float64(cos(phi2) * cos(phi1)), Float64(0.5 - Float64(cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt(Float64(Float64(Float64(cos(lambda1) * 0.5) * cos(phi1)) + 0.5))) * Float64(2.0 * R))
        end
        
        code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[lambda1], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(N[Cos[phi2], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] + N[(0.5 - N[(N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(N[(N[Cos[lambda1], $MachinePrecision] * 0.5), $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\left(\cos \lambda_1 \cdot 0.5\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right)
        \end{array}
        
        Derivation
        1. Initial program 66.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. Applied rewrites62.1%

          \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right)\right) \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
        4. Taylor expanded in phi2 around 0

          \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \phi_1\right) - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}} \cdot \left(R \cdot 2\right) \]
        5. Step-by-step derivation
          1. associate--l+N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          2. lower-+.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          3. *-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \left(\color{blue}{\cos \phi_1 \cdot \frac{1}{2}} - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
          4. distribute-lft-out--N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          5. lower-*.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          6. lower-cos.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1} \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
          7. lower--.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \color{blue}{\left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          8. lower--.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}\right)}} \cdot \left(R \cdot 2\right) \]
          9. *-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          10. lower-*.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          11. lower-cos.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          12. lower--.f6443.3

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
        6. Applied rewrites43.3%

          \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}}} \cdot \left(R \cdot 2\right) \]
        7. Taylor expanded in lambda2 around 0

          \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
        8. Step-by-step derivation
          1. cancel-sign-sub-invN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          2. metadata-evalN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          3. +-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          4. *-commutativeN/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          5. lower-fma.f64N/A

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          6. lower-cos.f6433.6

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
        9. Applied rewrites33.6%

          \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
        10. Taylor expanded in lambda2 around 0

          \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} \cdot \color{blue}{\cos \lambda_1}\right)}} \cdot \left(R \cdot 2\right) \]
        11. Step-by-step derivation
          1. Applied rewrites33.4%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(\cos \lambda_1 \cdot \color{blue}{0.5}\right)}} \cdot \left(R \cdot 2\right) \]
          2. Final simplification33.4%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\left(\cos \lambda_1 \cdot 0.5\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right) \]
          3. Add Preprocessing

          Alternative 22: 33.3% accurate, 1.9× speedup?

          \[\begin{array}{l} \\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \lambda_1 \cdot 0.5, \cos \phi_1, 0.5\right)}} \cdot \left(2 \cdot R\right) \end{array} \]
          (FPCore (R lambda1 lambda2 phi1 phi2)
           :precision binary64
           (*
            (atan2
             (sqrt
              (fma
               (fma (cos lambda1) -0.5 0.5)
               (* (cos phi2) (cos phi1))
               (- 0.5 (* (cos (* (* (- phi1 phi2) 0.5) 2.0)) 0.5))))
             (sqrt (fma (* (cos lambda1) 0.5) (cos phi1) 0.5)))
            (* 2.0 R)))
          double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
          	return atan2(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), (cos(phi2) * cos(phi1)), (0.5 - (cos((((phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt(fma((cos(lambda1) * 0.5), cos(phi1), 0.5))) * (2.0 * R);
          }
          
          function code(R, lambda1, lambda2, phi1, phi2)
          	return Float64(atan(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), Float64(cos(phi2) * cos(phi1)), Float64(0.5 - Float64(cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt(fma(Float64(cos(lambda1) * 0.5), cos(phi1), 0.5))) * Float64(2.0 * R))
          end
          
          code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[lambda1], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(N[Cos[phi2], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] + N[(0.5 - N[(N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(N[Cos[lambda1], $MachinePrecision] * 0.5), $MachinePrecision] * N[Cos[phi1], $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \lambda_1 \cdot 0.5, \cos \phi_1, 0.5\right)}} \cdot \left(2 \cdot R\right)
          \end{array}
          
          Derivation
          1. Initial program 66.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. Applied rewrites62.1%

            \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right)\right) \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
          4. Taylor expanded in phi2 around 0

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \phi_1\right) - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          5. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
            2. lower-+.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
            3. *-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \left(\color{blue}{\cos \phi_1 \cdot \frac{1}{2}} - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
            4. distribute-lft-out--N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
            5. lower-*.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
            6. lower-cos.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1} \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
            7. lower--.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \color{blue}{\left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
            8. lower--.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}\right)}} \cdot \left(R \cdot 2\right) \]
            9. *-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            10. lower-*.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            11. lower-cos.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            12. lower--.f6443.3

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          6. Applied rewrites43.3%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}}} \cdot \left(R \cdot 2\right) \]
          7. Taylor expanded in lambda2 around 0

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
          8. Step-by-step derivation
            1. cancel-sign-sub-invN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            2. metadata-evalN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            3. +-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            4. *-commutativeN/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            5. lower-fma.f64N/A

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
            6. lower-cos.f6433.6

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          9. Applied rewrites33.6%

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
          10. Taylor expanded in lambda2 around 0

            \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\frac{1}{2} \cdot \left(\cos \lambda_1 \cdot \cos \phi_1\right)}}} \cdot \left(R \cdot 2\right) \]
          11. Step-by-step derivation
            1. Applied rewrites33.4%

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(\cos \lambda_1 \cdot 0.5, \color{blue}{\cos \phi_1}, 0.5\right)}} \cdot \left(R \cdot 2\right) \]
            2. Final simplification33.4%

              \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \lambda_1 \cdot 0.5, \cos \phi_1, 0.5\right)}} \cdot \left(2 \cdot R\right) \]
            3. Add Preprocessing

            Alternative 23: 29.9% accurate, 2.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \phi_2 \cdot \cos \phi_1\\ t_1 := 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\\ t_2 := \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), t\_0, t\_1\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{if}\;\lambda_1 \leq -7.8 \cdot 10^{-16}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\lambda_1 \leq 1.15:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.25 \cdot \left(\lambda_1 \cdot \lambda_1\right), t\_0, t\_1\right)}}{\sqrt{\left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            (FPCore (R lambda1 lambda2 phi1 phi2)
             :precision binary64
             (let* ((t_0 (* (cos phi2) (cos phi1)))
                    (t_1 (- 0.5 (* (cos (* (* (- phi1 phi2) 0.5) 2.0)) 0.5)))
                    (t_2
                     (*
                      (atan2
                       (sqrt (fma (fma (cos lambda1) -0.5 0.5) t_0 t_1))
                       (sqrt (fma (cos (- lambda2 lambda1)) 0.5 0.5)))
                      (* 2.0 R))))
               (if (<= lambda1 -7.8e-16)
                 t_2
                 (if (<= lambda1 1.15)
                   (*
                    (atan2
                     (sqrt (fma (* 0.25 (* lambda1 lambda1)) t_0 t_1))
                     (sqrt
                      (+
                       (* (- 0.5 (- 0.5 (* (cos (- lambda1 lambda2)) 0.5))) (cos phi1))
                       0.5)))
                    (* 2.0 R))
                   t_2))))
            double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
            	double t_0 = cos(phi2) * cos(phi1);
            	double t_1 = 0.5 - (cos((((phi1 - phi2) * 0.5) * 2.0)) * 0.5);
            	double t_2 = atan2(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), t_0, t_1)), sqrt(fma(cos((lambda2 - lambda1)), 0.5, 0.5))) * (2.0 * R);
            	double tmp;
            	if (lambda1 <= -7.8e-16) {
            		tmp = t_2;
            	} else if (lambda1 <= 1.15) {
            		tmp = atan2(sqrt(fma((0.25 * (lambda1 * lambda1)), t_0, t_1)), sqrt((((0.5 - (0.5 - (cos((lambda1 - lambda2)) * 0.5))) * cos(phi1)) + 0.5))) * (2.0 * R);
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            function code(R, lambda1, lambda2, phi1, phi2)
            	t_0 = Float64(cos(phi2) * cos(phi1))
            	t_1 = Float64(0.5 - Float64(cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0)) * 0.5))
            	t_2 = Float64(atan(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), t_0, t_1)), sqrt(fma(cos(Float64(lambda2 - lambda1)), 0.5, 0.5))) * Float64(2.0 * R))
            	tmp = 0.0
            	if (lambda1 <= -7.8e-16)
            		tmp = t_2;
            	elseif (lambda1 <= 1.15)
            		tmp = Float64(atan(sqrt(fma(Float64(0.25 * Float64(lambda1 * lambda1)), t_0, t_1)), sqrt(Float64(Float64(Float64(0.5 - Float64(0.5 - Float64(cos(Float64(lambda1 - lambda2)) * 0.5))) * cos(phi1)) + 0.5))) * Float64(2.0 * R));
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            code[R_, lambda1_, lambda2_, phi1_, phi2_] := Block[{t$95$0 = N[(N[Cos[phi2], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 - N[(N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[lambda1], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Cos[N[(lambda2 - lambda1), $MachinePrecision]], $MachinePrecision] * 0.5 + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[lambda1, -7.8e-16], t$95$2, If[LessEqual[lambda1, 1.15], N[(N[ArcTan[N[Sqrt[N[(N[(0.25 * N[(lambda1 * lambda1), $MachinePrecision]), $MachinePrecision] * t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(N[(0.5 - N[(0.5 - N[(N[Cos[N[(lambda1 - lambda2), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \cos \phi_2 \cdot \cos \phi_1\\
            t_1 := 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\\
            t_2 := \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), t\_0, t\_1\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\
            \mathbf{if}\;\lambda_1 \leq -7.8 \cdot 10^{-16}:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;\lambda_1 \leq 1.15:\\
            \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.25 \cdot \left(\lambda_1 \cdot \lambda_1\right), t\_0, t\_1\right)}}{\sqrt{\left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if lambda1 < -7.79999999999999954e-16 or 1.1499999999999999 < lambda1

              1. Initial program 48.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. Applied rewrites48.6%

                \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right)\right) \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
              4. Taylor expanded in phi2 around 0

                \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \phi_1\right) - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}} \cdot \left(R \cdot 2\right) \]
              5. Step-by-step derivation
                1. associate--l+N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                2. lower-+.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                3. *-commutativeN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \left(\color{blue}{\cos \phi_1 \cdot \frac{1}{2}} - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                4. distribute-lft-out--N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                5. lower-*.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                6. lower-cos.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1} \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                7. lower--.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \color{blue}{\left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                8. lower--.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}\right)}} \cdot \left(R \cdot 2\right) \]
                9. *-commutativeN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                10. lower-*.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                11. lower-cos.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                12. lower--.f6438.9

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
              6. Applied rewrites38.9%

                \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}}} \cdot \left(R \cdot 2\right) \]
              7. Taylor expanded in lambda2 around 0

                \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
              8. Step-by-step derivation
                1. cancel-sign-sub-invN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                2. metadata-evalN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                3. +-commutativeN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                4. *-commutativeN/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                5. lower-fma.f64N/A

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                6. lower-cos.f6438.5

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
              9. Applied rewrites38.5%

                \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
              10. Taylor expanded in phi1 around 0

                \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)}}} \cdot \left(R \cdot 2\right) \]
              11. Step-by-step derivation
                1. Applied rewrites30.0%

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), \color{blue}{0.5}, 0.5\right)}} \cdot \left(R \cdot 2\right) \]

                if -7.79999999999999954e-16 < lambda1 < 1.1499999999999999

                1. Initial program 82.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. Applied rewrites74.2%

                  \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right)\right) \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
                4. Taylor expanded in phi2 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \phi_1\right) - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                5. Step-by-step derivation
                  1. associate--l+N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  2. lower-+.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  3. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \left(\color{blue}{\cos \phi_1 \cdot \frac{1}{2}} - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  4. distribute-lft-out--N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  5. lower-*.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  6. lower-cos.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1} \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  7. lower--.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \color{blue}{\left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  8. lower--.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}\right)}} \cdot \left(R \cdot 2\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  10. lower-*.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  11. lower-cos.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  12. lower--.f6447.3

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                6. Applied rewrites47.3%

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                7. Taylor expanded in lambda2 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                8. Step-by-step derivation
                  1. cancel-sign-sub-invN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  2. metadata-evalN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  5. lower-fma.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  6. lower-cos.f6429.2

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                9. Applied rewrites29.2%

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                10. Taylor expanded in lambda1 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{4} \cdot \color{blue}{{\lambda_1}^{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                11. Step-by-step derivation
                  1. Applied rewrites31.7%

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\left(\lambda_1 \cdot \lambda_1\right) \cdot \color{blue}{0.25}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                12. Recombined 2 regimes into one program.
                13. Final simplification30.9%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 \leq -7.8 \cdot 10^{-16}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\ \mathbf{elif}\;\lambda_1 \leq 1.15:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.25 \cdot \left(\lambda_1 \cdot \lambda_1\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right) \cdot \cos \phi_1 + 0.5}} \cdot \left(2 \cdot R\right)\\ \mathbf{else}:\\ \;\;\;\;\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)\\ \end{array} \]
                14. Add Preprocessing

                Alternative 24: 24.3% accurate, 2.1× speedup?

                \[\begin{array}{l} \\ \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right) \end{array} \]
                (FPCore (R lambda1 lambda2 phi1 phi2)
                 :precision binary64
                 (*
                  (atan2
                   (sqrt
                    (fma
                     (fma (cos lambda1) -0.5 0.5)
                     (* (cos phi2) (cos phi1))
                     (- 0.5 (* (cos (* (* (- phi1 phi2) 0.5) 2.0)) 0.5))))
                   (sqrt (fma (cos (- lambda2 lambda1)) 0.5 0.5)))
                  (* 2.0 R)))
                double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
                	return atan2(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), (cos(phi2) * cos(phi1)), (0.5 - (cos((((phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt(fma(cos((lambda2 - lambda1)), 0.5, 0.5))) * (2.0 * R);
                }
                
                function code(R, lambda1, lambda2, phi1, phi2)
                	return Float64(atan(sqrt(fma(fma(cos(lambda1), -0.5, 0.5), Float64(cos(phi2) * cos(phi1)), Float64(0.5 - Float64(cos(Float64(Float64(Float64(phi1 - phi2) * 0.5) * 2.0)) * 0.5)))), sqrt(fma(cos(Float64(lambda2 - lambda1)), 0.5, 0.5))) * Float64(2.0 * R))
                end
                
                code[R_, lambda1_, lambda2_, phi1_, phi2_] := N[(N[ArcTan[N[Sqrt[N[(N[(N[Cos[lambda1], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[(N[Cos[phi2], $MachinePrecision] * N[Cos[phi1], $MachinePrecision]), $MachinePrecision] + N[(0.5 - N[(N[Cos[N[(N[(N[(phi1 - phi2), $MachinePrecision] * 0.5), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[Cos[N[(lambda2 - lambda1), $MachinePrecision]], $MachinePrecision] * 0.5 + 0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(2.0 * R), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right)
                \end{array}
                
                Derivation
                1. Initial program 66.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. Applied rewrites62.1%

                  \[\leadsto \color{blue}{\tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right) - \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right)\right) \cdot \left(\cos \phi_2 \cdot \cos \phi_1\right)}} \cdot \left(R \cdot 2\right)} \]
                4. Taylor expanded in phi2 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\left(\frac{1}{2} + \frac{1}{2} \cdot \cos \phi_1\right) - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                5. Step-by-step derivation
                  1. associate--l+N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  2. lower-+.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{\frac{1}{2} + \left(\frac{1}{2} \cdot \cos \phi_1 - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  3. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \left(\color{blue}{\cos \phi_1 \cdot \frac{1}{2}} - \cos \phi_1 \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  4. distribute-lft-out--N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  5. lower-*.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  6. lower-cos.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\cos \phi_1} \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  7. lower--.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \color{blue}{\left(\frac{1}{2} - \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                  8. lower--.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \color{blue}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}\right)}} \cdot \left(R \cdot 2\right) \]
                  9. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  10. lower-*.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  11. lower-cos.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \color{blue}{\cos \left(\lambda_1 - \lambda_2\right)} \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  12. lower--.f6443.3

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \color{blue}{\left(\lambda_1 - \lambda_2\right)} \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                6. Applied rewrites43.3%

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\color{blue}{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}}} \cdot \left(R \cdot 2\right) \]
                7. Taylor expanded in lambda2 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} - \frac{1}{2} \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                8. Step-by-step derivation
                  1. cancel-sign-sub-invN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{1}{2} + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \cos \lambda_1}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  2. metadata-evalN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\frac{1}{2} + \color{blue}{\frac{-1}{2}} \cdot \cos \lambda_1, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\frac{-1}{2} \cdot \cos \lambda_1 + \frac{1}{2}}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\cos \lambda_1 \cdot \frac{-1}{2}} + \frac{1}{2}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  5. lower-fma.f64N/A

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right)}, \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \cos \phi_1 \cdot \left(\frac{1}{2} - \left(\frac{1}{2} - \cos \left(\lambda_1 - \lambda_2\right) \cdot \frac{1}{2}\right)\right)}} \cdot \left(R \cdot 2\right) \]
                  6. lower-cos.f6433.6

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\cos \lambda_1}, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                9. Applied rewrites33.6%

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right)}, \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{0.5 + \cos \phi_1 \cdot \left(0.5 - \left(0.5 - \cos \left(\lambda_1 - \lambda_2\right) \cdot 0.5\right)\right)}} \cdot \left(R \cdot 2\right) \]
                10. Taylor expanded in phi1 around 0

                  \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, \frac{-1}{2}, \frac{1}{2}\right), \cos \phi_2 \cdot \cos \phi_1, \frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot \left(\frac{1}{2} \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\frac{1}{2} + \color{blue}{\frac{1}{2} \cdot \cos \left(\lambda_1 - \lambda_2\right)}}} \cdot \left(R \cdot 2\right) \]
                11. Step-by-step derivation
                  1. Applied rewrites23.9%

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - 0.5 \cdot \cos \left(2 \cdot \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right)\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), \color{blue}{0.5}, 0.5\right)}} \cdot \left(R \cdot 2\right) \]
                  2. Final simplification23.9%

                    \[\leadsto \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(\cos \lambda_1, -0.5, 0.5\right), \cos \phi_2 \cdot \cos \phi_1, 0.5 - \cos \left(\left(\left(\phi_1 - \phi_2\right) \cdot 0.5\right) \cdot 2\right) \cdot 0.5\right)}}{\sqrt{\mathsf{fma}\left(\cos \left(\lambda_2 - \lambda_1\right), 0.5, 0.5\right)}} \cdot \left(2 \cdot R\right) \]
                  3. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024240 
                  (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))))))))))