?

Average Error: 24.3 → 14.7
Time: 1.6min
Precision: binary64
Cost: 138441

?

\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\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 := {\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}\\ t_1 := {\left(t_0 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}\\ \mathbf{if}\;\lambda_1 \leq -2.4 \cdot 10^{+41} \lor \neg \left(\lambda_1 \leq 1.22 \cdot 10^{-5}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{1 - \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\sin \left(0.5 \cdot \lambda_1\right)}^{2}\right)\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{1 - \left(t_0 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\lambda_2 \cdot -0.5\right)}^{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
         (pow
          (-
           (* (sin (* phi1 0.5)) (cos (* 0.5 phi2)))
           (* (cos (* phi1 0.5)) (sin (* 0.5 phi2))))
          2.0))
        (t_1
         (pow
          (+
           t_0
           (*
            (cos phi1)
            (* (cos phi2) (pow (sin (* 0.5 (- lambda1 lambda2))) 2.0))))
          0.5)))
   (if (or (<= lambda1 -2.4e+41) (not (<= lambda1 1.22e-5)))
     (*
      R
      (*
       2.0
       (atan2
        t_1
        (sqrt
         (-
          1.0
          (+
           t_0
           (* (cos phi2) (* (cos phi1) (pow (sin (* 0.5 lambda1)) 2.0)))))))))
     (*
      R
      (*
       2.0
       (atan2
        t_1
        (sqrt
         (-
          1.0
          (+
           t_0
           (*
            (* (cos phi1) (cos phi2))
            (pow (sin (* 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 = pow(((sin((phi1 * 0.5)) * cos((0.5 * phi2))) - (cos((phi1 * 0.5)) * sin((0.5 * phi2)))), 2.0);
	double t_1 = pow((t_0 + (cos(phi1) * (cos(phi2) * pow(sin((0.5 * (lambda1 - lambda2))), 2.0)))), 0.5);
	double tmp;
	if ((lambda1 <= -2.4e+41) || !(lambda1 <= 1.22e-5)) {
		tmp = R * (2.0 * atan2(t_1, sqrt((1.0 - (t_0 + (cos(phi2) * (cos(phi1) * pow(sin((0.5 * lambda1)), 2.0))))))));
	} else {
		tmp = R * (2.0 * atan2(t_1, sqrt((1.0 - (t_0 + ((cos(phi1) * cos(phi2)) * pow(sin((lambda2 * -0.5)), 2.0)))))));
	}
	return tmp;
}
real(8) function code(r, lambda1, lambda2, phi1, phi2)
    real(8), intent (in) :: r
    real(8), intent (in) :: lambda1
    real(8), intent (in) :: lambda2
    real(8), intent (in) :: phi1
    real(8), intent (in) :: phi2
    code = r * (2.0d0 * atan2(sqrt(((sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0) + (((cos(phi1) * cos(phi2)) * sin(((lambda1 - lambda2) / 2.0d0))) * sin(((lambda1 - lambda2) / 2.0d0))))), sqrt((1.0d0 - ((sin(((phi1 - phi2) / 2.0d0)) ** 2.0d0) + (((cos(phi1) * cos(phi2)) * sin(((lambda1 - lambda2) / 2.0d0))) * sin(((lambda1 - lambda2) / 2.0d0))))))))
end function
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
    real(8) :: tmp
    t_0 = ((sin((phi1 * 0.5d0)) * cos((0.5d0 * phi2))) - (cos((phi1 * 0.5d0)) * sin((0.5d0 * phi2)))) ** 2.0d0
    t_1 = (t_0 + (cos(phi1) * (cos(phi2) * (sin((0.5d0 * (lambda1 - lambda2))) ** 2.0d0)))) ** 0.5d0
    if ((lambda1 <= (-2.4d+41)) .or. (.not. (lambda1 <= 1.22d-5))) then
        tmp = r * (2.0d0 * atan2(t_1, sqrt((1.0d0 - (t_0 + (cos(phi2) * (cos(phi1) * (sin((0.5d0 * lambda1)) ** 2.0d0))))))))
    else
        tmp = r * (2.0d0 * atan2(t_1, sqrt((1.0d0 - (t_0 + ((cos(phi1) * cos(phi2)) * (sin((lambda2 * (-0.5d0))) ** 2.0d0)))))))
    end if
    code = tmp
end function
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	return R * (2.0 * Math.atan2(Math.sqrt((Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((Math.cos(phi1) * Math.cos(phi2)) * Math.sin(((lambda1 - lambda2) / 2.0))) * Math.sin(((lambda1 - lambda2) / 2.0))))), Math.sqrt((1.0 - (Math.pow(Math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((Math.cos(phi1) * Math.cos(phi2)) * Math.sin(((lambda1 - lambda2) / 2.0))) * Math.sin(((lambda1 - lambda2) / 2.0))))))));
}
public static double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double t_0 = Math.pow(((Math.sin((phi1 * 0.5)) * Math.cos((0.5 * phi2))) - (Math.cos((phi1 * 0.5)) * Math.sin((0.5 * phi2)))), 2.0);
	double t_1 = Math.pow((t_0 + (Math.cos(phi1) * (Math.cos(phi2) * Math.pow(Math.sin((0.5 * (lambda1 - lambda2))), 2.0)))), 0.5);
	double tmp;
	if ((lambda1 <= -2.4e+41) || !(lambda1 <= 1.22e-5)) {
		tmp = R * (2.0 * Math.atan2(t_1, Math.sqrt((1.0 - (t_0 + (Math.cos(phi2) * (Math.cos(phi1) * Math.pow(Math.sin((0.5 * lambda1)), 2.0))))))));
	} else {
		tmp = R * (2.0 * Math.atan2(t_1, Math.sqrt((1.0 - (t_0 + ((Math.cos(phi1) * Math.cos(phi2)) * Math.pow(Math.sin((lambda2 * -0.5)), 2.0)))))));
	}
	return tmp;
}
def code(R, lambda1, lambda2, phi1, phi2):
	return R * (2.0 * math.atan2(math.sqrt((math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((math.cos(phi1) * math.cos(phi2)) * math.sin(((lambda1 - lambda2) / 2.0))) * math.sin(((lambda1 - lambda2) / 2.0))))), math.sqrt((1.0 - (math.pow(math.sin(((phi1 - phi2) / 2.0)), 2.0) + (((math.cos(phi1) * math.cos(phi2)) * math.sin(((lambda1 - lambda2) / 2.0))) * math.sin(((lambda1 - lambda2) / 2.0))))))))
def code(R, lambda1, lambda2, phi1, phi2):
	t_0 = math.pow(((math.sin((phi1 * 0.5)) * math.cos((0.5 * phi2))) - (math.cos((phi1 * 0.5)) * math.sin((0.5 * phi2)))), 2.0)
	t_1 = math.pow((t_0 + (math.cos(phi1) * (math.cos(phi2) * math.pow(math.sin((0.5 * (lambda1 - lambda2))), 2.0)))), 0.5)
	tmp = 0
	if (lambda1 <= -2.4e+41) or not (lambda1 <= 1.22e-5):
		tmp = R * (2.0 * math.atan2(t_1, math.sqrt((1.0 - (t_0 + (math.cos(phi2) * (math.cos(phi1) * math.pow(math.sin((0.5 * lambda1)), 2.0))))))))
	else:
		tmp = R * (2.0 * math.atan2(t_1, math.sqrt((1.0 - (t_0 + ((math.cos(phi1) * math.cos(phi2)) * math.pow(math.sin((lambda2 * -0.5)), 2.0)))))))
	return tmp
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 = Float64(Float64(sin(Float64(phi1 * 0.5)) * cos(Float64(0.5 * phi2))) - Float64(cos(Float64(phi1 * 0.5)) * sin(Float64(0.5 * phi2)))) ^ 2.0
	t_1 = Float64(t_0 + Float64(cos(phi1) * Float64(cos(phi2) * (sin(Float64(0.5 * Float64(lambda1 - lambda2))) ^ 2.0)))) ^ 0.5
	tmp = 0.0
	if ((lambda1 <= -2.4e+41) || !(lambda1 <= 1.22e-5))
		tmp = Float64(R * Float64(2.0 * atan(t_1, sqrt(Float64(1.0 - Float64(t_0 + Float64(cos(phi2) * Float64(cos(phi1) * (sin(Float64(0.5 * lambda1)) ^ 2.0)))))))));
	else
		tmp = Float64(R * Float64(2.0 * atan(t_1, sqrt(Float64(1.0 - Float64(t_0 + Float64(Float64(cos(phi1) * cos(phi2)) * (sin(Float64(lambda2 * -0.5)) ^ 2.0))))))));
	end
	return tmp
end
function tmp = code(R, lambda1, lambda2, phi1, phi2)
	tmp = R * (2.0 * atan2(sqrt(((sin(((phi1 - phi2) / 2.0)) ^ 2.0) + (((cos(phi1) * cos(phi2)) * sin(((lambda1 - lambda2) / 2.0))) * sin(((lambda1 - lambda2) / 2.0))))), sqrt((1.0 - ((sin(((phi1 - phi2) / 2.0)) ^ 2.0) + (((cos(phi1) * cos(phi2)) * sin(((lambda1 - lambda2) / 2.0))) * sin(((lambda1 - lambda2) / 2.0))))))));
end
function tmp_2 = code(R, lambda1, lambda2, phi1, phi2)
	t_0 = ((sin((phi1 * 0.5)) * cos((0.5 * phi2))) - (cos((phi1 * 0.5)) * sin((0.5 * phi2)))) ^ 2.0;
	t_1 = (t_0 + (cos(phi1) * (cos(phi2) * (sin((0.5 * (lambda1 - lambda2))) ^ 2.0)))) ^ 0.5;
	tmp = 0.0;
	if ((lambda1 <= -2.4e+41) || ~((lambda1 <= 1.22e-5)))
		tmp = R * (2.0 * atan2(t_1, sqrt((1.0 - (t_0 + (cos(phi2) * (cos(phi1) * (sin((0.5 * lambda1)) ^ 2.0))))))));
	else
		tmp = R * (2.0 * atan2(t_1, sqrt((1.0 - (t_0 + ((cos(phi1) * cos(phi2)) * (sin((lambda2 * -0.5)) ^ 2.0)))))));
	end
	tmp_2 = tmp;
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[Power[N[(N[(N[Sin[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(0.5 * phi2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[N[(phi1 * 0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.5 * phi2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(t$95$0 + N[(N[Cos[phi1], $MachinePrecision] * N[(N[Cos[phi2], $MachinePrecision] * N[Power[N[Sin[N[(0.5 * N[(lambda1 - lambda2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]}, If[Or[LessEqual[lambda1, -2.4e+41], N[Not[LessEqual[lambda1, 1.22e-5]], $MachinePrecision]], N[(R * N[(2.0 * N[ArcTan[t$95$1 / N[Sqrt[N[(1.0 - N[(t$95$0 + N[(N[Cos[phi2], $MachinePrecision] * N[(N[Cos[phi1], $MachinePrecision] * N[Power[N[Sin[N[(0.5 * lambda1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(R * N[(2.0 * N[ArcTan[t$95$1 / N[Sqrt[N[(1.0 - N[(t$95$0 + N[(N[(N[Cos[phi1], $MachinePrecision] * N[Cos[phi2], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[(lambda2 * -0.5), $MachinePrecision]], $MachinePrecision], 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 := {\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}\\
t_1 := {\left(t_0 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}\\
\mathbf{if}\;\lambda_1 \leq -2.4 \cdot 10^{+41} \lor \neg \left(\lambda_1 \leq 1.22 \cdot 10^{-5}\right):\\
\;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{1 - \left(t_0 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\sin \left(0.5 \cdot \lambda_1\right)}^{2}\right)\right)}}\right)\\

\mathbf{else}:\\
\;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{1 - \left(t_0 + \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}\right)}}\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if lambda1 < -2.4000000000000002e41 or 1.22000000000000001e-5 < lambda1

    1. Initial program 33.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. Applied egg-rr32.8

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

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

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

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

    if -2.4000000000000002e41 < lambda1 < 1.22000000000000001e-5

    1. Initial program 15.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. Applied egg-rr15.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(\phi_1 \cdot 0.5\right) \cdot \cos \left(\phi_2 \cdot 0.5\right) - \cos \left(\phi_1 \cdot 0.5\right) \cdot \sin \left(\phi_2 \cdot 0.5\right)\right)}}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right) \]
    3. Applied egg-rr3.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\lambda_1 \leq -2.4 \cdot 10^{+41} \lor \neg \left(\lambda_1 \leq 1.22 \cdot 10^{-5}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{{\left({\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} + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}}{\sqrt{1 - \left({\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} + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\sin \left(0.5 \cdot \lambda_1\right)}^{2}\right)\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{{\left({\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} + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}}{\sqrt{1 - \left({\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 {\sin \left(\lambda_2 \cdot -0.5\right)}^{2}\right)}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error13.9
Cost138624
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_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}\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{{\left(t_1 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}}{\sqrt{1 - \left(t_1 + t_0 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_0\right)\right)}}\right) \end{array} \]
Alternative 2
Error17.8
Cost138440
\[\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 := {\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}\\ t_3 := t_1 \cdot \left(t_0 \cdot t_1\right)\\ \mathbf{if}\;\lambda_2 \leq -14500:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t_0, t_1 \cdot t_1, t_2\right)}}{\sqrt{\left(1 + t_0 \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)\\ \mathbf{elif}\;\lambda_2 \leq 1.32 \cdot 10^{-48}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{{\left(t_2 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\right)\right)}^{0.5}}{\sqrt{1 - \left(t_2 + \cos \phi_2 \cdot \left(\cos \phi_1 \cdot {\sin \left(0.5 \cdot \lambda_1\right)}^{2}\right)\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_3 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \left(t_2 + t_3\right)}}\right)\\ \end{array} \]
Alternative 3
Error13.9
Cost138304
\[\begin{array}{l} t_0 := {\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}\\ t_1 := {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2}\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{{\left(t_0 + \cos \phi_1 \cdot \left(\cos \phi_2 \cdot t_1\right)\right)}^{0.5}}{\sqrt{\left(1 - t_0\right) - t_1 \cdot \left(\cos \phi_1 \cdot \cos \phi_2\right)}}\right) \end{array} \]
Alternative 4
Error23.7
Cost119040
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \left(t_0 \cdot t_0\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2} + t_1}}{\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)}^{2}\right) - t_1}}\right) \end{array} \]
Alternative 5
Error23.7
Cost119040
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := t_0 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_0\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\sqrt{1 - \left({\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} + t_1\right)}}\right) \end{array} \]
Alternative 6
Error23.7
Cost118720
\[\begin{array}{l} t_0 := \cos \phi_1 \cdot \cos \phi_2\\ t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 \cdot \left(t_0 \cdot t_1\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}}{\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)}^{2}\right) - {\sin \left(0.5 \cdot \left(\lambda_1 - \lambda_2\right)\right)}^{2} \cdot t_0}}\right) \end{array} \]
Alternative 7
Error24.0
Cost118272
\[\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{\mathsf{fma}\left(t_1, t_0 \cdot t_0, {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}}{\sqrt{\left(1 + t_1 \cdot \left(-0.5 + 0.5 \cdot \left(\sin \lambda_1 \cdot \sin \lambda_2 + \cos \lambda_1 \cdot \cos \lambda_2\right)\right)\right) - {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}}}\right) \end{array} \]
Alternative 8
Error24.3
Cost98816
\[\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{\mathsf{fma}\left(t_1, t_0 \cdot t_0, {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}}{\sqrt{\left(1 + t_1 \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) \end{array} \]
Alternative 9
Error24.6
Cost98633
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := {\sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)}^{2}\\ t_2 := \cos \phi_1 \cdot \cos \phi_2\\ t_3 := {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\\ \mathbf{if}\;\phi_1 \leq -6 \cdot 10^{-30} \lor \neg \left(\phi_1 \leq 5.2 \cdot 10^{+15}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_0 \cdot \left(t_2 \cdot t_0\right) + t_3}}{\sqrt{{\cos \left(\phi_1 \cdot 0.5\right)}^{2} - \cos \phi_1 \cdot t_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{\mathsf{fma}\left(t_2, t_0 \cdot t_0, t_3\right)}}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - \cos \phi_2 \cdot t_1}}\right)\\ \end{array} \]
Alternative 10
Error24.6
Cost98633
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t_0 \cdot t_0, {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}\right)}\\ t_2 := {\sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)}^{2}\\ \mathbf{if}\;\phi_1 \leq -6 \cdot 10^{-30} \lor \neg \left(\phi_1 \leq 5.2 \cdot 10^{+15}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{{\cos \left(\phi_1 \cdot 0.5\right)}^{2} - \cos \phi_1 \cdot t_2}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - \cos \phi_2 \cdot t_2}}\right)\\ \end{array} \]
Alternative 11
Error24.6
Cost92361
\[\begin{array}{l} t_0 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_1 := \sqrt{t_0 \cdot \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot t_0\right) + {\sin \left(\frac{\phi_1 - \phi_2}{2}\right)}^{2}}\\ t_2 := {\sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)}^{2}\\ \mathbf{if}\;\phi_1 \leq -6 \cdot 10^{-30} \lor \neg \left(\phi_1 \leq 5.2 \cdot 10^{+15}\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{{\cos \left(\phi_1 \cdot 0.5\right)}^{2} - \cos \phi_1 \cdot t_2}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_1}{\sqrt{{\cos \left(\phi_2 \cdot -0.5\right)}^{2} - \cos \phi_2 \cdot t_2}}\right)\\ \end{array} \]
Alternative 12
Error30.6
Cost92360
\[\begin{array}{l} t_0 := \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ t_1 := \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\\ t_2 := \cos \phi_1 \cdot \cos \phi_2\\ t_3 := \sqrt{\mathsf{fma}\left(\cos \phi_2, 0, {\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}^{2}\right)}\\ t_4 := \sin \left(\frac{\lambda_2 - \lambda_1}{2}\right)\\ \mathbf{if}\;\phi_1 \leq -14200000:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_3}{\sqrt{\mathsf{fma}\left(t_2, 0 \cdot t_4, 1\right) - {\sin \left(-0.5 \cdot \left(\phi_2 - \phi_1\right)\right)}^{2}}}\right)\\ \mathbf{elif}\;\phi_1 \leq 3.3 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{t_1 \cdot \left(t_2 \cdot t_1\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_0}^{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_3}{\sqrt{\mathsf{fma}\left(t_2, t_0 \cdot t_4, 1\right) - {\sin \left(\phi_1 \cdot 0.5\right)}^{2}}}\right)\\ \end{array} \]
Alternative 13
Error44.8
Cost72384
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\left|\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)\right|}{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right) \cdot \sin \left(\frac{\lambda_2 - \lambda_1}{2}\right), 1\right) - {\sin \left(-0.5 \cdot \left(\phi_2 - \phi_1\right)\right)}^{2}}}\right) \]
Alternative 14
Error53.5
Cost66121
\[\begin{array}{l} t_0 := \sin \left(\phi_2 \cdot -0.5\right)\\ t_1 := \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{if}\;\phi_2 \leq -4.2 \cdot 10^{-45} \lor \neg \left(\phi_2 \leq 240\right):\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_0}{\sqrt{\left(1 + \sin \left(0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right) \cdot \left(\cos \phi_2 \cdot t_1\right)\right) - {t_0}^{2}}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sin \left(\phi_1 \cdot 0.5\right)}{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, t_1 \cdot \sin \left(\frac{\lambda_2 - \lambda_1}{2}\right), 1\right) - {\sin \left(-0.5 \cdot \left(\phi_2 - \phi_1\right)\right)}^{2}}}\right)\\ \end{array} \]
Alternative 15
Error53.4
Cost65984
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sin \left(0.5 \cdot \left(\phi_1 - \phi_2\right)\right)}{\sqrt{\mathsf{fma}\left(\cos \phi_1 \cdot \cos \phi_2, \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right) \cdot \sin \left(\frac{\lambda_2 - \lambda_1}{2}\right), 1\right) - {\sin \left(-0.5 \cdot \left(\phi_2 - \phi_1\right)\right)}^{2}}}\right) \]
Alternative 16
Error56.6
Cost52928
\[\begin{array}{l} t_0 := \sin \left(\phi_2 \cdot -0.5\right)\\ R \cdot \left(2 \cdot \tan^{-1}_* \frac{t_0}{\sqrt{\left(1 + \sin \left(0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right) \cdot \left(\cos \phi_2 \cdot \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)\right)\right) - {t_0}^{2}}}\right) \end{array} \]
Alternative 17
Error58.3
Cost52672
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sin \left(\phi_2 \cdot -0.5\right)}{\sqrt{1 + \left(\sin \left(0.5 \cdot \lambda_2\right) \cdot \left(\cos \phi_1 \cdot \sin \left(\lambda_2 \cdot -0.5\right)\right) - {\sin \left(\phi_1 \cdot 0.5\right)}^{2}\right)}}\right) \]
Alternative 18
Error58.2
Cost33280
\[R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sin \left(\phi_2 \cdot -0.5\right)}{\sqrt{1 + \sin \left(-0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right) \cdot \sin \left(0.5 \cdot \left(\lambda_2 - \lambda_1\right)\right)}}\right) \]

Error

Reproduce?

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