\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 r182230 = N;
double r182231 = 1.0;
double r182232 = r182230 + r182231;
double r182233 = atan(r182232);
double r182234 = atan(r182230);
double r182235 = r182233 - r182234;
return r182235;
}
double f(double N) {
double r182236 = 1.0;
double r182237 = N;
double r182238 = r182237 + r182236;
double r182239 = 1.0;
double r182240 = fma(r182237, r182238, r182239);
double r182241 = atan2(r182236, r182240);
return r182241;
}




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