Average Error: 32.8 → 23.5
Time: 44.1s
Precision: 64
Internal Precision: 1344
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
\[\begin{array}{l} \mathbf{if}\;n \le -168922.24220762347 \lor \neg \left(n \le 190641239.051845\right):\\ \;\;\;\;\frac{\frac{\frac{-1}{2}}{x}}{x \cdot n} + \left(\frac{\log x}{n \cdot \left(x \cdot n\right)} + \frac{\frac{1}{x}}{n}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - e^{\frac{\log x}{n}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus n

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if n < -168922.24220762347 or 190641239.051845 < n

    1. Initial program 44.6

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

      \[\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-exp44.6

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

      \[\leadsto e^{\color{blue}{\frac{\log_* (1 + x)}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]
    6. Taylor expanded around 0 44.6

      \[\leadsto e^{\frac{\log_* (1 + x)}{n}} - \color{blue}{e^{\frac{\log x}{n}}}\]
    7. Using strategy rm
    8. Applied add-cbrt-cube44.7

      \[\leadsto e^{\frac{\log_* (1 + x)}{n}} - \color{blue}{\sqrt[3]{\left(e^{\frac{\log x}{n}} \cdot e^{\frac{\log x}{n}}\right) \cdot e^{\frac{\log x}{n}}}}\]
    9. Taylor expanded around -inf 63.0

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

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

    if -168922.24220762347 < n < 190641239.051845

    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-exp-log3.3

      \[\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-exp3.3

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

      \[\leadsto e^{\color{blue}{\frac{\log_* (1 + x)}{n}}} - {x}^{\left(\frac{1}{n}\right)}\]
    6. Taylor expanded around 0 2.0

      \[\leadsto e^{\frac{\log_* (1 + x)}{n}} - \color{blue}{e^{\frac{\log x}{n}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \le -168922.24220762347 \lor \neg \left(n \le 190641239.051845\right):\\ \;\;\;\;\frac{\frac{\frac{-1}{2}}{x}}{x \cdot n} + \left(\frac{\log x}{n \cdot \left(x \cdot n\right)} + \frac{\frac{1}{x}}{n}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - e^{\frac{\log x}{n}}\\ \end{array}\]

Runtime

Time bar (total: 44.1s)Debug logProfile

herbie shell --seed 2018256 +o rules:numerics
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))