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

Error

Bits error versus N

Derivation

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

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

    if 9929.16791267944 < N

    1. Initial program 59.4

      \[\log \left(N + 1\right) - \log N\]
    2. 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}}}\]
    3. Applied simplify0.0

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

Runtime

Time bar (total: 42.7s)Debug log

herbie shell --seed '#(1743936871 1855164119 3668777427 1254258049 132811564 1366975197)' 
(FPCore (N)
  :name "NMSE problem 3.3.6"
  :pre (> N 0)
  (- (log (+ N 1)) (log N)))