Average Error: 32.4 → 22.5
Time: 54.1s
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 -444102.8508761502:\\ \;\;\;\;{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {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 1.9949258911466927 \cdot 10^{-09}:\\ \;\;\;\;\left(\frac{\frac{1}{x}}{n} - \frac{\frac{\frac{1}{2}}{x}}{x \cdot n}\right) - \frac{-\log x}{\left(n \cdot n\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} \cdot {\left(\sqrt{x + 1}\right)}^{\left(\frac{1}{n}\right)} - {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))) < -444102.8508761502 or 1.9949258911466927e-09 < (- (- (+ (/ 1 (* x n)) 1) (/ (- (log x)) n)) (pow x (/ 1 n)))

    1. Initial program 23.2

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

      \[\leadsto {\color{blue}{\left(\sqrt{x + 1} \cdot \sqrt{x + 1}\right)}}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
    4. Applied unpow-prod-down23.2

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

    if -444102.8508761502 < (- (- (+ (/ 1 (* x n)) 1) (/ (- (log x)) n)) (pow x (/ 1 n))) < 1.9949258911466927e-09

    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.6

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

      \[\leadsto \color{blue}{\left(\frac{1}{x \cdot n} - \frac{\frac{\frac{1}{2}}{x}}{x \cdot n}\right) - \frac{-\log x}{\left(n \cdot n\right) \cdot x}}\]
    4. Using strategy rm
    5. Applied associate-/r*21.8

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

Runtime

Time bar (total: 54.1s)Debug logProfile

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