\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 r200187 = N;
double r200188 = 1.0;
double r200189 = r200187 + r200188;
double r200190 = atan(r200189);
double r200191 = atan(r200187);
double r200192 = r200190 - r200191;
return r200192;
}
double f(double N) {
double r200193 = 1.0;
double r200194 = N;
double r200195 = r200194 + r200193;
double r200196 = 1.0;
double r200197 = fma(r200194, r200195, r200196);
double r200198 = atan2(r200193, r200197);
return r200198;
}




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