\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 r154214 = N;
double r154215 = 1.0;
double r154216 = r154214 + r154215;
double r154217 = atan(r154216);
double r154218 = atan(r154214);
double r154219 = r154217 - r154218;
return r154219;
}
double f(double N) {
double r154220 = 1.0;
double r154221 = N;
double r154222 = r154221 + r154220;
double r154223 = 1.0;
double r154224 = fma(r154221, r154222, r154223);
double r154225 = atan2(r154220, r154224);
return r154225;
}




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