Average Error: 39.4 → 31.6
Time: 1.9min
Precision: binary64
Cost: 57864
\[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.284058056362842 \cdot 10^{+64}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)}\\ \mathbf{elif}\;\phi_2 \leq -7.853982437309125 \cdot 10^{-69}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -9.961113512912832 \cdot 10^{-231}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{elif}\;\phi_2 \leq -1.3082263471954195 \cdot 10^{-242}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.4160468082729796 \cdot 10^{-276}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 2.0516300537315722 \cdot 10^{-172}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 2.8337288879326363 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \left(\sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)} - \left({\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} \cdot \left(\lambda_1 \cdot \lambda_2\right)\right) \cdot \sqrt{\frac{1}{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}
\begin{array}{l}
\mathbf{if}\;\phi_2 \leq -7.284058056362842 \cdot 10^{+64}:\\
\;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\

\mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\
\;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)}\\

\mathbf{elif}\;\phi_2 \leq -7.853982437309125 \cdot 10^{-69}:\\
\;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\

\mathbf{elif}\;\phi_2 \leq -9.961113512912832 \cdot 10^{-231}:\\
\;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}\\

\mathbf{elif}\;\phi_2 \leq -1.3082263471954195 \cdot 10^{-242}:\\
\;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\

\mathbf{elif}\;\phi_2 \leq 1.4160468082729796 \cdot 10^{-276}:\\
\;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\

\mathbf{elif}\;\phi_2 \leq 2.0516300537315722 \cdot 10^{-172}:\\
\;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\

\mathbf{elif}\;\phi_2 \leq 2.8337288879326363 \cdot 10^{-25}:\\
\;\;\;\;R \cdot \left(\sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)} - \left({\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} \cdot \left(\lambda_1 \cdot \lambda_2\right)\right) \cdot \sqrt{\frac{1}{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}}\right)\\

\mathbf{else}:\\
\;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\

\end{array}
(FPCore (R lambda1 lambda2 phi1 phi2)
 :precision binary64
 (*
  R
  (sqrt
   (+
    (*
     (* (- lambda1 lambda2) (cos (/ (+ phi1 phi2) 2.0)))
     (* (- lambda1 lambda2) (cos (/ (+ phi1 phi2) 2.0))))
    (* (- phi1 phi2) (- phi1 phi2))))))
(FPCore (R lambda1 lambda2 phi1 phi2)
 :precision binary64
 (if (<= phi2 -7.284058056362842e+64)
   (* R (- phi1 phi2))
   (if (<= phi2 -6.906144366019333e-26)
     (*
      R
      (sqrt
       (+
        (* (- phi1 phi2) (- phi1 phi2))
        (*
         (* (- lambda1 lambda2) (cos (/ (+ phi2 phi1) 2.0)))
         (*
          (/
           (cos (/ (+ phi2 phi1) 2.0))
           (* (cbrt (+ lambda1 lambda2)) (cbrt (+ lambda1 lambda2))))
          (/
           (- (* lambda1 lambda1) (* lambda2 lambda2))
           (cbrt (+ lambda1 lambda2))))))))
     (if (<= phi2 -7.853982437309125e-69)
       (* R (* (cos (* (+ phi2 phi1) 0.5)) (- lambda2 lambda1)))
       (if (<= phi2 -9.961113512912832e-231)
         (*
          R
          (sqrt
           (+
            (* (- phi1 phi2) (- phi1 phi2))
            (*
             (* (- lambda1 lambda2) (cos (/ (+ phi2 phi1) 2.0)))
             (/
              (*
               (cos (/ (+ phi2 phi1) 2.0))
               (- (* lambda1 lambda1) (* lambda2 lambda2)))
              (+ lambda1 lambda2))))))
         (if (<= phi2 -1.3082263471954195e-242)
           (* R (* (- lambda1 lambda2) (cos (* (+ phi2 phi1) 0.5))))
           (if (<= phi2 1.4160468082729796e-276)
             (*
              R
              (sqrt
               (+
                (* (- phi1 phi2) (- phi1 phi2))
                (*
                 (* (- lambda1 lambda2) (cos (/ (+ phi2 phi1) 2.0)))
                 (* (- lambda1 lambda2) (cos (* phi1 0.5)))))))
             (if (<= phi2 2.0516300537315722e-172)
               (* R (* (cos (* (+ phi2 phi1) 0.5)) (- lambda2 lambda1)))
               (if (<= phi2 2.8337288879326363e-25)
                 (*
                  R
                  (-
                   (sqrt
                    (-
                     (+
                      (*
                       (* lambda2 lambda2)
                       (pow (cos (* (+ phi2 phi1) 0.5)) 2.0))
                      (+ (* phi1 phi1) (* phi2 phi2)))
                     (* 2.0 (* phi2 phi1))))
                   (*
                    (*
                     (pow (cos (* (+ phi2 phi1) 0.5)) 2.0)
                     (* lambda1 lambda2))
                    (sqrt
                     (/
                      1.0
                      (-
                       (+
                        (*
                         (* lambda2 lambda2)
                         (pow (cos (* (+ phi2 phi1) 0.5)) 2.0))
                        (+ (* phi1 phi1) (* phi2 phi2)))
                       (* 2.0 (* phi2 phi1))))))))
                 (* R (- phi2 phi1)))))))))))
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	return R * sqrt((((lambda1 - lambda2) * cos((phi1 + phi2) / 2.0)) * ((lambda1 - lambda2) * cos((phi1 + phi2) / 2.0))) + ((phi1 - phi2) * (phi1 - phi2)));
}
double code(double R, double lambda1, double lambda2, double phi1, double phi2) {
	double tmp;
	if (phi2 <= -7.284058056362842e+64) {
		tmp = R * (phi1 - phi2);
	} else if (phi2 <= -6.906144366019333e-26) {
		tmp = R * sqrt(((phi1 - phi2) * (phi1 - phi2)) + (((lambda1 - lambda2) * cos((phi2 + phi1) / 2.0)) * ((cos((phi2 + phi1) / 2.0) / (cbrt(lambda1 + lambda2) * cbrt(lambda1 + lambda2))) * (((lambda1 * lambda1) - (lambda2 * lambda2)) / cbrt(lambda1 + lambda2)))));
	} else if (phi2 <= -7.853982437309125e-69) {
		tmp = R * (cos((phi2 + phi1) * 0.5) * (lambda2 - lambda1));
	} else if (phi2 <= -9.961113512912832e-231) {
		tmp = R * sqrt(((phi1 - phi2) * (phi1 - phi2)) + (((lambda1 - lambda2) * cos((phi2 + phi1) / 2.0)) * ((cos((phi2 + phi1) / 2.0) * ((lambda1 * lambda1) - (lambda2 * lambda2))) / (lambda1 + lambda2))));
	} else if (phi2 <= -1.3082263471954195e-242) {
		tmp = R * ((lambda1 - lambda2) * cos((phi2 + phi1) * 0.5));
	} else if (phi2 <= 1.4160468082729796e-276) {
		tmp = R * sqrt(((phi1 - phi2) * (phi1 - phi2)) + (((lambda1 - lambda2) * cos((phi2 + phi1) / 2.0)) * ((lambda1 - lambda2) * cos(phi1 * 0.5))));
	} else if (phi2 <= 2.0516300537315722e-172) {
		tmp = R * (cos((phi2 + phi1) * 0.5) * (lambda2 - lambda1));
	} else if (phi2 <= 2.8337288879326363e-25) {
		tmp = R * (sqrt((((lambda2 * lambda2) * pow(cos((phi2 + phi1) * 0.5), 2.0)) + ((phi1 * phi1) + (phi2 * phi2))) - (2.0 * (phi2 * phi1))) - ((pow(cos((phi2 + phi1) * 0.5), 2.0) * (lambda1 * lambda2)) * sqrt(1.0 / ((((lambda2 * lambda2) * pow(cos((phi2 + phi1) * 0.5), 2.0)) + ((phi1 * phi1) + (phi2 * phi2))) - (2.0 * (phi2 * phi1))))));
	} else {
		tmp = R * (phi2 - phi1);
	}
	return tmp;
}

Error

Bits error versus R

Bits error versus lambda1

Bits error versus lambda2

Bits error versus phi1

Bits error versus phi2

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error30.9
Cost41922
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -1.2233762362499954 \cdot 10^{+64}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -1.086394353227334 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)}\\ \mathbf{elif}\;\phi_2 \leq -8.800296941622612 \cdot 10^{-68}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -8.814207596554429 \cdot 10^{-231}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{elif}\;\phi_2 \leq -1.1792518427220885 \cdot 10^{-242}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.0745057675627444 \cdot 10^{-275}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 1.298883237366615 \cdot 10^{-175}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 2.9859377646597503 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 2
Error31.0
Cost24008
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -3.721601161658729 \cdot 10^{+62}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -1.9179282546564299 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq -8.248914971568689 \cdot 10^{-69}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -1.4968616604142797 \cdot 10^{-230}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{elif}\;\phi_2 \leq -1.0502773382487573 \cdot 10^{-242}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 9.864473031135728 \cdot 10^{-277}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 5.4789102405569135 \cdot 10^{-173}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 3.0620422030233072 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 3
Error30.9
Cost24008
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -2.3247219285292313 \cdot 10^{+64}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq -7.853982437309125 \cdot 10^{-69}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -9.578811540793364 \cdot 10^{-231}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{elif}\;\phi_2 \leq -8.486976059342659 \cdot 10^{-243}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 9.370339259117342 \cdot 10^{-276}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 1.831253301488852 \cdot 10^{-174}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 3.138146641386864 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 4
Error30.9
Cost23496
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -9.648820451191038 \cdot 10^{+61}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq -7.459049903049562 \cdot 10^{-69}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -3.325513576723927 \cdot 10^{-224}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq -8.486976059342659 \cdot 10^{-243}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 5.546121548268126 \cdot 10^{-276}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 1.2040802390879408 \cdot 10^{-175}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 2.8337288879326363 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 5
Error33.1
Cost23496
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.13768520449598 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -7.387663477165776 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -1.0130349358140567 \cdot 10^{-16}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq -5.1630515959119446 \cdot 10^{-225}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -8.648194189934322 \cdot 10^{-243}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.4446867752836068 \cdot 10^{-276}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 1.6073128882182043 \cdot 10^{-175}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 3.138146641386864 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 6
Error35.1
Cost23111
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.7219238172468 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -5.810494179699979 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}\\ \mathbf{elif}\;\phi_2 \leq -1.5140409734094606 \cdot 10^{-293}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 9.864473031135728 \cdot 10^{-277}:\\ \;\;\;\;R \cdot \sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}\\ \mathbf{elif}\;\phi_2 \leq 7.42478245364954 \cdot 10^{-175}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.197287774664978 \cdot 10^{-81}:\\ \;\;\;\;R \cdot \sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}\\ \mathbf{elif}\;\phi_2 \leq 7.501568469627453 \cdot 10^{-57}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 7
Error35.7
Cost9169
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.13768520449598 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -4.496186431811815 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -2.691831535073731 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -9.528481221261188 \cdot 10^{-230}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.9879265565097202 \cdot 10^{-275}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 5.8763855937272295 \cdot 10^{-213} \lor \neg \left(\phi_2 \leq 3.5491041256540918 \cdot 10^{-118}\right) \land \phi_2 \leq 4.644283405057842 \cdot 10^{-47}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 8
Error36.4
Cost8527
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.13768520449598 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -9.422606376239686 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(-\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -4.389110301670019 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq 2.4138996780898436 \cdot 10^{-213} \lor \neg \left(\phi_2 \leq 1.3978612308142944 \cdot 10^{-118}\right) \land \phi_2 \leq 4.06498893063265 \cdot 10^{-54}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 9
Error40.3
Cost9608
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -2.147660604744215 \cdot 10^{+76}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -9.422606376239686 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(-\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -1.1766081396542822 \cdot 10^{-93}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -5.007849870555741 \cdot 10^{-120}:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{elif}\;\phi_2 \leq -2.543731960630882 \cdot 10^{-145}:\\ \;\;\;\;R \cdot \left(\lambda_1 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -3.1280979436013324 \cdot 10^{-215}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 2.287936096973637 \cdot 10^{-265}:\\ \;\;\;\;R \cdot \left(-\lambda_1 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 7.560833137024459 \cdot 10^{-165} \lor \neg \left(\phi_2 \leq 7.7478928640559015 \cdot 10^{-62}\right):\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \phi_1\\ \end{array}\]
Alternative 10
Error39.8
Cost9223
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.13768520449598 \cdot 10^{+75}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -9.422606376239686 \cdot 10^{+37}:\\ \;\;\;\;R \cdot \left(-\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -1.086394353227334 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -7.223953085581869 \cdot 10^{-94}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -1.1373860876223252 \cdot 10^{-122}:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{elif}\;\phi_2 \leq -1.5439848291228564 \cdot 10^{-144}:\\ \;\;\;\;R \cdot \left(\lambda_1 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -4.298305599048588 \cdot 10^{-293}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 11
Error39.2
Cost8581
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -9.215960758877934 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -2.0473081405101843 \cdot 10^{-95}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -1.1218743081745805 \cdot 10^{-117}:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{elif}\;\phi_2 \leq -1.3843182194385847 \cdot 10^{-144}:\\ \;\;\;\;R \cdot \left(\lambda_1 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -7.757886856445111 \cdot 10^{-292}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 12
Error39.1
Cost8581
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -8.753997480306213 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -1.4277444451011442 \cdot 10^{-93}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -2.890905838855176 \cdot 10^{-117}:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{elif}\;\phi_2 \leq -8.139092187040019 \cdot 10^{-145}:\\ \;\;\;\;R \cdot \left(-\phi_1\right)\\ \mathbf{elif}\;\phi_2 \leq -1.1365144793548996 \cdot 10^{-291}:\\ \;\;\;\;R \cdot \left(\lambda_2 \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 13
Error39.5
Cost1283
\[\begin{array}{l} \mathbf{if}\;\phi_1 \leq -32748917230475.492:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \mathbf{elif}\;\phi_1 \leq -1.8600372103719128 \cdot 10^{-306}:\\ \;\;\;\;R \cdot \left(-\phi_2\right)\\ \mathbf{elif}\;\phi_1 \leq 4.850515191913181 \cdot 10^{-200}:\\ \;\;\;\;\phi_2 \cdot R\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \end{array}\]
Alternative 14
Error40.6
Cost641
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.013760509746709 \cdot 10^{-71}:\\ \;\;\;\;R \cdot \left(-\phi_2\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]
Alternative 15
Error42.3
Cost898
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -1.4899389842954865 \cdot 10^{-72}:\\ \;\;\;\;R \cdot \left(-\phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq 18.898774787229076:\\ \;\;\;\;R \cdot \left(-\phi_1\right)\\ \mathbf{else}:\\ \;\;\;\;\phi_2 \cdot R\\ \end{array}\]
Alternative 16
Error42.5
Cost834
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq -2.8994391576055218 \cdot 10^{-90}:\\ \;\;\;\;R \cdot \left(-\phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq 0.001303620098212329:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{else}:\\ \;\;\;\;\phi_2 \cdot R\\ \end{array}\]
Alternative 17
Error48.2
Cost513
\[\begin{array}{l} \mathbf{if}\;\phi_2 \leq 0.00014047862742698003:\\ \;\;\;\;R \cdot \phi_1\\ \mathbf{else}:\\ \;\;\;\;\phi_2 \cdot R\\ \end{array}\]
Alternative 18
Error54.1
Cost192
\[\phi_2 \cdot R\]
Alternative 19
Error60.3
Cost385
\[\begin{array}{l} \mathbf{if}\;R \leq 2.2492439462857 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 20
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Split input into 8 regimes
  2. if phi2 < -7.28405805636284186e64

    1. Initial program 51.1

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around inf 23.1

      \[\leadsto R \cdot \color{blue}{\left(\phi_1 - \phi_2\right)}\]
    3. Simplified23.1

      \[\leadsto \color{blue}{R \cdot \left(\phi_1 - \phi_2\right)}\]

    if -7.28405805636284186e64 < phi2 < -6.906144366019333e-26

    1. Initial program 33.3

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Using strategy rm
    3. Applied flip--_binary64_107633.4

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\color{blue}{\frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\lambda_1 + \lambda_2}} \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    4. Applied associate-*l/_binary64_104433.4

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \color{blue}{\frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)}{\lambda_1 + \lambda_2}} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    5. Simplified33.4

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \frac{\color{blue}{\cos \left(\frac{\phi_1 + \phi_2}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}}{\lambda_1 + \lambda_2} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt_binary64_113633.5

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_1 + \phi_2}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\color{blue}{\left(\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}\right) \cdot \sqrt[3]{\lambda_1 + \lambda_2}}} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    8. Applied times-frac_binary64_110733.5

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \color{blue}{\left(\frac{\cos \left(\frac{\phi_1 + \phi_2}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    9. Simplified33.5

      \[\leadsto \color{blue}{R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\frac{\cos \left(\frac{\phi_1 + \phi_2}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)}}\]

    if -6.906144366019333e-26 < phi2 < -7.85398243730912527e-69 or 1.41604680827297958e-276 < phi2 < 2.0516300537315722e-172

    1. Initial program 30.6

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around -inf 41.1

      \[\leadsto R \cdot \color{blue}{\left(\cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right) \cdot \lambda_2 - \cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right) \cdot \lambda_1\right)}\]
    3. Simplified41.1

      \[\leadsto R \cdot \color{blue}{\left(\cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)}\]
    4. Simplified41.1

      \[\leadsto \color{blue}{R \cdot \left(\cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)}\]

    if -7.85398243730912527e-69 < phi2 < -9.96111351291283201e-231

    1. Initial program 33.1

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Using strategy rm
    3. Applied flip--_binary64_107633.1

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\color{blue}{\frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\lambda_1 + \lambda_2}} \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    4. Applied associate-*l/_binary64_104433.1

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \color{blue}{\frac{\left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)}{\lambda_1 + \lambda_2}} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    5. Simplified33.1

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \frac{\color{blue}{\cos \left(\frac{\phi_1 + \phi_2}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}}{\lambda_1 + \lambda_2} + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    6. Simplified33.1

      \[\leadsto \color{blue}{R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_1 + \phi_2}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}}\]

    if -9.96111351291283201e-231 < phi2 < -1.3082263471954195e-242

    1. Initial program 38.1

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around inf 40.6

      \[\leadsto R \cdot \color{blue}{\left(\cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right) \cdot \lambda_1 - \cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right) \cdot \lambda_2\right)}\]
    3. Simplified40.6

      \[\leadsto R \cdot \color{blue}{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right)\right)}\]
    4. Simplified40.6

      \[\leadsto \color{blue}{R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right)\right)}\]

    if -1.3082263471954195e-242 < phi2 < 1.41604680827297958e-276

    1. Initial program 32.7

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around 0 32.7

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \color{blue}{\cos \left(0.5 \cdot \phi_1\right)}\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    3. Simplified32.7

      \[\leadsto R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \color{blue}{\cos \left(\phi_1 \cdot 0.5\right)}\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    4. Simplified32.7

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

    if 2.0516300537315722e-172 < phi2 < 2.8337288879326363e-25

    1. Initial program 31.9

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around 0 37.3

      \[\leadsto R \cdot \color{blue}{\left(\sqrt{\left({\cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right)}^{2} \cdot {\lambda_2}^{2} + \left({\phi_1}^{2} + {\phi_2}^{2}\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)} - \left({\cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right)}^{2} \cdot \left(\lambda_2 \cdot \lambda_1\right)\right) \cdot \sqrt{\frac{1}{\left({\cos \left(0.5 \cdot \left(\phi_2 + \phi_1\right)\right)}^{2} \cdot {\lambda_2}^{2} + \left({\phi_1}^{2} + {\phi_2}^{2}\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}}\right)}\]
    3. Simplified37.3

      \[\leadsto R \cdot \color{blue}{\left(\sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_1 \cdot \phi_2\right)} - \left(\left(\lambda_1 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right)}^{2}\right) \cdot \sqrt{\frac{1}{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_1 + \phi_2\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_1 \cdot \phi_2\right)}}\right)}\]
    4. Simplified37.3

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

    if 2.8337288879326363e-25 < phi2

    1. Initial program 46.6

      \[R \cdot \sqrt{\left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_1 + \phi_2}{2}\right)\right) + \left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right)}\]
    2. Taylor expanded around -inf 28.1

      \[\leadsto R \cdot \color{blue}{\left(\phi_2 - \phi_1\right)}\]
    3. Simplified28.1

      \[\leadsto \color{blue}{R \cdot \left(\phi_2 - \phi_1\right)}\]
  3. Recombined 8 regimes into one program.
  4. Final simplification31.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\phi_2 \leq -7.284058056362842 \cdot 10^{+64}:\\ \;\;\;\;R \cdot \left(\phi_1 - \phi_2\right)\\ \mathbf{elif}\;\phi_2 \leq -6.906144366019333 \cdot 10^{-26}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right)}{\sqrt[3]{\lambda_1 + \lambda_2} \cdot \sqrt[3]{\lambda_1 + \lambda_2}} \cdot \frac{\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2}{\sqrt[3]{\lambda_1 + \lambda_2}}\right)}\\ \mathbf{elif}\;\phi_2 \leq -7.853982437309125 \cdot 10^{-69}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq -9.961113512912832 \cdot 10^{-231}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \frac{\cos \left(\frac{\phi_2 + \phi_1}{2}\right) \cdot \left(\lambda_1 \cdot \lambda_1 - \lambda_2 \cdot \lambda_2\right)}{\lambda_1 + \lambda_2}}\\ \mathbf{elif}\;\phi_2 \leq -1.3082263471954195 \cdot 10^{-242}:\\ \;\;\;\;R \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 1.4160468082729796 \cdot 10^{-276}:\\ \;\;\;\;R \cdot \sqrt{\left(\phi_1 - \phi_2\right) \cdot \left(\phi_1 - \phi_2\right) + \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\frac{\phi_2 + \phi_1}{2}\right)\right) \cdot \left(\left(\lambda_1 - \lambda_2\right) \cdot \cos \left(\phi_1 \cdot 0.5\right)\right)}\\ \mathbf{elif}\;\phi_2 \leq 2.0516300537315722 \cdot 10^{-172}:\\ \;\;\;\;R \cdot \left(\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right) \cdot \left(\lambda_2 - \lambda_1\right)\right)\\ \mathbf{elif}\;\phi_2 \leq 2.8337288879326363 \cdot 10^{-25}:\\ \;\;\;\;R \cdot \left(\sqrt{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)} - \left({\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} \cdot \left(\lambda_1 \cdot \lambda_2\right)\right) \cdot \sqrt{\frac{1}{\left(\left(\lambda_2 \cdot \lambda_2\right) \cdot {\cos \left(\left(\phi_2 + \phi_1\right) \cdot 0.5\right)}^{2} + \left(\phi_1 \cdot \phi_1 + \phi_2 \cdot \phi_2\right)\right) - 2 \cdot \left(\phi_2 \cdot \phi_1\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;R \cdot \left(\phi_2 - \phi_1\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (R lambda1 lambda2 phi1 phi2)
  :name "Equirectangular approximation to distance on a great circle"
  :precision binary64
  (* R (sqrt (+ (* (* (- lambda1 lambda2) (cos (/ (+ phi1 phi2) 2.0))) (* (- lambda1 lambda2) (cos (/ (+ phi1 phi2) 2.0)))) (* (- phi1 phi2) (- phi1 phi2))))))