\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 r130102 = N;
double r130103 = 1.0;
double r130104 = r130102 + r130103;
double r130105 = atan(r130104);
double r130106 = atan(r130102);
double r130107 = r130105 - r130106;
return r130107;
}
double f(double N) {
double r130108 = 1.0;
double r130109 = N;
double r130110 = r130109 + r130108;
double r130111 = 1.0;
double r130112 = fma(r130109, r130110, r130111);
double r130113 = atan2(r130108, r130112);
return r130113;
}




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