\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 r4818153 = N;
double r4818154 = 1.0;
double r4818155 = r4818153 + r4818154;
double r4818156 = atan(r4818155);
double r4818157 = atan(r4818153);
double r4818158 = r4818156 - r4818157;
return r4818158;
}
double f(double N) {
double r4818159 = 1.0;
double r4818160 = N;
double r4818161 = r4818160 + r4818159;
double r4818162 = fma(r4818160, r4818161, r4818159);
double r4818163 = atan2(r4818159, r4818162);
return r4818163;
}




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