Average Error: 29.4 → 0.1
Time: 21.4s
Precision: 64
Internal Precision: 1600
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;N \le 4319.261108921592:\\ \;\;\;\;\log \left(1 + N\right) + \log \left(\frac{1}{N}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{N} - \left(\frac{1}{2} - \frac{\frac{1}{3}}{N}\right) \cdot \frac{1}{N \cdot N}\\ \end{array}\]

Error

Bits error versus N

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if N < 4319.261108921592

    1. Initial program 0.1

      \[\log \left(N + 1\right) - \log N\]
    2. Using strategy rm
    3. Applied diff-log0.1

      \[\leadsto \color{blue}{\log \left(\frac{N + 1}{N}\right)}\]
    4. Using strategy rm
    5. Applied div-inv0.1

      \[\leadsto \log \color{blue}{\left(\left(N + 1\right) \cdot \frac{1}{N}\right)}\]
    6. Applied log-prod0.1

      \[\leadsto \color{blue}{\log \left(N + 1\right) + \log \left(\frac{1}{N}\right)}\]

    if 4319.261108921592 < N

    1. Initial program 59.4

      \[\log \left(N + 1\right) - \log N\]
    2. Using strategy rm
    3. Applied diff-log59.2

      \[\leadsto \color{blue}{\log \left(\frac{N + 1}{N}\right)}\]
    4. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{3} \cdot \frac{1}{{N}^{3}} + \frac{1}{N}\right) - \frac{1}{2} \cdot \frac{1}{{N}^{2}}}\]
    5. Simplified0.0

      \[\leadsto \color{blue}{\frac{1}{N} - \frac{1}{N \cdot N} \cdot \left(\frac{1}{2} - \frac{\frac{1}{3}}{N}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;N \le 4319.261108921592:\\ \;\;\;\;\log \left(1 + N\right) + \log \left(\frac{1}{N}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{N} - \left(\frac{1}{2} - \frac{\frac{1}{3}}{N}\right) \cdot \frac{1}{N \cdot N}\\ \end{array}\]

Runtime

Time bar (total: 21.4s)Debug logProfile

herbie shell --seed 2018255 
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))