\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{N + \left(1 + N \cdot N\right)}double f(double N) {
double r4789266 = N;
double r4789267 = 1.0;
double r4789268 = r4789266 + r4789267;
double r4789269 = atan(r4789268);
double r4789270 = atan(r4789266);
double r4789271 = r4789269 - r4789270;
return r4789271;
}
double f(double N) {
double r4789272 = 1.0;
double r4789273 = N;
double r4789274 = r4789273 * r4789273;
double r4789275 = r4789272 + r4789274;
double r4789276 = r4789273 + r4789275;
double r4789277 = atan2(r4789272, r4789276);
return r4789277;
}




Bits error versus N
Results
| Original | 14.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.9
rmApplied diff-atan13.7
Simplified0.4
rmApplied add-sqr-sqrt1.0
rmApplied add-sqr-sqrt1.0
Applied sqrt-prod0.6
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019163
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))