\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 r149147 = N;
double r149148 = 1.0;
double r149149 = r149147 + r149148;
double r149150 = atan(r149149);
double r149151 = atan(r149147);
double r149152 = r149150 - r149151;
return r149152;
}
double f(double N) {
double r149153 = 1.0;
double r149154 = N;
double r149155 = r149154 + r149153;
double r149156 = 1.0;
double r149157 = fma(r149154, r149155, r149156);
double r149158 = atan2(r149153, r149157);
return r149158;
}




Bits error versus N
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.8
rmApplied diff-atan13.7
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019303 +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)))