Average Error: 15.6 → 1.1
Time: 8.3s
Precision: 64
Internal precision: 1408
\[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
\[{\left({\left(\sqrt{\sqrt{\tan^{-1}_* \frac{1 - 0}{\left(N + {N}^2\right) + 1}}}\right)}^2\right)}^2\]

Error

Bits error versus N

Target

Original15.6
Comparison0.4
Herbie1.1
\[ \tan^{-1} \left(\frac{1}{1 + N \cdot \left(N + 1\right)}\right) \]

Derivation

  1. Initial program 15.6

    \[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
  2. Using strategy rm
  3. Applied diff-atan 14.3

    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\left(N + 1\right) - N}{1 + \left(N + 1\right) \cdot N}}\]
  4. Applied simplify 0.4

    \[\leadsto \tan^{-1}_* \frac{\color{blue}{1 - 0}}{1 + \left(N + 1\right) \cdot N}\]
  5. Applied simplify 0.4

    \[\leadsto \tan^{-1}_* \frac{1 - 0}{\color{blue}{\left(N + {N}^2\right) + 1}}\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt 1.0

    \[\leadsto \color{blue}{{\left(\sqrt{\tan^{-1}_* \frac{1 - 0}{\left(N + {N}^2\right) + 1}}\right)}^2}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt 1.1

    \[\leadsto {\color{blue}{\left({\left(\sqrt{\sqrt{\tan^{-1}_* \frac{1 - 0}{\left(N + {N}^2\right) + 1}}}\right)}^2\right)}}^2\]
  10. Removed slow pow expressions

Runtime

Time bar (total: 8.3s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(644180380 3784176976 401987740 22459203 1940947670 3323606534)'
(FPCore (N)
  :name "2atan (example 3.5)"

  :target
  (atan (/ 1 (+ 1 (* N (+ N 1)))))

  (- (atan (+ N 1)) (atan N)))