Average Error: 33.4 → 24.2
Time: 46.1s
Precision: 64
Internal Precision: 1408
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
\[\begin{array}{l} \mathbf{if}\;\frac{1}{n} \le -1.6830794872471447 \cdot 10^{-11}:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \le 6.451877786862745 \cdot 10^{-17}:\\ \;\;\;\;\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{x}}{x \cdot n}\right) - \frac{\frac{\log x}{n \cdot n}}{x}\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \end{array}\]

Error

Bits error versus x

Bits error versus n

Derivation

  1. Split input into 3 regimes
  2. if (/ 1 n) < -1.6830794872471447e-11

    1. Initial program 2.0

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Using strategy rm
    3. Applied add-exp-log2.0

      \[\leadsto {\color{blue}{\left(e^{\log \left(x + 1\right)}\right)}}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    4. Applied pow-exp2.0

      \[\leadsto \color{blue}{e^{\log \left(x + 1\right) \cdot \frac{1}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]
    5. Applied simplify2.0

      \[\leadsto e^{\color{blue}{\frac{\log_* (1 + x)}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]

    if -1.6830794872471447e-11 < (/ 1 n) < 6.451877786862745e-17

    1. Initial program 45.6

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Taylor expanded around inf 32.9

      \[\leadsto \color{blue}{\frac{1}{n \cdot x} - \left(\frac{1}{2} \cdot \frac{1}{n \cdot {x}^{2}} + \frac{\log x}{{n}^{2} \cdot x}\right)}\]
    3. Applied simplify32.9

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

    if 6.451877786862745e-17 < (/ 1 n)

    1. Initial program 9.1

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Using strategy rm
    3. Applied add-exp-log9.1

      \[\leadsto {\color{blue}{\left(e^{\log \left(x + 1\right)}\right)}}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    4. Applied pow-exp9.2

      \[\leadsto \color{blue}{e^{\log \left(x + 1\right) \cdot \frac{1}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]
    5. Applied simplify6.8

      \[\leadsto e^{\color{blue}{\frac{\log_* (1 + x)}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 46.1s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' +o rules:numerics
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))