Average Error: 0.1 → 0.2
Time: 19.2s
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{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{{\left(\cos delta\right)}^{3} - \left({\left(\sin delta\right)}^{3} \cdot \left({\left(\cos \phi_1\right)}^{3} \cdot \left({\left(\cos theta\right)}^{3} \cdot {\left(\sin \phi_1\right)}^{3}\right)\right) + \left(\log \left(e^{{\left(\sin \phi_1\right)}^{6}}\right) \cdot {\left(\cos delta\right)}^{3} + \left(3 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sqrt[3]{{\left({\left(\sin \phi_1\right)}^{5}\right)}^{3}} \cdot \left({\left(\cos delta\right)}^{2} \cdot \cos theta\right)\right)\right)\right) + 3 \cdot \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{4} \cdot \left(\cos delta \cdot {\left(\cos theta\right)}^{2}\right)\right)\right)\right)\right)\right)\right)}{{\left(\cos delta\right)}^{2} + \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sin \phi_1 \cdot \left(\cos delta \cdot \cos theta\right)\right)\right) + \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\sin \phi_1\right)}^{2}\right)\right) + \left({\left(\sin \phi_1\right)}^{2} \cdot {\left(\cos delta\right)}^{2} + \left(2 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\cos delta \cdot \cos theta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)\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{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{{\left(\cos delta\right)}^{3} - \left({\left(\sin delta\right)}^{3} \cdot \left({\left(\cos \phi_1\right)}^{3} \cdot \left({\left(\cos theta\right)}^{3} \cdot {\left(\sin \phi_1\right)}^{3}\right)\right) + \left(\log \left(e^{{\left(\sin \phi_1\right)}^{6}}\right) \cdot {\left(\cos delta\right)}^{3} + \left(3 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sqrt[3]{{\left({\left(\sin \phi_1\right)}^{5}\right)}^{3}} \cdot \left({\left(\cos delta\right)}^{2} \cdot \cos theta\right)\right)\right)\right) + 3 \cdot \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{4} \cdot \left(\cos delta \cdot {\left(\cos theta\right)}^{2}\right)\right)\right)\right)\right)\right)\right)}{{\left(\cos delta\right)}^{2} + \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sin \phi_1 \cdot \left(\cos delta \cdot \cos theta\right)\right)\right) + \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\sin \phi_1\right)}^{2}\right)\right) + \left({\left(\sin \phi_1\right)}^{2} \cdot {\left(\cos delta\right)}^{2} + \left(2 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\cos delta \cdot \cos theta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)\right)\right)}}
double f(double lambda1, double phi1, double __attribute__((unused)) phi2, double delta, double theta) {
        double r123886 = lambda1;
        double r123887 = theta;
        double r123888 = sin(r123887);
        double r123889 = delta;
        double r123890 = sin(r123889);
        double r123891 = r123888 * r123890;
        double r123892 = phi1;
        double r123893 = cos(r123892);
        double r123894 = r123891 * r123893;
        double r123895 = cos(r123889);
        double r123896 = sin(r123892);
        double r123897 = r123896 * r123895;
        double r123898 = r123893 * r123890;
        double r123899 = cos(r123887);
        double r123900 = r123898 * r123899;
        double r123901 = r123897 + r123900;
        double r123902 = asin(r123901);
        double r123903 = sin(r123902);
        double r123904 = r123896 * r123903;
        double r123905 = r123895 - r123904;
        double r123906 = atan2(r123894, r123905);
        double r123907 = r123886 + r123906;
        return r123907;
}

double f(double lambda1, double phi1, double __attribute__((unused)) phi2, double delta, double theta) {
        double r123908 = lambda1;
        double r123909 = theta;
        double r123910 = sin(r123909);
        double r123911 = delta;
        double r123912 = sin(r123911);
        double r123913 = r123910 * r123912;
        double r123914 = phi1;
        double r123915 = cos(r123914);
        double r123916 = r123913 * r123915;
        double r123917 = cos(r123911);
        double r123918 = 3.0;
        double r123919 = pow(r123917, r123918);
        double r123920 = pow(r123912, r123918);
        double r123921 = pow(r123915, r123918);
        double r123922 = cos(r123909);
        double r123923 = pow(r123922, r123918);
        double r123924 = sin(r123914);
        double r123925 = pow(r123924, r123918);
        double r123926 = r123923 * r123925;
        double r123927 = r123921 * r123926;
        double r123928 = r123920 * r123927;
        double r123929 = 6.0;
        double r123930 = pow(r123924, r123929);
        double r123931 = exp(r123930);
        double r123932 = log(r123931);
        double r123933 = r123932 * r123919;
        double r123934 = 5.0;
        double r123935 = pow(r123924, r123934);
        double r123936 = pow(r123935, r123918);
        double r123937 = cbrt(r123936);
        double r123938 = 2.0;
        double r123939 = pow(r123917, r123938);
        double r123940 = r123939 * r123922;
        double r123941 = r123937 * r123940;
        double r123942 = r123915 * r123941;
        double r123943 = r123912 * r123942;
        double r123944 = r123918 * r123943;
        double r123945 = pow(r123912, r123938);
        double r123946 = pow(r123915, r123938);
        double r123947 = 4.0;
        double r123948 = pow(r123924, r123947);
        double r123949 = pow(r123922, r123938);
        double r123950 = r123917 * r123949;
        double r123951 = r123948 * r123950;
        double r123952 = r123946 * r123951;
        double r123953 = r123945 * r123952;
        double r123954 = r123918 * r123953;
        double r123955 = r123944 + r123954;
        double r123956 = r123933 + r123955;
        double r123957 = r123928 + r123956;
        double r123958 = r123919 - r123957;
        double r123959 = r123917 * r123922;
        double r123960 = r123924 * r123959;
        double r123961 = r123915 * r123960;
        double r123962 = r123912 * r123961;
        double r123963 = pow(r123924, r123938);
        double r123964 = r123949 * r123963;
        double r123965 = r123946 * r123964;
        double r123966 = r123945 * r123965;
        double r123967 = r123963 * r123939;
        double r123968 = r123925 * r123959;
        double r123969 = r123915 * r123968;
        double r123970 = r123912 * r123969;
        double r123971 = r123938 * r123970;
        double r123972 = r123948 * r123939;
        double r123973 = r123971 + r123972;
        double r123974 = r123967 + r123973;
        double r123975 = r123966 + r123974;
        double r123976 = r123962 + r123975;
        double r123977 = r123939 + r123976;
        double r123978 = r123958 / r123977;
        double r123979 = atan2(r123916, r123978);
        double r123980 = r123908 + r123979;
        return r123980;
}

Error

Bits error versus lambda1

Bits error versus phi1

Bits error versus phi2

Bits error versus delta

Bits error versus theta

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\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 flip3--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)}^{3} - {\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)}^{3}}{\cos delta \cdot \cos delta + \left(\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 \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)\right)}}}\]
  4. Simplified0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{{\left(\cos delta\right)}^{3} - {\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)}^{3}}{\color{blue}{\mathsf{fma}\left(\cos delta, \cos delta, \sin \phi_1 \cdot \left(\sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right) \cdot \mathsf{fma}\left(\sin \phi_1, \sin \left(\sin^{-1} \left(\sin \phi_1 \cdot \cos delta + \left(\cos \phi_1 \cdot \sin delta\right) \cdot \cos theta\right)\right), \cos delta\right)\right)\right)}}}\]
  5. 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)}^{3} - \left({\left(\sin delta\right)}^{3} \cdot \left({\left(\cos \phi_1\right)}^{3} \cdot \left({\left(\cos theta\right)}^{3} \cdot {\left(\sin \phi_1\right)}^{3}\right)\right) + \left({\left(\sin \phi_1\right)}^{6} \cdot {\left(\cos delta\right)}^{3} + \left(3 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{5} \cdot \left({\left(\cos delta\right)}^{2} \cdot \cos theta\right)\right)\right)\right) + 3 \cdot \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{4} \cdot \left(\cos delta \cdot {\left(\cos theta\right)}^{2}\right)\right)\right)\right)\right)\right)\right)}{{\left(\cos delta\right)}^{2} + \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sin \phi_1 \cdot \left(\cos delta \cdot \cos theta\right)\right)\right) + \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\sin \phi_1\right)}^{2}\right)\right) + \left({\left(\sin \phi_1\right)}^{2} \cdot {\left(\cos delta\right)}^{2} + \left(2 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\cos delta \cdot \cos theta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)\right)\right)}}}\]
  6. Using strategy rm
  7. Applied add-log-exp0.2

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{{\left(\cos delta\right)}^{3} - \left({\left(\sin delta\right)}^{3} \cdot \left({\left(\cos \phi_1\right)}^{3} \cdot \left({\left(\cos theta\right)}^{3} \cdot {\left(\sin \phi_1\right)}^{3}\right)\right) + \left(\color{blue}{\log \left(e^{{\left(\sin \phi_1\right)}^{6}}\right)} \cdot {\left(\cos delta\right)}^{3} + \left(3 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{5} \cdot \left({\left(\cos delta\right)}^{2} \cdot \cos theta\right)\right)\right)\right) + 3 \cdot \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{4} \cdot \left(\cos delta \cdot {\left(\cos theta\right)}^{2}\right)\right)\right)\right)\right)\right)\right)}{{\left(\cos delta\right)}^{2} + \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sin \phi_1 \cdot \left(\cos delta \cdot \cos theta\right)\right)\right) + \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\sin \phi_1\right)}^{2}\right)\right) + \left({\left(\sin \phi_1\right)}^{2} \cdot {\left(\cos delta\right)}^{2} + \left(2 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\cos delta \cdot \cos theta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)\right)\right)}}\]
  8. Using strategy rm
  9. Applied add-cbrt-cube0.2

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

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

    \[\leadsto \lambda_1 + \tan^{-1}_* \frac{\left(\sin theta \cdot \sin delta\right) \cdot \cos \phi_1}{\frac{{\left(\cos delta\right)}^{3} - \left({\left(\sin delta\right)}^{3} \cdot \left({\left(\cos \phi_1\right)}^{3} \cdot \left({\left(\cos theta\right)}^{3} \cdot {\left(\sin \phi_1\right)}^{3}\right)\right) + \left(\log \left(e^{{\left(\sin \phi_1\right)}^{6}}\right) \cdot {\left(\cos delta\right)}^{3} + \left(3 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sqrt[3]{{\left({\left(\sin \phi_1\right)}^{5}\right)}^{3}} \cdot \left({\left(\cos delta\right)}^{2} \cdot \cos theta\right)\right)\right)\right) + 3 \cdot \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\sin \phi_1\right)}^{4} \cdot \left(\cos delta \cdot {\left(\cos theta\right)}^{2}\right)\right)\right)\right)\right)\right)\right)}{{\left(\cos delta\right)}^{2} + \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left(\sin \phi_1 \cdot \left(\cos delta \cdot \cos theta\right)\right)\right) + \left({\left(\sin delta\right)}^{2} \cdot \left({\left(\cos \phi_1\right)}^{2} \cdot \left({\left(\cos theta\right)}^{2} \cdot {\left(\sin \phi_1\right)}^{2}\right)\right) + \left({\left(\sin \phi_1\right)}^{2} \cdot {\left(\cos delta\right)}^{2} + \left(2 \cdot \left(\sin delta \cdot \left(\cos \phi_1 \cdot \left({\left(\sin \phi_1\right)}^{3} \cdot \left(\cos delta \cdot \cos theta\right)\right)\right)\right) + {\left(\sin \phi_1\right)}^{4} \cdot {\left(\cos delta\right)}^{2}\right)\right)\right)\right)}}\]

Reproduce

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