\tan^{-1} \left(N + 1\right) - \tan^{-1} N\tan^{-1}_* \frac{1}{\mathsf{fma}\left(N, N + 1, 1\right)}double f(double N) {
double r125170 = N;
double r125171 = 1.0;
double r125172 = r125170 + r125171;
double r125173 = atan(r125172);
double r125174 = atan(r125170);
double r125175 = r125173 - r125174;
return r125175;
}
double f(double N) {
double r125176 = 1.0;
double r125177 = N;
double r125178 = r125177 + r125176;
double r125179 = 1.0;
double r125180 = fma(r125177, r125178, r125179);
double r125181 = atan2(r125176, r125180);
return r125181;
}




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