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

Error

Bits error versus N

Derivation

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

    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 add-sqr-sqrt0.1

      \[\leadsto \log \left(\frac{\color{blue}{\sqrt{N + 1} \cdot \sqrt{N + 1}}}{N}\right)\]
    6. Applied associate-/l*0.1

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

    if 7156.287747882789 < 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}{\left(\frac{1}{N} + \frac{\frac{-1}{2}}{N \cdot N}\right) + \frac{\frac{\frac{1}{3}}{N \cdot N}}{N}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

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

Reproduce

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