Average Error: 31.5 → 1.7
Time: 27.0s
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 -16812845130.986868:\\ \;\;\;\;\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 1197227.277911289:\\ \;\;\;\;{\left(\sqrt[3]{{\left(1 + x\right)}^{\left(\frac{1}{n}\right)} - e^{\frac{\log x}{n}}}\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 < -16812845130.986868 or 1197227.277911289 < n

    1. Initial program 44.4

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

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

      \[\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 1.0

      \[\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 -16812845130.986868 < n < 1197227.277911289

    1. Initial program 3.3

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

      \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \color{blue}{\sqrt[3]{{\left({x}^{\left(\frac{1}{n}\right)}\right)}^3}}\]
    4. Using strategy rm
    5. Applied pow-to-exp 3.6

      \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \sqrt[3]{{\color{blue}{\left(e^{\log x \cdot \frac{1}{n}}\right)}}^3}\]
    6. Applied simplify 3.6

      \[\leadsto {\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \sqrt[3]{{\left(e^{\color{blue}{\frac{\log x}{n}}}\right)}^3}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt 3.6

      \[\leadsto \color{blue}{{\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - \sqrt[3]{{\left(e^{\frac{\log x}{n}}\right)}^3}}\right)}^3}\]
    9. Applied simplify 3.4

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

Runtime

Time bar (total: 27.0s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064651971 495577305 2200811460 13024471 864198081 231948279)'
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))