\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}double f(double N) {
double r114501 = N;
double r114502 = 1.0;
double r114503 = r114501 + r114502;
double r114504 = atan(r114503);
double r114505 = atan(r114501);
double r114506 = r114504 - r114505;
return r114506;
}
double f(double N) {
double r114507 = 1.0;
double r114508 = N;
double r114509 = r114508 + r114507;
double r114510 = 1.0;
double r114511 = fma(r114508, r114509, r114510);
double r114512 = atan2(r114507, r114511);
return r114512;
}




Bits error versus N
| Original | 15.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 15.5
rmApplied diff-atan14.3
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020060 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:precision binary64
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))