Average Error: 31.5 → 2.7
Time: 27.9s
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}\;n \le -0.7609104912617705:\\ \;\;\;\;\frac{1}{x \cdot n} - \left(\frac{\frac{\frac{1}{2}}{x}}{x \cdot n} + \frac{\frac{\log x}{x}}{{n}^2}\right)\\ \mathbf{if}\;n \le 2.0428300300480385 \cdot 10^{+26}:\\ \;\;\;\;e^{{\left(\sqrt[3]{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}\right)}^3}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot n} - \left(\frac{\frac{\frac{1}{2}}{x}}{x \cdot n} + \frac{\frac{\log x}{x}}{{n}^2}\right)\\ \end{array}\]

Error

Bits error versus x

Bits error versus n

Derivation

  1. Split input into 2 regimes.
  2. if n < -0.7609104912617705 or 2.0428300300480385e+26 < n

    1. Initial program 44.0

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Applied taylor 9.2

      \[\leadsto \frac{1}{n \cdot x} - \left(\frac{\log x}{{n}^2 \cdot x} + \frac{1}{2} \cdot \frac{1}{n \cdot {x}^2}\right)\]
    3. Taylor expanded around inf 9.2

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

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

    if -0.7609104912617705 < n < 2.0428300300480385e+26

    1. Initial program 6.3

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

      \[\leadsto \color{blue}{e^{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt 6.3

      \[\leadsto e^{\color{blue}{{\left(\sqrt[3]{\log \left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}\right)}^3}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 27.9s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1065033997 2389885643 4100569014 2620012693 26800780 3144211646)'
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))