Average Error: 29.7 → 0.4
Time: 16.0s
Precision: 64
Internal Precision: 128
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le 5674.445687910233:\\ \;\;\;\;\frac{{\left(\sqrt[3]{1 + x}\right)}^{3} - {\left({x}^{\frac{1}{3}}\right)}^{3}}{\left({x}^{\frac{1}{3}} \cdot {x}^{\frac{1}{3}} + {x}^{\frac{1}{3}} \cdot \sqrt[3]{1 + x}\right) + \sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x} \cdot \sqrt[3]{x \cdot \left(\left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)\right)\right)}\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < 5674.445687910233

    1. Initial program 0.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied pow1/30.1

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{\frac{1}{3}}}\]
    4. Using strategy rm
    5. Applied flip3--0.2

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

    if 5674.445687910233 < x

    1. Initial program 60.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied pow1/359.6

      \[\leadsto \sqrt[3]{x + 1} - \color{blue}{{x}^{\frac{1}{3}}}\]
    4. Taylor expanded around -inf 62.4

      \[\leadsto \color{blue}{\left(\frac{5}{81} \cdot \frac{e^{\frac{1}{3} \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{{x}^{3}} + \frac{1}{3} \cdot \frac{e^{\frac{1}{3} \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{x}\right) - \frac{1}{9} \cdot \frac{e^{\frac{1}{3} \cdot \left(\log -1 - \log \left(\frac{-1}{x}\right)\right)}}{{x}^{2}}}\]
    5. Simplified0.6

      \[\leadsto \color{blue}{\left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \frac{\sqrt[3]{x}}{x}}\]
    6. Using strategy rm
    7. Applied div-inv0.7

      \[\leadsto \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \color{blue}{\left(\sqrt[3]{x} \cdot \frac{1}{x}\right)}\]
    8. Applied associate-*r*0.7

      \[\leadsto \color{blue}{\left(\left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \sqrt[3]{x}\right) \cdot \frac{1}{x}}\]
    9. Using strategy rm
    10. Applied add-cbrt-cube0.7

      \[\leadsto \left(\color{blue}{\sqrt[3]{\left(\left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)\right) \cdot \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)}} \cdot \sqrt[3]{x}\right) \cdot \frac{1}{x}\]
    11. Applied cbrt-unprod0.6

      \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)\right) \cdot \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)\right) \cdot x}} \cdot \frac{1}{x}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 5674.445687910233:\\ \;\;\;\;\frac{{\left(\sqrt[3]{1 + x}\right)}^{3} - {\left({x}^{\frac{1}{3}}\right)}^{3}}{\left({x}^{\frac{1}{3}} \cdot {x}^{\frac{1}{3}} + {x}^{\frac{1}{3}} \cdot \sqrt[3]{1 + x}\right) + \sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x} \cdot \sqrt[3]{x \cdot \left(\left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right) \cdot \left(\left(\frac{\frac{-1}{9}}{x} + \frac{1}{3}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\right)\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019007 
(FPCore (x)
  :name "2cbrt (problem 3.3.4)"
  (- (cbrt (+ x 1)) (cbrt x)))

Details

Time bar (total: 14.7s)Debug log

sample84.0ms

Algorithm
intervals

simplify4.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

4.0ms
(- (cbrt (+ x 1)) (cbrt x))

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 33.5b

localize44.0ms

Local error

Found 3 expressions with local error:

3.3b
(- (cbrt (+ x 1)) (cbrt x))
0.6b
(cbrt x)
0.3b
(cbrt (+ x 1))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
3 → 36
Calls

3 calls. Slowest were:

12.0ms
(- (cbrt (+ x 1)) (cbrt x))
1.0ms
(cbrt (+ x 1))
0.0ms
(cbrt x)

series467.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

298.0ms
(cbrt x)
117.0ms
(- (cbrt (+ x 1)) (cbrt x))
51.0ms
(cbrt (+ x 1))

simplify1.0s

Counts
20 → 45
Calls

20 calls. Slowest were:

299.0ms
(- (+ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (* 1/3 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) x))) (+ (* (pow (* x -1) 1/3) (cbrt -1)) (* 1/9 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (pow x 2)))))
240.0ms
(- (+ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (* 1/3 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) x))) (* 1/9 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (pow x 2))))
208.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))

prune415.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 20.0b

localize13.0ms

Local error

Found 3 expressions with local error:

33.9b
(- (cbrt (+ x 1)) (pow x 1/3))
5.2b
(pow x 1/3)
0.3b
(cbrt (+ x 1))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
3 → 37
Calls

3 calls. Slowest were:

5.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
1.0ms
(cbrt (+ x 1))
0.0ms
(pow x 1/3)

series473.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

301.0ms
(pow x 1/3)
119.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
53.0ms
(cbrt (+ x 1))

simplify1.0s

Counts
20 → 46
Calls

20 calls. Slowest were:

351.0ms
(- (+ (* 5/81 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (pow x 3))) (* 1/3 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) x))) (* 1/9 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (pow x 2))))
211.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
146.0ms
(- (+ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (* 1/3 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) x))) (* 1/9 (/ (exp (* 1/3 (- (log -1) (log (/ -1 x))))) (pow x 2))))

prune449.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize40.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt x)
0.4b
(/ -1/9 x)
0.4b
(/ 5/81 x)
0.2b
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (/ (cbrt x) x))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

27.0ms
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (/ (cbrt x) x))
0.0ms
(/ -1/9 x)
0.0ms
(cbrt x)

series368.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

285.0ms
(cbrt x)
69.0ms
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (/ (cbrt x) x))
7.0ms
(/ 5/81 x)
7.0ms
(/ -1/9 x)

simplify3.7s

Counts
33 → 68
Calls

33 calls. Slowest were:

423.0ms
(* (+ (* (+ (pow 1/3 3) (pow (/ -1/9 x) 3)) x) (* (+ (* 1/3 1/3) (- (* (/ -1/9 x) (/ -1/9 x)) (* 1/3 (/ -1/9 x)))) (/ 5/81 x))) (/ (cbrt x) x))
379.0ms
(* (+ (* (+ (pow 1/3 3) (pow (/ -1/9 x) 3)) x) (* (+ (* 1/3 1/3) (- (* (/ -1/9 x) (/ -1/9 x)) (* 1/3 (/ -1/9 x)))) (/ 5/81 x))) (cbrt x))
368.0ms
(* (- (* (+ 1/3 (/ -1/9 x)) (+ 1/3 (/ -1/9 x))) (* (/ (/ 5/81 x) x) (/ (/ 5/81 x) x))) (/ (cbrt x) x))

prune623.0ms

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 0.0b

localize18.0ms

Local error

Found 4 expressions with local error:

1.9b
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (cbrt x))
0.6b
(cbrt x)
0.4b
(/ -1/9 x)
0.4b
(/ 5/81 x)

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 50
Calls

4 calls. Slowest were:

21.0ms
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (cbrt x))
0.0ms
(/ -1/9 x)
0.0ms
(/ 5/81 x)

series385.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

304.0ms
(cbrt x)
57.0ms
(* (+ (+ 1/3 (/ -1/9 x)) (/ (/ 5/81 x) x)) (cbrt x))
12.0ms
(/ 5/81 x)
11.0ms
(/ -1/9 x)

simplify2.1s

Counts
24 → 62
Calls

24 calls. Slowest were:

512.0ms
(* (+ (pow (+ 1/3 (/ -1/9 x)) 3) (pow (/ (/ 5/81 x) x) 3)) (cbrt x))
378.0ms
(* (+ (* (+ (pow 1/3 3) (pow (/ -1/9 x) 3)) x) (* (+ (* 1/3 1/3) (- (* (/ -1/9 x) (/ -1/9 x)) (* 1/3 (/ -1/9 x)))) (/ 5/81 x))) (cbrt x))
323.0ms
(* (- (* (+ 1/3 (/ -1/9 x)) (+ 1/3 (/ -1/9 x))) (* (/ (/ 5/81 x) x) (/ (/ 5/81 x) x))) (cbrt x))

prune597.0ms

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.0b

regimes93.0ms

Accuracy

99% (0.3b remaining)

Error of 0.4b against oracle of 0.1b and baseline of 31.3b

bsearch80.0ms

end0.0ms

sample2.6s

Algorithm
intervals