Average Error: 31.2 → 1.4
Time: 2.5m
Precision: 64
Ground Truth: 128
\[{\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\]
\[\begin{array}{l} \mathbf{if}\;n \le -10367083.601009807:\\ \;\;\;\;\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 9856023268.288397:\\ \;\;\;\;{\left(e^{\log \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}^3\right)}\right)}^{\frac{1}{3}}\\ \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 < -10367083.601009807 or 9856023268.288397 < n

    1. Initial program 44.1

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

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

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

      \[\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 -10367083.601009807 < n < 9856023268.288397

    1. Initial program 2.4

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

      \[\leadsto \color{blue}{\sqrt[3]{{\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}^3}}\]
    4. Using strategy rm
    5. Applied pow1/3 2.4

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

      \[\leadsto {\color{blue}{\left(e^{\log \left({\left({\left(x + 1\right)}^{\left(\frac{1}{n}\right)} - {x}^{\left(\frac{1}{n}\right)}\right)}^3\right)}\right)}}^{\frac{1}{3}}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Total time: 2.5m Debug log

Please include this information when filing a bug report:

herbie --seed '#(3878966972 3292326135 1048456940 3989568066 1548438449 1374434303)'
(FPCore (x n)
  :name "NMSE problem 3.4.6"
  (- (pow (+ x 1) (/ 1 n)) (pow x (/ 1 n))))