\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 r146056 = N;
double r146057 = 1.0;
double r146058 = r146056 + r146057;
double r146059 = atan(r146058);
double r146060 = atan(r146056);
double r146061 = r146059 - r146060;
return r146061;
}
double f(double N) {
double r146062 = 1.0;
double r146063 = N;
double r146064 = r146063 + r146062;
double r146065 = 1.0;
double r146066 = fma(r146063, r146064, r146065);
double r146067 = atan2(r146062, r146066);
return r146067;
}




Bits error versus N
| Original | 15.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
Initial program 15.1
rmApplied diff-atan14.0
Simplified0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019351 +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)))