Average Error: 32.7 → 23.5
Time: 50.3s
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 -1487407600396462.0 \lor \neg \left(n \le 255951803.4251145\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}:\\ \;\;\;\;\log \left(e^{(e^{\log_* (1 + e^{\frac{\log_* (1 + x)}{n}})} - 1)^* - {x}^{\left(\frac{1}{n}\right)}}\right)\\ \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 < -1487407600396462.0 or 255951803.4251145 < n

    1. Initial program 45.2

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Initial simplification45.2

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

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

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

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

      \[\leadsto \color{blue}{\log \left(e^{e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}\]
    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.2

      \[\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 -1487407600396462.0 < n < 255951803.4251145

    1. Initial program 4.7

      \[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    2. Initial simplification4.7

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

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

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

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

      \[\leadsto \color{blue}{\log \left(e^{e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}}\right)}\]
    9. Using strategy rm
    10. Applied expm1-log1p-u4.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \le -1487407600396462.0 \lor \neg \left(n \le 255951803.4251145\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}:\\ \;\;\;\;\log \left(e^{(e^{\log_* (1 + e^{\frac{\log_* (1 + x)}{n}})} - 1)^* - {x}^{\left(\frac{1}{n}\right)}}\right)\\ \end{array}\]

Runtime

Time bar (total: 50.3s)Debug logProfile

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