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 r8319 = R;
double r8320 = 2.0;
double r8321 = phi1;
double r8322 = phi2;
double r8323 = r8321 - r8322;
double r8324 = r8323 / r8320;
double r8325 = sin(r8324);
double r8326 = pow(r8325, r8320);
double r8327 = cos(r8321);
double r8328 = cos(r8322);
double r8329 = r8327 * r8328;
double r8330 = lambda1;
double r8331 = lambda2;
double r8332 = r8330 - r8331;
double r8333 = r8332 / r8320;
double r8334 = sin(r8333);
double r8335 = r8329 * r8334;
double r8336 = r8335 * r8334;
double r8337 = r8326 + r8336;
double r8338 = sqrt(r8337);
double r8339 = 1.0;
double r8340 = r8339 - r8337;
double r8341 = sqrt(r8340);
double r8342 = atan2(r8338, r8341);
double r8343 = r8320 * r8342;
double r8344 = r8319 * r8343;
return r8344;
}
Please include this information when filing a bug report:
herbie shell --seed 2019191 +o rules:numerics
(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 |