Average Error: 29.2 → 0.0
Time: 12.4s
Precision: 64
Internal Precision: 1344
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;N \le 6215.347060402761:\\ \;\;\;\;\log \left(\sqrt{1 + \frac{1}{N}}\right) + \log \left(\sqrt{1 + \frac{1}{N}}\right)\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{1}{N \cdot N}\right) \cdot \left(\frac{\frac{1}{3}}{N} - \frac{1}{2}\right) + \left(\frac{1}{N}\right))_*\\ \end{array}\]

Error

Bits error versus N

Derivation

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

    1. Initial program 0.1

      \[\log \left(N + 1\right) - \log N\]
    2. Initial simplification0.1

      \[\leadsto \log_* (1 + N) - \log N\]
    3. Using strategy rm
    4. Applied log1p-udef0.1

      \[\leadsto \color{blue}{\log \left(1 + N\right)} - \log N\]
    5. Applied diff-log0.0

      \[\leadsto \color{blue}{\log \left(\frac{1 + N}{N}\right)}\]
    6. Taylor expanded around inf 0.0

      \[\leadsto \log \color{blue}{\left(\frac{1}{N} + 1\right)}\]
    7. Using strategy rm
    8. Applied add-sqr-sqrt0.1

      \[\leadsto \log \color{blue}{\left(\sqrt{\frac{1}{N} + 1} \cdot \sqrt{\frac{1}{N} + 1}\right)}\]
    9. Applied log-prod0.1

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

    if 6215.347060402761 < N

    1. Initial program 59.4

      \[\log \left(N + 1\right) - \log N\]
    2. Initial simplification59.4

      \[\leadsto \log_* (1 + N) - \log N\]
    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. Simplified0.0

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

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

Runtime

Time bar (total: 12.4s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes29.10.00.029.1100%
herbie shell --seed 2018295 +o rules:numerics
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))