Average Error: 30.2 → 2.0
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 -5211221885.493968:\\ \;\;\;\;\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 1060309744923.502:\\ \;\;\;\;{\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}\right)}^3 - {x}^{\left(\frac{1}{n}\right)}\\ \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 < -5211221885.493968 or 1060309744923.502 < n

    1. Initial program 43.5

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

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

      \[\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 -5211221885.493968 < n < 1060309744923.502

    1. Initial program 3.8

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{{\left(x + 1\right)}^{\left(\frac{1}{n}\right)}}\right)}^3} - {x}^{\left(\frac{1}{n}\right)}\]
  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 '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (x n)
  :name "2nthrt (problem 3.4.6)"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))