\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 r137264 = N;
double r137265 = 1.0;
double r137266 = r137264 + r137265;
double r137267 = atan(r137266);
double r137268 = atan(r137264);
double r137269 = r137267 - r137268;
return r137269;
}
double f(double N) {
double r137270 = 1.0;
double r137271 = N;
double r137272 = r137271 + r137270;
double r137273 = 1.0;
double r137274 = fma(r137271, r137272, r137273);
double r137275 = atan2(r137270, r137274);
return r137275;
}




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