Average Error: 28.8 → 0.2
Time: 41.1s
Precision: 64
Internal Precision: 1408
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;\log \left(N + 1\right) - \log N \le 1.5458009983149168 \cdot 10^{-08}:\\ \;\;\;\;\frac{1}{N} - (\left(\frac{1}{N}\right) \cdot \left(\frac{\frac{1}{2}}{N}\right) + \left(\log 1\right))_*\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\log_* (1 + N)\right)} - \log N\\ \end{array}\]

Error

Bits error versus N

Derivation

  1. Split input into 2 regimes
  2. if (- (log (+ N 1)) (log N)) < 1.5458009983149168e-08

    1. Initial program 60.1

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

      \[\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.0

      \[\leadsto \color{blue}{\frac{1}{N} - (\left(\frac{1}{N}\right) \cdot \left(\frac{\frac{1}{2}}{N}\right) + \left(\log 1\right))_*}\]

    if 1.5458009983149168e-08 < (- (log (+ N 1)) (log N))

    1. Initial program 0.3

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

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

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

Runtime

Time bar (total: 41.1s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +o rules:numerics
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))