Average Error: 15.2 → 0.4
Time: 9.5s
Precision: 64
Internal Precision: 1344
\[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
\[\log_* (1 + (e^{\tan^{-1}_* \frac{1}{(N \cdot \left(N + 1\right) + 1)_*}} - 1)^*)\]

Error

Bits error versus N

Target

Original15.2
Target0.4
Herbie0.4
\[\tan^{-1} \left(\frac{1}{1 + N \cdot \left(N + 1\right)}\right)\]

Derivation

  1. Initial program 15.2

    \[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
  2. Initial simplification15.2

    \[\leadsto \tan^{-1} \left(1 + N\right) - \tan^{-1} N\]
  3. Using strategy rm
  4. Applied diff-atan14.0

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

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

    \[\leadsto \tan^{-1}_* \frac{1}{\color{blue}{(N \cdot \left(N + 1\right) + 1)_*}}\]
  7. Using strategy rm
  8. Applied log1p-expm1-u0.4

    \[\leadsto \color{blue}{\log_* (1 + (e^{\tan^{-1}_* \frac{1}{(N \cdot \left(N + 1\right) + 1)_*}} - 1)^*)}\]
  9. Final simplification0.4

    \[\leadsto \log_* (1 + (e^{\tan^{-1}_* \frac{1}{(N \cdot \left(N + 1\right) + 1)_*}} - 1)^*)\]

Runtime

Time bar (total: 9.5s)Debug logProfile

herbie shell --seed 2018234 +o rules:numerics
(FPCore (N)
  :name "2atan (example 3.5)"

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

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