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

Error

Bits error versus N

Target

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

Derivation

  1. Initial program 14.9

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

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

    \[\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. Final simplification0.4

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

Runtime

Time bar (total: 8.1s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.40.40.40.00%
herbie shell --seed 2018286 +o rules:numerics
(FPCore (N)
  :name "2atan (example 3.5)"

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

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