Average Error: 63.3 → 0.3
Time: 8.3s
Precision: 64
Internal precision: 1408
\[\left(\left(n + 1\right) \cdot \log \left(n + 1\right) - n \cdot \log n\right) - 1\]
\[\log \left(1 + n\right) \cdot \left(1 + n\right) - \left(\left(-n\right) \cdot \log n + 1\right)\]

Error

Bits error versus n

Target

Original63.3
Comparison60.8
Herbie0.3
\[ \log \left(n + 1\right) - \left(\frac{1}{2 \cdot n} - \left(\frac{1}{3 \cdot {n}^2} - \frac{4}{{n}^{3}}\right)\right) \]

Derivation

  1. Initial program 63.3

    \[\left(\left(n + 1\right) \cdot \log \left(n + 1\right) - n \cdot \log n\right) - 1\]
  2. Applied taylor 0.3

    \[\leadsto \left(\left(n + 1\right) \cdot \log \left(n + 1\right) - -1 \cdot \left(n \cdot \log n\right)\right) - 1\]
  3. Taylor expanded around inf 0.3

    \[\leadsto \left(\left(n + 1\right) \cdot \log \left(n + 1\right) - \color{blue}{-1 \cdot \left(n \cdot \log n\right)}\right) - 1\]
  4. Applied simplify 0.3

    \[\leadsto \color{blue}{\log \left(1 + n\right) \cdot \left(1 + n\right) - \left(\left(-n\right) \cdot \log n + 1\right)}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 8.3s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1065033997 2389885643 4100569014 2620012693 26800780 3144211646)'
(FPCore (n)
  :name "logs (example 3.8)"
  :pre (> n 6.8e+15)

  :target
  (- (log (+ n 1)) (- (/ 1 (* 2 n)) (- (/ 1 (* 3 (sqr n))) (/ 4 (pow n 3)))))

  (- (- (* (+ n 1) (log (+ n 1))) (* n (log n))) 1))