Average Error: 29.5 → 0.2
Time: 15.4s
Precision: 64
Internal precision: 1408
\[\log \left(N + 1\right) - \log N\]
\[\begin{array}{l} \mathbf{if}\;N \le 83873799.46063499:\\ \;\;\;\;\log \left({N}^{3} + {1}^{3}\right) - \left(\log N + \log \left(N \cdot N - \left(N - 1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{1}{3}}{N} - \frac{1}{2}}{{N}^2} + \frac{1}{N}\\ \end{array}\]

Error

Bits error versus N

Derivation

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

    1. Initial program 0.4

      \[\log \left(N + 1\right) - \log N\]
    2. Using strategy rm
    3. Applied flip3-+ 0.4

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

      \[\leadsto \color{blue}{\left(\log \left({N}^{3} + {1}^{3}\right) - \log \left({N}^2 + \left({1}^2 - N \cdot 1\right)\right)\right)} - \log N\]
    5. Applied associate--l- 0.5

      \[\leadsto \color{blue}{\log \left({N}^{3} + {1}^{3}\right) - \left(\log \left({N}^2 + \left({1}^2 - N \cdot 1\right)\right) + \log N\right)}\]
    6. Applied simplify 0.5

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

    if 83873799.46063499 < N

    1. Initial program 60.0

      \[\log \left(N + 1\right) - \log N\]
    2. Applied taylor 0.0

      \[\leadsto \left(\frac{1}{3} \cdot \frac{1}{{N}^{3}} + \frac{1}{N}\right) - \frac{1}{2} \cdot \frac{1}{{N}^2}\]
    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. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{1}{N \cdot N} \cdot \left(\frac{\frac{1}{3}}{N} - \frac{1}{2}\right) + \frac{1}{N}}\]
    5. Applied simplify 0.0

      \[\leadsto \color{blue}{\frac{\frac{\frac{1}{3}}{N} - \frac{1}{2}}{{N}^2}} + \frac{1}{N}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 15.4s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064651971 495577305 2200811460 13024471 864198081 231948279)'
(FPCore (N)
  :name "2log (problem 3.3.6)"
  (- (log (+ N 1)) (log N)))