Average Error: 32.8 → 23.5
Time: 54.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 -3.6227047746916703 \cdot 10^{-09}:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\frac{1}{n} \le 2.6051594709856815 \cdot 10^{-19}:\\ \;\;\;\;\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{x}}{x \cdot n}\right) - \frac{\frac{\log x}{n}}{x \cdot n}\\ \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 2 regimes
  2. if (/ 1 n) < -3.6227047746916703e-09 or 2.6051594709856815e-19 < (/ 1 n)

    1. Initial program 5.1

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Using strategy rm
    3. Applied add-exp-log5.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-exp5.1

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

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

    if -3.6227047746916703e-09 < (/ 1 n) < 2.6051594709856815e-19

    1. Initial program 45.0

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{x}}{x \cdot n}\right) - \frac{\frac{\log x}{n}}{x \cdot n}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 54.1s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +o rules:numerics
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))