Average Error: 63.0 → 60.8
Time: 39.2s
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.0
Target0
Herbie60.8
\[\log \left(n + 1\right) - \left(\frac{1}{2 \cdot n} - \left(\frac{1}{3 \cdot \left(n \cdot n\right)} - \frac{4}{{n}^{3}}\right)\right)\]

Derivation

  1. Initial program 63.0

    \[\left(\left(n + 1\right) \cdot \log \left(n + 1\right) - n \cdot \log n\right) - 1\]
  2. Taylor expanded around inf 60.8

    \[\leadsto \left(\left(n + 1\right) \cdot \log \left(n + 1\right) - \color{blue}{-1 \cdot \left(n \cdot \log n\right)}\right) - 1\]
  3. Applied simplify60.8

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

Runtime

Time bar (total: 39.2s)Debug logProfile

herbie shell --seed '#(1063282112 2455465480 4141627379 3773598652 1647277307 776739644)' 
(FPCore (n)
  :name "logs (example 3.8)"
  :pre (> n 6.8e+15)
  :herbie-expected #f

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

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