Average Error: 29.9 → 0.4
Time: 12.1s
Precision: 64
Internal Precision: 128
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le 2.024352565067993 \cdot 10^{+17}:\\ \;\;\;\;\frac{1}{\left(\sqrt[3]{x \cdot x} + \sqrt[3]{1 + x} \cdot {x}^{\frac{1}{3}}\right) + \sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{x}}{x} \cdot \left(\left(\frac{1}{3} + \frac{\frac{-1}{9}}{x}\right) + \frac{\frac{\frac{5}{81}}{x}}{x}\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 < 2.024352565067993e+17

    1. Initial program 1.8

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

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

      \[\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)}}\]
    6. Taylor expanded around inf 0.2

      \[\leadsto \frac{\color{blue}{1}}{\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)}\]
    7. Using strategy rm
    8. Applied add-cbrt-cube0.2

      \[\leadsto \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left({x}^{\frac{1}{3}} \cdot \color{blue}{\sqrt[3]{\left({x}^{\frac{1}{3}} \cdot {x}^{\frac{1}{3}}\right) \cdot {x}^{\frac{1}{3}}}} + \sqrt[3]{x + 1} \cdot {x}^{\frac{1}{3}}\right)}\]
    9. Applied unpow1/30.2

      \[\leadsto \frac{1}{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1} + \left(\color{blue}{\sqrt[3]{x}} \cdot \sqrt[3]{\left({x}^{\frac{1}{3}} \cdot {x}^{\frac{1}{3}}\right) \cdot {x}^{\frac{1}{3}}} + \sqrt[3]{x + 1} \cdot {x}^{\frac{1}{3}}\right)}\]
    10. Applied cbrt-unprod0.2

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

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

    if 2.024352565067993e+17 < x

    1. Initial program 61.3

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

      \[\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}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

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

Reproduce

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

Details

Time bar (total: 11.4s)Debug log

sample58.0ms

Algorithm
intervals
Results
14.0ms270×body80nan
14.0ms50×body1280valid
9.0ms44×body640valid
7.0ms126×body80valid
3.0ms22×body320valid
2.0ms14×body160valid

simplify4.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
4.0ms
(- (cbrt (+ x 1)) (cbrt x))

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.6b

localize10.0ms

Local error

Found 3 expressions with local error:

4.0b
(- (cbrt (+ x 1)) (cbrt x))
0.5b
(cbrt x)
0.3b
(cbrt (+ x 1))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
*-un-lft-identity
add-log-exp
add-cube-cbrt
cbrt-prod
add-exp-log
add-cbrt-cube
pow1
difference-of-squares
pow1/3
cbrt-div
distribute-lft-out--
flip--
flip-+
diff-log
flip3--
flip3-+
sub-neg
Counts
3 → 36
Calls
3 calls:
Slowest
7.0ms
(- (cbrt (+ x 1)) (cbrt x))
1.0ms
(cbrt (+ x 1))
0.0ms
(cbrt x)

series423.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
273.0ms
(cbrt x)
116.0ms
(- (cbrt (+ x 1)) (cbrt x))
34.0ms
(cbrt (+ x 1))

simplify867.0ms

Counts
20 → 45
Calls
20 calls:
Slowest
249.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)))))
222.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
152.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))))
54.0ms
(- (+ (* 1/3 (pow (/ 1 (pow x 2)) 1/3)) (pow (/ 1 x) -1/3)) (* 1/9 (pow (/ 1 (pow x 5)) 1/3)))
51.0ms
(- (+ (* 1/3 (pow (/ 1 (pow x 2)) 1/3)) (* 5/81 (pow (/ 1 (pow x 8)) 1/3))) (* 1/9 (pow (/ 1 (pow x 5)) 1/3)))

prune442.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 15.1b

localize20.0ms

Local error

Found 3 expressions with local error:

30.7b
(- (cbrt (+ x 1)) (pow x 1/3))
5.1b
(pow x 1/3)
0.3b
(cbrt (+ x 1))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
*-un-lft-identity
add-log-exp
add-cube-cbrt
cbrt-prod
add-exp-log
add-cbrt-cube
pow1
difference-of-squares
cbrt-div
distribute-lft-out--
flip--
flip-+
diff-log
pow1/3
unpow1/3
flip3--
flip3-+
sub-neg
pow-to-exp
Counts
3 → 37
Calls
3 calls:
Slowest
7.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
0.0ms
(cbrt (+ x 1))
0.0ms
(pow x 1/3)

series445.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
270.0ms
(pow x 1/3)
130.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
46.0ms
(cbrt (+ x 1))

simplify1.1s

Counts
20 → 46
Calls
20 calls:
Slowest
318.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))))
201.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))))
193.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
96.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
87.0ms
(- (+ (* 1/3 (pow (/ 1 (pow x 2)) 1/3)) (* 5/81 (pow (/ 1 (pow x 8)) 1/3))) (* 1/9 (pow (/ 1 (pow x 5)) 1/3)))

prune386.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize45.0ms

Local error

Found 4 expressions with local error:

29.9b
(- (pow (cbrt (+ x 1)) 3) (pow (pow x 1/3) 3))
5.1b
(pow x 1/3)
5.1b
(pow x 1/3)
5.1b
(pow x 1/3)

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
34×add-sqr-sqrt
15×difference-of-squares
15×cube-prod
15×unpow-prod-down
14×*-un-lft-identity
add-log-exp
cbrt-prod
distribute-lft-out--
add-cube-cbrt
add-exp-log
add-cbrt-cube
pow1
unpow1/3
pow-to-exp
flip--
diff-log
flip3--
sub-neg
difference-cubes
Counts
4 → 60
Calls
4 calls:
Slowest
10.0ms
(- (pow (cbrt (+ x 1)) 3) (pow (pow x 1/3) 3))
0.0ms
(pow x 1/3)
0.0ms
(pow x 1/3)
0.0ms
(pow x 1/3)

series825.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
297.0ms
(pow x 1/3)
257.0ms
(pow x 1/3)
245.0ms
(pow x 1/3)
27.0ms
(- (pow (cbrt (+ x 1)) 3) (pow (pow x 1/3) 3))

simplify1.1s

Counts
54 → 72
Calls
54 calls:
Slowest
142.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
126.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
114.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
52.0ms
(/ (exp (pow (cbrt (+ x 1)) 3)) (exp (pow (pow x 1/3) 3)))
33.0ms
(- (pow (cbrt (sqrt (+ x 1))) 3) (pow (sqrt (pow x 1/3)) 3))

prune846.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.3b

localize9.0ms

Local error

Found 4 expressions with local error:

5.1b
(pow x 1/3)
5.1b
(pow x 1/3)
5.1b
(pow x 1/3)
0.5b
(* (pow x 1/3) (pow x 1/3))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
add-exp-log
add-cbrt-cube
unpow1/3
pow-to-exp
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
cbrt-unprod
prod-exp
pow1
associate-*l*
associate-*r*
pow-prod-up
*-commutative
pow-prod-down
pow2
Counts
4 → 52
Calls
4 calls:
Slowest
6.0ms
(* (pow x 1/3) (pow x 1/3))
0.0ms
(pow x 1/3)
0.0ms
(pow x 1/3)
0.0ms
(pow x 1/3)

series1.0s

Counts
4 → 12
Calls
4 calls:
Slowest
286.0ms
(* (pow x 1/3) (pow x 1/3))
279.0ms
(pow x 1/3)
249.0ms
(pow x 1/3)
228.0ms
(pow x 1/3)

simplify525.0ms

Counts
27 → 64
Calls
27 calls:
Slowest
147.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
139.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
122.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
27.0ms
(* (* (* (pow x 1/3) (pow x 1/3)) (pow x 1/3)) (* (* (pow x 1/3) (pow x 1/3)) (pow x 1/3)))
12.0ms
(+ (* (log x) 1/3) (log (pow x 1/3)))

prune644.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.2b

regimes70.0ms

Accuracy

95.1% (0.1b remaining)

Error of 0.4b against oracle of 0.3b and baseline of 2.3b

bsearch54.0ms

end0.0ms

sample2.5s

Algorithm
intervals
Results
659.0ms1723×body1280valid
533.0ms8004×body80nan
508.0ms665×body320valid
269.0ms1212×body640valid
269.0ms4065×body80valid
72.0ms335×body160valid