\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{N \cdot N + \left(N + 1\right)}double f(double N) {
double r4673065 = N;
double r4673066 = 1.0;
double r4673067 = r4673065 + r4673066;
double r4673068 = atan(r4673067);
double r4673069 = atan(r4673065);
double r4673070 = r4673068 - r4673069;
return r4673070;
}
double f(double N) {
double r4673071 = 1.0;
double r4673072 = N;
double r4673073 = r4673072 * r4673072;
double r4673074 = r4673072 + r4673071;
double r4673075 = r4673073 + r4673074;
double r4673076 = atan2(r4673071, r4673075);
return r4673076;
}




Bits error versus N
Results
| Original | 14.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
Initial program 14.8
rmApplied diff-atan13.8
Simplified0.4
rmApplied add-cube-cbrt0.7
Applied associate-*r*0.7
rmApplied cbrt-unprod0.5
Taylor expanded around 0 0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2019130
(FPCore (N)
:name "2atan (example 3.5)"
:herbie-target
(atan (/ 1 (+ 1 (* N (+ N 1)))))
(- (atan (+ N 1)) (atan N)))