?

Average Error: 24.1 → 13.8
Time: 1.7min
Precision: binary64
Cost: 184448

?

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

Error?

Derivation?

  1. Initial program 24.1

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

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

    [Start]24.1

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

    associate-*l* [=>]24.1

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

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

    \[\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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\left(1 - {\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}\right) - \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  5. Applied egg-rr13.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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\left(1 - {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_2\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(0.5 \cdot \phi_2\right)\right)}^{4}\right) \cdot \frac{1}{1 + {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_2\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(0.5 \cdot \phi_2\right)\right)}^{2}}} - \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  6. Simplified13.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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\frac{1 - {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{4}}{1 + {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{2}}} - \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    Proof

    [Start]13.9

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

    associate-*r/ [=>]13.8

    \[ 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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\frac{\left(1 - {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_2\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(0.5 \cdot \phi_2\right)\right)}^{4}\right) \cdot 1}{1 + {\left(\sin \left(\phi_1 \cdot 0.5\right) \cdot \cos \left(0.5 \cdot \phi_2\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(0.5 \cdot \phi_2\right)\right)}^{2}}} - \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  7. Applied egg-rr13.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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\frac{1 - {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{4}}{1 + {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{2}} + \left(0.5 - 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) \cdot \left(-\cos \phi_1 \cdot \cos \phi_2\right)}}}\right) \]
  8. Simplified13.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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\mathsf{fma}\left(0.5 + -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right), \left(-\cos \phi_1\right) \cdot \cos \phi_2, \frac{1 - {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{4}}{1 + {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{2}}\right)}}}\right) \]
    Proof

    [Start]13.8

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

    *-commutative [=>]13.8

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

    distribute-lft-neg-in [=>]13.8

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

    associate-*r* [<=]13.8

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

    distribute-lft-neg-in [<=]13.8

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

    sub-neg [<=]13.8

    \[ 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(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(\sin \left(\frac{\lambda_1 - \lambda_2}{2}\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}{\sqrt{\color{blue}{\frac{1 - {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{4}}{1 + {\left(\mathsf{fma}\left(\cos \left(0.5 \cdot \phi_2\right), \sin \left(0.5 \cdot \phi_1\right), \sin \left(0.5 \cdot \phi_2\right) \cdot \left(-\cos \left(0.5 \cdot \phi_1\right)\right)\right)\right)}^{2}} - \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(0.5 - 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}}\right) \]
  9. Final simplification13.8

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

Alternatives

Alternative 1
Error13.8
Cost178112
\[\begin{array}{l} t_0 := \sin \left(0.5 \cdot \phi_2\right)\\ t_1 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_3 := \cos \left(0.5 \cdot \phi_2\right)\\ t_4 := \cos \phi_1 \cdot \cos \phi_2\\ t_5 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_6 := \mathsf{fma}\left(t_3, t_5, t_0 \cdot \left(-t_1\right)\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_4 \cdot \left(t_2 \cdot t_2\right) + {\left(t_3 \cdot t_5 - t_0 \cdot t_1\right)}^{2}}}{\sqrt{\frac{1 - {t_6}^{4}}{1 + {t_6}^{2}} + t_4 \cdot \left(-0.5 + 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)}}\right) \end{array} \]
Alternative 2
Error13.8
Cost132224
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2}\\ t_2 := \cos \phi_1 \cdot \cos \phi_2\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_2 \cdot \left(t_0 \cdot t_0\right) + t_1}}{\sqrt{1 - \left(t_1 + t_2 \cdot \left(0.5 + -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}\right) \end{array} \]
Alternative 3
Error13.8
Cost132224
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2}\\ t_2 := \cos \phi_1 \cdot \cos \phi_2\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_2 \cdot \left(t_0 \cdot t_0\right) + t_1}}{\sqrt{t_2 \cdot \left(-0.5 + 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right) + \left(1 - t_1\right)}}\right) \end{array} \]
Alternative 4
Error23.5
Cost112384
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 \cdot \left(t_0 \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \left({\left(\cos \left(0.5 \cdot \phi_2\right) \cdot \sin \left(\phi_1 \cdot 0.5\right) - \sin \left(0.5 \cdot \phi_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}^{2} + t_1 \cdot \left(0.5 + -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)}}\right) \end{array} \]
Alternative 5
Error23.8
Cost105216
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_0 \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{\left|1 - \mathsf{fma}\left(\cos \phi_1, \cos \phi_2 \cdot \left(0.5 + -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right), {\sin \left(-0.5 \cdot \left(\phi_2 - \phi_1\right)\right)}^{2}\right)\right|}}\right) \end{array} \]
Alternative 6
Error30.4
Cost98697
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ \mathbf{if}\;t_0 \leq -0.02 \lor \neg \left(t_0 \leq 0.042\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 + {\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - t_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t_0 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_0\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right)\\ \end{array} \]
Alternative 7
Error24.1
Cost92544
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_0 \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 + \left(\cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(-0.5 + 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right) - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}}\right) \end{array} \]
Alternative 8
Error24.1
Cost92544
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_0 \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{\left(1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot \left(-0.5 + 0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\right)\right)\right) - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right) \end{array} \]
Alternative 9
Error23.6
Cost92361
\[\begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_1 := {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ t_2 := \cos \phi_1 \cdot t_1\\ t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;\phi_1 \leq -7.2 \cdot 10^{-7} \lor \neg \left(\phi_1 \leq 1.05 \cdot 10^{-6}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_0 + t_2}}{\sqrt{\left(1 - t_0\right) - t_2}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_3 \cdot t_3\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - \cos \phi_2 \cdot t_1}}\right)\\ \end{array} \]
Alternative 10
Error23.6
Cost92361
\[\begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_1 := \cos \phi_1 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;\phi_1 \leq -7.2 \cdot 10^{-7} \lor \neg \left(\phi_1 \leq 1.05 \cdot 10^{-6}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_0 + t_1}}{\sqrt{\left(1 - t_0\right) - t_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t_2 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_2\right)}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - \cos \phi_2 \cdot {\sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)}^{2}}}\right)\\ \end{array} \]
Alternative 11
Error36.2
Cost86152
\[\begin{array}{l} t_0 := \cos \phi_1 \cdot \cos \phi_2\\ t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_2 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\ t_3 := \sqrt{t_0 \cdot \left(t_1 \cdot t_1\right) + t_2}\\ t_4 := -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\\ \mathbf{if}\;t_1 \leq -0.07:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_3}{\sqrt{0.5 - t_4}}\right)\\ \mathbf{elif}\;t_1 \leq 0.045:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_2 + t_1 \cdot \left(t_0 \cdot t_1\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_3}{\sqrt{1 + \left(1 - \left(t_4 + 1.5\right)\right)}}\right)\\ \end{array} \]
Alternative 12
Error36.2
Cost86152
\[\begin{array}{l} t_0 := -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ t_2 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_3 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\ t_4 := \sqrt{t_1 \cdot \left(t_2 \cdot t_2\right) + t_3}\\ \mathbf{if}\;t_2 \leq -0.07:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_4}{\sqrt{\log \left(e^{0.5 - t_0}\right)}}\right)\\ \mathbf{elif}\;t_2 \leq 0.045:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_3 + t_2 \cdot \left(t_1 \cdot t_2\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_4}{\sqrt{1 + \left(1 - \left(t_0 + 1.5\right)\right)}}\right)\\ \end{array} \]
Alternative 13
Error23.6
Cost86089
\[\begin{array}{l} t_0 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_1 := {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ t_2 := \cos \phi_1 \cdot t_1\\ t_3 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;\phi_1 \leq -7.2 \cdot 10^{-7} \lor \neg \left(\phi_1 \leq 1.05 \cdot 10^{-6}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_0 + t_2}}{\sqrt{\left(1 - t_0\right) - t_2}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_3 \cdot t_3\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{\left(0.5 + 0.5 \cdot \cos \left(-\phi_2\right)\right) - \cos \phi_2 \cdot t_1}}\right)\\ \end{array} \]
Alternative 14
Error31.5
Cost85712
\[\begin{array}{l} t_0 := \sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\\ t_1 := \cos \phi_1 \cdot \cos \phi_2\\ t_2 := \sin \left(\phi_1 \cdot 0.5\right)\\ t_3 := {t_0}^{2}\\ t_4 := \cos \phi_2 \cdot t_3\\ t_5 := R \cdot \left(2 \cdot \tan^{-1}_* \frac{\mathsf{hypot}\left(t_0 \cdot \sqrt{t_1}, t_2\right)}{\sqrt{\left(1 - {t_2}^{2}\right) - \cos \phi_1 \cdot t_3}}\right)\\ t_6 := R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_4 + {\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - t_4}}\right)\\ t_7 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ \mathbf{if}\;\phi_2 \leq -7.2 \cdot 10^{-14}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;\phi_2 \leq 4 \cdot 10^{-156}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;\phi_2 \leq 9.8 \cdot 10^{-73}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t_7 \cdot \left(t_1 \cdot t_7\right)}}{\sqrt{1 - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right)\\ \mathbf{elif}\;\phi_2 \leq 1.22 \cdot 10^{-26}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_6\\ \end{array} \]
Alternative 15
Error24.8
Cost85513
\[\begin{array}{l} t_0 := {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ t_1 := \cos \phi_2 \cdot t_0\\ t_2 := {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\\ t_3 := \cos \phi_1 \cdot t_0\\ \mathbf{if}\;\phi_2 \leq -1.25 \cdot 10^{-11} \lor \neg \left(\phi_2 \leq 2.8 \cdot 10^{-25}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 + {\sin \left(\phi_2 \cdot -0.5\right)}^{2}}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - t_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_2 + t_3}}{\sqrt{\left(1 - t_2\right) - t_3}}\right)\\ \end{array} \]
Alternative 16
Error41.9
Cost66112
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_0 \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{0.5 - -0.5 \cdot \cos \left(\lambda_1 - \lambda_2\right)}}\right) \end{array} \]
Alternative 17
Error53.2
Cost65929
\[\begin{array}{l} t_0 := \sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)\\ t_1 := \cos \left(\phi_2 \cdot -0.5\right)\\ t_2 := {t_0}^{2}\\ \mathbf{if}\;\phi_2 \leq -8.6 \cdot 10^{-154} \lor \neg \left(\phi_2 \leq 1.4 \cdot 10^{-153}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{-0.5 \cdot \left(\phi_1 \cdot t_1\right) - \sin \left(\phi_2 \cdot -0.5\right)}{\sqrt{{t_1}^{2} - \cos \phi_2 \cdot t_2}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_0 \cdot \sqrt{\cos \phi_2}}{\sqrt{\left(1 - {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right) - \cos \phi_1 \cdot t_2}}\right)\\ \end{array} \]
Alternative 18
Error54.0
Cost59524
\[\begin{array}{l} t_0 := \cos \left(\phi_2 \cdot -0.5\right)\\ t_1 := \sqrt{{t_0}^{2} - \cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}\\ \mathbf{if}\;\phi_1 \leq -2 \cdot 10^{-92}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\phi_1 \cdot \left(-0.5 \cdot t_0\right)}{t_1}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sin \left(\phi_2 \cdot -0.5\right) + 0.5 \cdot \left(\phi_1 \cdot t_0\right)}{t_1}\right)\\ \end{array} \]
Alternative 19
Error53.7
Cost59524
\[\begin{array}{l} t_0 := \cos \left(\phi_2 \cdot -0.5\right)\\ t_1 := \phi_1 \cdot t_0\\ t_2 := \sin \left(\phi_2 \cdot -0.5\right)\\ t_3 := \sqrt{{t_0}^{2} - \cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}\\ \mathbf{if}\;\phi_1 \leq 1.72 \cdot 10^{-105}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{-0.5 \cdot t_1 - t_2}{t_3}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_2 + 0.5 \cdot t_1}{t_3}\right)\\ \end{array} \]
Alternative 20
Error56.6
Cost52868
\[\begin{array}{l} t_0 := \cos \left(\phi_2 \cdot -0.5\right)\\ t_1 := {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ \mathbf{if}\;\phi_1 \leq -1.05 \cdot 10^{-300}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\phi_1 \cdot \left(-0.5 \cdot t_0\right)}{\sqrt{{t_0}^{2} - \cos \phi_2 \cdot t_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{0.5 \cdot \left(\phi_1 \cdot t_0\right)}{\sqrt{1 - t_1}}\right)\\ \end{array} \]
Alternative 21
Error58.5
Cost52608
\[\begin{array}{l} t_0 := \cos \left(\phi_2 \cdot -0.5\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{0.5 \cdot \left(\phi_1 \cdot t_0\right)}{\sqrt{{t_0}^{2} - \cos \phi_2 \cdot {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}}}\right) \end{array} \]
Alternative 22
Error58.5
Cost33216
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{0.5 \cdot \left(\phi_1 \cdot \cos \left(\phi_2 \cdot -0.5\right)\right)}{\sqrt{1 - {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}}}\right) \]

Error

Reproduce?

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