\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 r153248 = N;
double r153249 = 1.0;
double r153250 = r153248 + r153249;
double r153251 = atan(r153250);
double r153252 = atan(r153248);
double r153253 = r153251 - r153252;
return r153253;
}
double f(double N) {
double r153254 = 1.0;
double r153255 = N;
double r153256 = r153255 + r153254;
double r153257 = 1.0;
double r153258 = fma(r153255, r153256, r153257);
double r153259 = atan2(r153254, r153258);
return r153259;
}




Bits error versus N
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.7
rmApplied diff-atan13.6
Simplified0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020062 +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)))