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

Error

Bits error versus N

Derivation

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

    1. Initial program 0.1

      \[\log \left(N + 1\right) - \log N\]

    if 52418.869833735334 < N

    1. Initial program 59.6

      \[\log \left(N + 1\right) - \log N\]
    2. Applied taylor 0.0

      \[\leadsto \left(\frac{1}{3} \cdot \frac{1}{{N}^{3}} + \frac{1}{N}\right) - \frac{1}{2} \cdot \frac{1}{{N}^2}\]
    3. 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}}\]
    4. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{1}{N \cdot N} \cdot \left(\frac{\frac{1}{3}}{N} - \frac{1}{2}\right) + \frac{1}{N}}\]
    5. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{3}}{N} - \frac{1}{2}}{{N}^2}} + \frac{1}{N}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 9.4s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1066372953 114334025 411438303 1288252006 2962405338 2829794477)'
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))