Average Error: 30.4 → 2.2
Time: 27.4s
Precision: 64
Internal Precision: 128
\[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
\[\begin{array}{l} \mathbf{if}\;x \le 3998.3190634746425:\\ \;\;\;\;\sqrt{\sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} - \sqrt[3]{x}\\ \mathbf{elif}\;x \le 1.3592927885672945 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{\frac{1}{{x}^{8}}} \cdot \frac{5}{81} + \left(\sqrt[3]{\frac{1}{x \cdot x}} \cdot \frac{1}{3} - \frac{1}{9} \cdot \sqrt[3]{\frac{1}{{x}^{5}}}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\frac{1}{3} \cdot \log x - \frac{\frac{1}{3}}{x}\right) + \left(\left(\log \frac{1}{3} - \log x\right) + \frac{\frac{7}{54}}{x \cdot 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 3 regimes
  2. if x < 3998.3190634746425

    1. Initial program 0.1

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt0.2

      \[\leadsto \color{blue}{\sqrt{\sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} - \sqrt[3]{x}\]

    if 3998.3190634746425 < x < 1.3592927885672945e+154

    1. Initial program 59.2

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube58.9

      \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \sqrt[3]{x}\]
    4. Taylor expanded around inf 5.1

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

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

    if 1.3592927885672945e+154 < x

    1. Initial program 61.0

      \[\sqrt[3]{x + 1} - \sqrt[3]{x}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube61.2

      \[\leadsto \color{blue}{\sqrt[3]{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \sqrt[3]{x}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt61.4

      \[\leadsto \sqrt[3]{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right)}} - \sqrt[3]{x}\]
    6. Using strategy rm
    7. Applied add-exp-log61.4

      \[\leadsto \color{blue}{e^{\log \left(\sqrt[3]{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \left(\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right)} - \sqrt[3]{x}\right)}}\]
    8. Taylor expanded around inf 6.9

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

      \[\leadsto e^{\color{blue}{\left(\log x \cdot \frac{1}{3} - \frac{\frac{1}{3}}{x}\right) + \left(\left(\log \frac{1}{3} - \log x\right) + \frac{\frac{7}{54}}{x \cdot x}\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 3998.3190634746425:\\ \;\;\;\;\sqrt{\sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} - \sqrt[3]{x}\\ \mathbf{elif}\;x \le 1.3592927885672945 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{\frac{1}{{x}^{8}}} \cdot \frac{5}{81} + \left(\sqrt[3]{\frac{1}{x \cdot x}} \cdot \frac{1}{3} - \frac{1}{9} \cdot \sqrt[3]{\frac{1}{{x}^{5}}}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\frac{1}{3} \cdot \log x - \frac{\frac{1}{3}}{x}\right) + \left(\left(\log \frac{1}{3} - \log x\right) + \frac{\frac{7}{54}}{x \cdot x}\right)}\\ \end{array}\]

Reproduce

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

Details

Time bar (total: 25.7s)Debug log

sample155.0ms

Algorithm
intervals
Results
52×31.0ms(body real 1280)
249×27.0ms(body nan 80)
125×25.0ms(body real 80)
43×19.0ms(body real 640)
505×12.0ms(pre true 80)
27×10.0ms(body real 320)
2.0ms(body real 160)

simplify10.0ms

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

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.1b

localize34.0ms

Local error

Found 3 expressions with local error:

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

rewrite17.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
14.0ms
(- (cbrt (+ x 1)) (cbrt x))
1.0ms
(cbrt (+ x 1))
0.0ms
(cbrt x)

series842.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
546.0ms
(cbrt x)
213.0ms
(- (cbrt (+ x 1)) (cbrt x))
84.0ms
(cbrt (+ x 1))

simplify1.5s

Counts
20 → 45
Calls
20 calls:
Slowest
400.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)))))
370.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
295.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))))
101.0ms
(- (+ (* 1/3 x) 1) (* 1/9 (pow x 2)))
98.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)))

prune791.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 15.0b

localize33.0ms

Local error

Found 4 expressions with local error:

2.1b
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1)))) (cbrt x))
0.6b
(cbrt x)
0.3b
(cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1))))
0.3b
(cbrt (+ x 1))

rewrite65.0ms

Algorithm
rewrite-expression-head
Rules
82×cbrt-div
28×flip-+
28×flip3-+
28×frac-times
14×associate-*l/
associate-*r/
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-cube-cbrt
add-exp-log
add-cbrt-cube
pow1
cbrt-prod
pow1/3
difference-of-squares
distribute-lft-out--
flip--
rem-cbrt-cube
pow3
diff-log
flip3--
sub-neg
Counts
4 → 71
Calls
4 calls:
Slowest
36.0ms
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1)))) (cbrt x))
24.0ms
(cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1))))
1.0ms
(cbrt (+ x 1))
0.0ms
(cbrt x)

series826.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
476.0ms
(cbrt x)
202.0ms
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1)))) (cbrt x))
75.0ms
(cbrt (+ x 1))
72.0ms
(cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (cbrt (+ x 1))))

simplify3.8s

Counts
49 → 83
Calls
49 calls:
Slowest
381.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
381.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)))))
273.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))))
267.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))))
112.0ms
(cbrt (* (* (cbrt (- (* x x) (* 1 1))) (cbrt (+ x 1))) (cbrt (+ (pow x 3) (pow 1 3)))))

prune1.7s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 15.0b

localize49.0ms

Local error

Found 4 expressions with local error:

7.5b
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x))
0.6b
(cbrt x)
0.3b
(cbrt (+ x 1))
0.3b
(cbrt (+ x 1))

rewrite146.0ms

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

series794.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
471.0ms
(cbrt x)
170.0ms
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x))
78.0ms
(cbrt (+ x 1))
75.0ms
(cbrt (+ x 1))

simplify2.5s

Counts
26 → 60
Calls
26 calls:
Slowest
387.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)))))
369.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
304.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))))
274.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))))
158.0ms
(/ (exp (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1))))))) (exp (cbrt x)))

prune1.3s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 15.0b

localize22.0ms

Local error

Found 4 expressions with local error:

7.5b
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x))
6.7b
(log (- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x)))
0.6b
(cbrt x)
0.3b
(cbrt (+ x 1))

rewrite381.0ms

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

series894.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
465.0ms
(cbrt x)
197.0ms
(log (- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x)))
167.0ms
(- (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt x))
66.0ms
(cbrt (+ x 1))

simplify3.5s

Counts
29 → 63
Calls
29 calls:
Slowest
469.0ms
(log (- (* (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1)))))) (cbrt (* (* (cbrt (+ x 1)) (cbrt (+ x 1))) (* (* (cbrt (cbrt (+ x 1))) (cbrt (cbrt (+ x 1)))) (cbrt (cbrt (+ x 1))))))) (* (cbrt x) (cbrt x))))
370.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)))))
336.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
272.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))))
240.0ms
(- (+ (log (* 1/3 (pow x 1/3))) (+ (log (/ 1 x)) (* 7/54 (/ 1 (pow x 2))))) (* 1/3 (/ 1 x)))

prune1.5s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 2.1b

regimes218.0ms

Accuracy

99.9% (0.0b remaining)

Error of 2.2b against oracle of 2.1b and baseline of 30.3b

bsearch283.0ms

end0.0ms

sample4.4s

Algorithm
intervals
Results
1692×1.4s(body real 1280)
7935×931.0ms(body nan 80)
1249×584.0ms(body real 640)
4012×531.0ms(body real 80)
15935×340.0ms(pre true 80)
711×263.0ms(body real 320)
336×71.0ms(body real 160)