\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 r171015 = N;
double r171016 = 1.0;
double r171017 = r171015 + r171016;
double r171018 = atan(r171017);
double r171019 = atan(r171015);
double r171020 = r171018 - r171019;
return r171020;
}
double f(double N) {
double r171021 = 1.0;
double r171022 = N;
double r171023 = r171022 + r171021;
double r171024 = 1.0;
double r171025 = fma(r171022, r171023, r171024);
double r171026 = atan2(r171021, r171025);
return r171026;
}




Bits error versus N
| Original | 14.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.9
rmApplied diff-atan13.7
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020056 +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)))