\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 r129372 = N;
double r129373 = 1.0;
double r129374 = r129372 + r129373;
double r129375 = atan(r129374);
double r129376 = atan(r129372);
double r129377 = r129375 - r129376;
return r129377;
}
double f(double N) {
double r129378 = 1.0;
double r129379 = N;
double r129380 = r129379 + r129378;
double r129381 = 1.0;
double r129382 = fma(r129379, r129380, r129381);
double r129383 = atan2(r129378, r129382);
return r129383;
}




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