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 r81179 = R;
double r81180 = 2.0;
double r81181 = phi1;
double r81182 = phi2;
double r81183 = r81181 - r81182;
double r81184 = r81183 / r81180;
double r81185 = sin(r81184);
double r81186 = pow(r81185, r81180);
double r81187 = cos(r81181);
double r81188 = cos(r81182);
double r81189 = r81187 * r81188;
double r81190 = lambda1;
double r81191 = lambda2;
double r81192 = r81190 - r81191;
double r81193 = r81192 / r81180;
double r81194 = sin(r81193);
double r81195 = r81189 * r81194;
double r81196 = r81195 * r81194;
double r81197 = r81186 + r81196;
double r81198 = sqrt(r81197);
double r81199 = 1.0;
double r81200 = r81199 - r81197;
double r81201 = sqrt(r81200);
double r81202 = atan2(r81198, r81201);
double r81203 = r81180 * r81202;
double r81204 = r81179 * r81203;
return r81204;
}
Please include this information when filing a bug report:
herbie shell --seed 2019323 +o rules:numerics
(FPCore (R lambda1 lambda2 phi1 phi2)
:name "Distance on a great circle"
:precision binary64
(* R (* 2 (atan2 (sqrt (+ (pow (sin (/ (- phi1 phi2) 2)) 2) (* (* (* (cos phi1) (cos phi2)) (sin (/ (- lambda1 lambda2) 2))) (sin (/ (- lambda1 lambda2) 2))))) (sqrt (- 1 (+ (pow (sin (/ (- phi1 phi2) 2)) 2) (* (* (* (cos phi1) (cos phi2)) (sin (/ (- lambda1 lambda2) 2))) (sin (/ (- lambda1 lambda2) 2))))))))))
| get-representation: Unknown representation real | L | C | |
|---|---|---|---|
| (unnamed) | /data/pavpan/nightlies/herbie/fix-interface-bugs/src/core/regimes.rkt | 65 | 3 |
| filter | /opt/racket-7.2/collects/racket/private/list.rkt | 256 | 2 |
| infer-splitpoints | /data/pavpan/nightlies/herbie/fix-interface-bugs/src/core/regimes.rkt | 34 | 0 |
| get-final-combination | /data/pavpan/nightlies/herbie/fix-interface-bugs/src/mainloop.rkt | 369 | 0 |
| (unnamed) | /opt/racket-7.2/collects/racket/private/more-scheme.rkt | 261 | 28 |
| run | /opt/racket-7.2/share/pkgs/profile-lib/main.rkt | 39 | 2 |
| profile-thunk16 | /opt/racket-7.2/share/pkgs/profile-lib/main.rkt | 9 | 0 |
| (unnamed) | /opt/racket-7.2/collects/racket/private/more-scheme.rkt | 261 | 28 |