Average Error: 29.0 → 0.3
Time: 40.9s
Precision: 64
Internal Precision: 1408
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;\log \left(N + 1\right) - \log N \le 5.402043257163314 \cdot 10^{-10}:\\ \;\;\;\;\left(\frac{1}{N} - \log 1\right) - \frac{\frac{\frac{1}{2}}{N}}{N}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(\log \left(1 + N\right)\right)}^{3}} - \log N\\ \end{array}\]

Error

Bits error versus N

Derivation

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

    1. Initial program 60.1

      \[\log \left(N + 1\right) - \log N\]
    2. Taylor expanded around inf 60.1

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

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

    if 5.402043257163314e-10 < (- (log (+ N 1)) (log N))

    1. Initial program 0.5

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

      \[\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.5

      \[\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: 40.9s)Debug logProfile

herbie shell --seed '#(1070227846 1561819246 480764335 4016816270 2602869839 2117310382)' 
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))