R \cdot \left(2 \cdot \tan^{-1}_* \frac{\sqrt{{\left(\sin \left(\frac{\phi_1 - \phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)}}{\sqrt{1 - \left({\left(\sin \left(\frac{\phi_1 - \phi_2}{2}\right)\right)}^{2} + \left(\left(\cos \phi_1 \cdot \cos \phi_2\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right) \cdot \sin \left(\frac{\lambda_1 - \lambda_2}{2}\right)\right)}}\right)double f(double R, double lambda1, double lambda2, double phi1, double phi2) {
double r8310 = R;
double r8311 = 2.0;
double r8312 = phi1;
double r8313 = phi2;
double r8314 = r8312 - r8313;
double r8315 = r8314 / r8311;
double r8316 = sin(r8315);
double r8317 = pow(r8316, r8311);
double r8318 = cos(r8312);
double r8319 = cos(r8313);
double r8320 = r8318 * r8319;
double r8321 = lambda1;
double r8322 = lambda2;
double r8323 = r8321 - r8322;
double r8324 = r8323 / r8311;
double r8325 = sin(r8324);
double r8326 = r8320 * r8325;
double r8327 = r8326 * r8325;
double r8328 = r8317 + r8327;
double r8329 = sqrt(r8328);
double r8330 = 1.0;
double r8331 = r8330 - r8328;
double r8332 = sqrt(r8331);
double r8333 = atan2(r8329, r8332);
double r8334 = r8311 * r8333;
double r8335 = r8310 * r8334;
return r8335;
}
Please include this information when filing a bug report:
herbie shell --seed 2019191
(FPCore (R lambda1 lambda2 phi1 phi2)
:name "Distance on a great circle"
(* 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))))))))))
| get-representation: Unknown representation #f | L | C | |
|---|---|---|---|
| loop | /data/pavpan/nightlies/herbie/interface2/src/points.rkt | 122 | 4 |
| prepare-points | /data/pavpan/nightlies/herbie/interface2/src/points.rkt | 146 | 0 |
| setup-prog!34 | /data/pavpan/nightlies/herbie/interface2/src/mainloop.rkt | 67 | 0 |
| run-improve43 | /data/pavpan/nightlies/herbie/interface2/src/mainloop.rkt | 339 | 0 |
| (unnamed) | /opt/racket-7.0/collects/racket/private/more-scheme.rkt | 261 | 28 |
| run | /opt/racket-7.0/share/pkgs/profile-lib/main.rkt | 39 | 2 |
| profile-thunk16 | /opt/racket-7.0/share/pkgs/profile-lib/main.rkt | 9 | 0 |
| (unnamed) | /opt/racket-7.0/collects/racket/private/more-scheme.rkt | 261 | 28 |