\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, \left(N + 1\right), 1\right)}double f(double N) {
double r3855271 = N;
double r3855272 = 1.0;
double r3855273 = r3855271 + r3855272;
double r3855274 = atan(r3855273);
double r3855275 = atan(r3855271);
double r3855276 = r3855274 - r3855275;
return r3855276;
}
double f(double N) {
double r3855277 = 1.0;
double r3855278 = N;
double r3855279 = r3855278 + r3855277;
double r3855280 = fma(r3855278, r3855279, r3855277);
double r3855281 = atan2(r3855277, r3855280);
return r3855281;
}




Bits error versus N
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 15.3
rmApplied diff-atan14.1
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019129 +o rules:numerics
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))