Average Error: 29.7 → 0.1
Time: 34.2s
Precision: 64
Internal Precision: 1600
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;\log \left(N + 1\right) - \log N \le 8.011007441346735 \cdot 10^{-06}:\\ \;\;\;\;\frac{\log \left(e^{\frac{\frac{1}{3}}{N \cdot N}}\right) + \left(1 - \frac{\frac{1}{2}}{N}\right)}{N}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\log \left(1 + N\right)\right)}^{3}} - \log N\\ \end{array}\]

Error

Bits error versus N

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

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

    1. Initial program 59.6

      \[\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{\frac{\frac{1}{3}}{N \cdot N} + \left(1 - \frac{\frac{1}{2}}{N}\right)}{N}}\]
    4. Using strategy rm
    5. Applied add-log-exp0.0

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

    if 8.011007441346735e-06 < (- (log (+ N 1)) (log N))

    1. Initial program 0.1

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

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

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

Runtime

Time bar (total: 34.2s)Debug logProfile

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