Average Error: 0.2 → 0.2
Time: 44.8s
Precision: 64
\[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)}\]
\[\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \left(\cos \phi_1 \cdot \sin delta\right), \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}}\right)\right) \cdot \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}\right), \mathsf{fma}\left(\left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\sin \phi_1 \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right) \cdot \cos theta, 2, \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \cos theta\right), \cos delta\right)\right)}}\]
\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)}
\lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \left(\cos \phi_1 \cdot \sin delta\right), \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}}\right)\right) \cdot \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}\right), \mathsf{fma}\left(\left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\sin \phi_1 \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right) \cdot \cos theta, 2, \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \cos theta\right), \cos delta\right)\right)}}
double f(double lambda1, double phi1, double __attribute__((unused)) phi2, double delta, double theta) {
        double r3683605 = lambda1;
        double r3683606 = theta;
        double r3683607 = sin(r3683606);
        double r3683608 = delta;
        double r3683609 = sin(r3683608);
        double r3683610 = r3683607 * r3683609;
        double r3683611 = phi1;
        double r3683612 = cos(r3683611);
        double r3683613 = r3683610 * r3683612;
        double r3683614 = cos(r3683608);
        double r3683615 = sin(r3683611);
        double r3683616 = r3683615 * r3683614;
        double r3683617 = r3683612 * r3683609;
        double r3683618 = cos(r3683606);
        double r3683619 = r3683617 * r3683618;
        double r3683620 = r3683616 + r3683619;
        double r3683621 = asin(r3683620);
        double r3683622 = sin(r3683621);
        double r3683623 = r3683615 * r3683622;
        double r3683624 = r3683614 - r3683623;
        double r3683625 = atan2(r3683613, r3683624);
        double r3683626 = r3683605 + r3683625;
        return r3683626;
}

double f(double lambda1, double phi1, double __attribute__((unused)) phi2, double delta, double theta) {
        double r3683627 = lambda1;
        double r3683628 = phi1;
        double r3683629 = cos(r3683628);
        double r3683630 = delta;
        double r3683631 = sin(r3683630);
        double r3683632 = theta;
        double r3683633 = sin(r3683632);
        double r3683634 = r3683631 * r3683633;
        double r3683635 = r3683629 * r3683634;
        double r3683636 = cos(r3683630);
        double r3683637 = r3683636 * r3683636;
        double r3683638 = r3683629 * r3683631;
        double r3683639 = r3683638 * r3683638;
        double r3683640 = sin(r3683628);
        double r3683641 = cos(r3683632);
        double r3683642 = r3683640 * r3683641;
        double r3683643 = r3683642 * r3683642;
        double r3683644 = cbrt(r3683643);
        double r3683645 = cbrt(r3683644);
        double r3683646 = r3683645 * r3683645;
        double r3683647 = r3683645 * r3683646;
        double r3683648 = r3683647 * r3683644;
        double r3683649 = r3683644 * r3683648;
        double r3683650 = r3683636 * r3683629;
        double r3683651 = r3683650 * r3683631;
        double r3683652 = r3683640 * r3683640;
        double r3683653 = r3683640 * r3683652;
        double r3683654 = r3683651 * r3683653;
        double r3683655 = r3683654 * r3683641;
        double r3683656 = 2.0;
        double r3683657 = r3683652 * r3683636;
        double r3683658 = r3683657 * r3683657;
        double r3683659 = fma(r3683655, r3683656, r3683658);
        double r3683660 = fma(r3683639, r3683649, r3683659);
        double r3683661 = r3683637 - r3683660;
        double r3683662 = r3683629 * r3683641;
        double r3683663 = r3683640 * r3683662;
        double r3683664 = fma(r3683631, r3683663, r3683636);
        double r3683665 = fma(r3683636, r3683652, r3683664);
        double r3683666 = r3683661 / r3683665;
        double r3683667 = atan2(r3683635, r3683666);
        double r3683668 = r3683627 + r3683667;
        return r3683668;
}

Error

Bits error versus lambda1

Bits error versus phi1

Bits error versus phi2

Bits error versus delta

Bits error versus theta

Derivation

  1. Initial program 0.2

    \[\lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\cos delta - \sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)}\]
  2. Using strategy rm
  3. Applied flip--0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{\cos delta \cdot \cos delta - \left(\sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right) \cdot \left(\sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)\right)}{\cos delta + \sin \phi_1 \cdot \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right)}}}\]
  4. Taylor expanded around inf 0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{{\left(\cos delta\right)}^{2} - \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\cos \phi_1\right)}^{2}\right)\right) + \left(2 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \cos delta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)}{{\left(\sin \phi_1\right)}^{2} \cdot \cos delta + \left(\cos delta + \sin delta \cdot \left(\cos \phi_1 \cdot \left(\cos theta \cdot \sin \phi_1\right)\right)\right)}}}\]
  5. Simplified0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\color{blue}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\sin delta \cdot \cos \phi_1\right) \cdot \left(\sin delta \cdot \cos \phi_1\right), \left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right), \mathsf{fma}\left(\cos theta \cdot \left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \sin \phi_1\right)\right), 2, \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right) \cdot \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \left(\cos theta \cdot \cos \phi_1\right) \cdot \sin \phi_1, \cos delta\right)\right)}}}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\sin delta \cdot \cos \phi_1\right) \cdot \left(\sin delta \cdot \cos \phi_1\right), \color{blue}{\left(\sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)} \cdot \sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}\right) \cdot \sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}}, \mathsf{fma}\left(\cos theta \cdot \left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \sin \phi_1\right)\right), 2, \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right) \cdot \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \left(\cos theta \cdot \cos \phi_1\right) \cdot \sin \phi_1, \cos delta\right)\right)}}\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\sin delta \cdot \cos \phi_1\right) \cdot \left(\sin delta \cdot \cos \phi_1\right), \left(\color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}} \cdot \sqrt[3]{\sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}}\right) \cdot \sqrt[3]{\sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}}\right)} \cdot \sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}\right) \cdot \sqrt[3]{\left(\cos theta \cdot \sin \phi_1\right) \cdot \left(\cos theta \cdot \sin \phi_1\right)}, \mathsf{fma}\left(\cos theta \cdot \left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \sin \phi_1\right)\right), 2, \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right) \cdot \left(\cos delta \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \left(\cos theta \cdot \cos \phi_1\right) \cdot \sin \phi_1, \cos delta\right)\right)}}\]
  10. Final simplification0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\cos \phi_1 \cdot \left(\sin delta \cdot \sin theta\right)}{\frac{\cos delta \cdot \cos delta - \mathsf{fma}\left(\left(\cos \phi_1 \cdot \sin delta\right) \cdot \left(\cos \phi_1 \cdot \sin delta\right), \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}} \cdot \sqrt[3]{\sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}}\right)\right) \cdot \sqrt[3]{\left(\sin \phi_1 \cdot \cos theta\right) \cdot \left(\sin \phi_1 \cdot \cos theta\right)}\right), \mathsf{fma}\left(\left(\left(\left(\cos delta \cdot \cos \phi_1\right) \cdot \sin delta\right) \cdot \left(\sin \phi_1 \cdot \left(\sin \phi_1 \cdot \sin \phi_1\right)\right)\right) \cdot \cos theta, 2, \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right) \cdot \left(\left(\sin \phi_1 \cdot \sin \phi_1\right) \cdot \cos delta\right)\right)\right)}{\mathsf{fma}\left(\cos delta, \sin \phi_1 \cdot \sin \phi_1, \mathsf{fma}\left(\sin delta, \sin \phi_1 \cdot \left(\cos \phi_1 \cdot \cos theta\right), \cos delta\right)\right)}}\]

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (lambda1 phi1 phi2 delta theta)
  :name "Destination given bearing on a great circle"
  (+ lambda1 (atan2 (* (* (sin theta) (sin delta)) (cos phi1)) (- (cos delta) (* (sin phi1) (sin (asin (+ (* (sin phi1) (cos delta)) (* (* (cos phi1) (sin delta)) (cos theta))))))))))