\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 r118833 = N;
double r118834 = 1.0;
double r118835 = r118833 + r118834;
double r118836 = atan(r118835);
double r118837 = atan(r118833);
double r118838 = r118836 - r118837;
return r118838;
}
double f(double N) {
double r118839 = 1.0;
double r118840 = N;
double r118841 = r118840 + r118839;
double r118842 = 1.0;
double r118843 = fma(r118840, r118841, r118842);
double r118844 = atan2(r118839, r118843);
return r118844;
}




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 2020033 +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)))