\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{N + \mathsf{fma}\left(N, N, 1\right)}double f(double N) {
double r3792403 = N;
double r3792404 = 1.0;
double r3792405 = r3792403 + r3792404;
double r3792406 = atan(r3792405);
double r3792407 = atan(r3792403);
double r3792408 = r3792406 - r3792407;
return r3792408;
}
double f(double N) {
double r3792409 = 1.0;
double r3792410 = N;
double r3792411 = fma(r3792410, r3792410, r3792409);
double r3792412 = r3792410 + r3792411;
double r3792413 = atan2(r3792409, r3792412);
return r3792413;
}




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
rmApplied fma-udef0.4
Applied associate-+r+0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019141 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))