Average Error: 32.4 → 22.5
Time: 50.5s
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}\;\left(\left(\frac{1}{x \cdot n} + 1\right) - \frac{-\log x}{n}\right) - {x}^{\left(\frac{1}{n}\right)} \le -165.82519293662233:\\ \;\;\;\;e^{\frac{\log_* (1 + x)}{n}} - {x}^{\left(\frac{1}{n}\right)}\\ \mathbf{if}\;\left(\left(\frac{1}{x \cdot n} + 1\right) - \frac{-\log x}{n}\right) - {x}^{\left(\frac{1}{n}\right)} \le 4.987314727866732 \cdot 10^{-10}:\\ \;\;\;\;\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{n}}{x \cdot x}\right) - \frac{-\log x}{(e^{e^{\log \left(\log_* (1 + \left(n \cdot n\right) \cdot x)\right)}} - 1)^*}\\ \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 (* x n)) 1) (/ (- (log x)) n)) (pow x (/ 1 n))) < -165.82519293662233 or 4.987314727866732e-10 < (- (- (+ (/ 1 (* x n)) 1) (/ (- (log x)) n)) (pow x (/ 1 n)))

    1. Initial program 23.3

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

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

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

    if -165.82519293662233 < (- (- (+ (/ 1 (* x n)) 1) (/ (- (log x)) n)) (pow x (/ 1 n))) < 4.987314727866732e-10

    1. Initial program 40.2

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{n}}{x \cdot x}\right) - \frac{-\log x}{\left(n \cdot n\right) \cdot x}}\]
    4. Using strategy rm
    5. Applied expm1-log1p-u22.3

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

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

Runtime

Time bar (total: 50.5s)Debug logProfile

herbie shell --seed '#(1070227846 1561819246 480764335 4016816270 2602869839 2117310382)' +o rules:numerics
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))