\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 r131001 = N;
double r131002 = 1.0;
double r131003 = r131001 + r131002;
double r131004 = atan(r131003);
double r131005 = atan(r131001);
double r131006 = r131004 - r131005;
return r131006;
}
double f(double N) {
double r131007 = 1.0;
double r131008 = N;
double r131009 = r131008 + r131007;
double r131010 = 1.0;
double r131011 = fma(r131008, r131009, r131010);
double r131012 = atan2(r131007, r131011);
return r131012;
}




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