\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 r90082 = N;
double r90083 = 1.0;
double r90084 = r90082 + r90083;
double r90085 = atan(r90084);
double r90086 = atan(r90082);
double r90087 = r90085 - r90086;
return r90087;
}
double f(double N) {
double r90088 = 1.0;
double r90089 = N;
double r90090 = r90089 + r90088;
double r90091 = 1.0;
double r90092 = fma(r90089, r90090, r90091);
double r90093 = atan2(r90088, r90092);
return r90093;
}




Bits error versus N
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 15.1
rmApplied diff-atan14.1
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019323 +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)))