Average Error: 29.3 → 0.1
Time: 52.4s
Precision: 64
Internal Precision: 1408
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;N \le 482513.44908131845:\\ \;\;\;\;\log \left(\frac{N + 1}{N}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{N} - \log 1\right) - \frac{\frac{\frac{1}{2}}{N}}{N}\\ \end{array}\]

Error

Bits error versus N

Derivation

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

    1. Initial program 0.2

      \[\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)}\]

    if 482513.44908131845 < N

    1. Initial program 59.9

      \[\log \left(N + 1\right) - \log N\]
    2. Taylor expanded around inf 59.9

      \[\leadsto \color{blue}{\left(\frac{1}{N} - \left(\log \left(\frac{1}{N}\right) + \frac{1}{2} \cdot \frac{1}{{N}^{2}}\right)\right)} - \log N\]
    3. Applied simplify0.1

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

Runtime

Time bar (total: 52.4s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))