\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 r6410082 = N;
double r6410083 = 1.0;
double r6410084 = r6410082 + r6410083;
double r6410085 = atan(r6410084);
double r6410086 = atan(r6410082);
double r6410087 = r6410085 - r6410086;
return r6410087;
}
double f(double N) {
double r6410088 = 1.0;
double r6410089 = N;
double r6410090 = r6410089 + r6410088;
double r6410091 = fma(r6410089, r6410090, r6410088);
double r6410092 = atan2(r6410088, r6410091);
return r6410092;
}




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