Average Error: 24.0 → 13.5
Time: 1.1min
Precision: binary64
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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 := \cos \left(\phi_1 \cdot 0.5\right)\\ t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_2 := \sin \left(\phi_2 \cdot 0.5\right)\\ t_3 := \cos \left(\phi_2 \cdot 0.5\right)\\ t_4 := \sin \left(\phi_1 \cdot 0.5\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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} + t_1 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_1\right)}}{\sqrt{\mathsf{fma}\left(2, t_0 \cdot \left(\left(t_2 \cdot t_3\right) \cdot t_4\right), 1\right) - \mathsf{fma}\left({t_3}^{2}, {t_4}^{2}, \mathsf{fma}\left({t_2}^{2}, {t_0}^{2}, \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\left(\cos \left(\lambda_1 \cdot 0.5\right) \cdot \sin \left(\lambda_2 \cdot -0.5\right) + \sin \left(\lambda_1 \cdot 0.5\right) \cdot \cos \left(\lambda_2 \cdot -0.5\right)\right)}^{2}\right)\right)\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 (cos (* phi1 0.5)))
        (t_1 (sin (/ (- lambda1 lambda2) 2.0)))
        (t_2 (sin (* phi2 0.5)))
        (t_3 (cos (* phi2 0.5)))
        (t_4 (sin (* phi1 0.5))))
   (*
    R
    (*
     2.0
     (atan2
      (sqrt
       (+
        (pow
         (-
          (* (sin (/ phi1 2.0)) (cos (/ phi2 2.0)))
          (* (cos (/ phi1 2.0)) (sin (/ phi2 2.0))))
         2.0)
        (* t_1 (* (* (cos phi1) (cos phi2)) t_1))))
      (sqrt
       (-
        (fma 2.0 (* t_0 (* (* t_2 t_3) t_4)) 1.0)
        (fma
         (pow t_3 2.0)
         (pow t_4 2.0)
         (fma
          (pow t_2 2.0)
          (pow t_0 2.0)
          (*
           (cos phi2)
           (*
            (cos phi1)
            (pow
             (+
              (* (cos (* lambda1 0.5)) (sin (* lambda2 -0.5)))
              (* (sin (* lambda1 0.5)) (cos (* lambda2 -0.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 = cos((phi1 * 0.5));
	double t_1 = sin(((lambda1 - lambda2) / 2.0));
	double t_2 = sin((phi2 * 0.5));
	double t_3 = cos((phi2 * 0.5));
	double t_4 = sin((phi1 * 0.5));
	return R * (2.0 * atan2(sqrt((pow(((sin((phi1 / 2.0)) * cos((phi2 / 2.0))) - (cos((phi1 / 2.0)) * sin((phi2 / 2.0)))), 2.0) + (t_1 * ((cos(phi1) * cos(phi2)) * t_1)))), sqrt((fma(2.0, (t_0 * ((t_2 * t_3) * t_4)), 1.0) - fma(pow(t_3, 2.0), pow(t_4, 2.0), fma(pow(t_2, 2.0), pow(t_0, 2.0), (cos(phi2) * (cos(phi1) * pow(((cos((lambda1 * 0.5)) * sin((lambda2 * -0.5))) + (sin((lambda1 * 0.5)) * cos((lambda2 * -0.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 = cos(Float64(phi1 * 0.5))
	t_1 = sin(Float64(Float64(lambda1 - lambda2) / 2.0))
	t_2 = sin(Float64(phi2 * 0.5))
	t_3 = cos(Float64(phi2 * 0.5))
	t_4 = sin(Float64(phi1 * 0.5))
	return Float64(R * Float64(2.0 * atan(sqrt(Float64((Float64(Float64(sin(Float64(phi1 / 2.0)) * cos(Float64(phi2 / 2.0))) - Float64(cos(Float64(phi1 / 2.0)) * sin(Float64(phi2 / 2.0)))) ^ 2.0) + Float64(t_1 * Float64(Float64(cos(phi1) * cos(phi2)) * t_1)))), sqrt(Float64(fma(2.0, Float64(t_0 * Float64(Float64(t_2 * t_3) * t_4)), 1.0) - fma((t_3 ^ 2.0), (t_4 ^ 2.0), fma((t_2 ^ 2.0), (t_0 ^ 2.0), Float64(cos(phi2) * Float64(cos(phi1) * (Float64(Float64(cos(Float64(lambda1 * 0.5)) * sin(Float64(lambda2 * -0.5))) + Float64(sin(Float64(lambda1 * 0.5)) * cos(Float64(lambda2 * -0.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[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[(lambda1 - lambda2), $MachinePrecision] / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(phi2 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(R * N[(2.0 * N[ArcTan[N[Sqrt[N[(N[Power[N[(N[(N[Sin[N[(phi1 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(phi2 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[N[(phi1 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(phi2 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(t$95$1 * N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t$95$0 * N[(N[(t$95$2 * t$95$3), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Power[t$95$3, 2.0], $MachinePrecision] * N[Power[t$95$4, 2.0], $MachinePrecision] + N[(N[Power[t$95$2, 2.0], $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Cos[phi2], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Power[N[(N[(N[Cos[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(lambda1 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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 := \cos \left(\phi_1 \cdot 0.5\right)\\
t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\
t_2 := \sin \left(\phi_2 \cdot 0.5\right)\\
t_3 := \cos \left(\phi_2 \cdot 0.5\right)\\
t_4 := \sin \left(\phi_1 \cdot 0.5\right)\\
R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\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} + t_1 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_1\right)}}{\sqrt{\mathsf{fma}\left(2, t_0 \cdot \left(\left(t_2 \cdot t_3\right) \cdot t_4\right), 1\right) - \mathsf{fma}\left({t_3}^{2}, {t_4}^{2}, \mathsf{fma}\left({t_2}^{2}, {t_0}^{2}, \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\left(\cos \left(\lambda_1 \cdot 0.5\right) \cdot \sin \left(\lambda_2 \cdot -0.5\right) + \sin \left(\lambda_1 \cdot 0.5\right) \cdot \cos \left(\lambda_2 \cdot -0.5\right)\right)}^{2}\right)\right)\right)}}\right)
\end{array}

Error

Bits error versus R

Bits error versus lambda1

Bits error versus lambda2

Bits error versus phi1

Bits error versus phi2

Derivation

  1. Initial program 24.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. Applied div-sub_binary6424.0

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

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

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

    \[\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({\left(\sin \left(\frac{\phi_1}{2}\right) \cdot \cos \left(\frac{\phi_2}{2}\right) - \cos \left(\frac{\phi_1}{2}\right) \cdot \sin \left(\frac{\phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
  6. Taylor expanded in lambda1 around -inf 13.9

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

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

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

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

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

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

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

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

Reproduce

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