Average Error: 29.9 → 0.4
Time: 46.7s
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}:\\ \;\;\;\;(\left(\frac{\sqrt[3]{x}}{x \cdot x}\right) \cdot \left(\frac{-1}{9} + \frac{\frac{5}{81}}{x}\right) + \left(\frac{\sqrt[3]{x}}{\frac{x}{\frac{1}{3}}}\right))_*\\ \end{array}\]

Error

Bits error versus x

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.7

      \[\leadsto \color{blue}{(\left(\frac{\sqrt[3]{x}}{x \cdot x}\right) \cdot \left(\frac{\frac{5}{81}}{x} + \frac{-1}{9}\right) + \left(\frac{\sqrt[3]{x}}{\frac{x}{\frac{1}{3}}}\right))_*}\]
  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}:\\ \;\;\;\;(\left(\frac{\sqrt[3]{x}}{x \cdot x}\right) \cdot \left(\frac{-1}{9} + \frac{\frac{5}{81}}{x}\right) + \left(\frac{\sqrt[3]{x}}{\frac{x}{\frac{1}{3}}}\right))_*\\ \end{array}\]

Reproduce

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

Details

Time bar (total: 45.8s)Debug log

sample86.0ms

Algorithm
intervals
Results
20.0ms270×body80nan
20.0ms50×body1280valid
14.0ms44×body640valid
10.0ms126×body80valid
5.0ms22×body320valid
2.0ms14×body160valid

simplify8.0ms

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.6b

localize21.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))

rewrite34.0ms

Algorithm
rewrite-expression-head
Rules
22×add-sqr-sqrt
20×*-un-lft-identity
18×add-cube-cbrt
18×prod-diff
16×cbrt-prod
fma-neg
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
difference-of-squares
pow1/3
cbrt-div
distribute-lft-out--
flip--
flip-+
diff-log
flip3--
flip3-+
sub-neg
Counts
3 → 66
Calls
3 calls:
Slowest
30.0ms
(- (cbrt (+ x 1)) (cbrt x))
1.0ms
(cbrt (+ x 1))
0.0ms
(cbrt x)

series382.0ms

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

simplify1.8s

Counts
61 → 75
Calls
61 calls:
Slowest
320.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)))))
303.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
167.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))))
104.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)))
63.0ms
(- (+ (* 1/3 x) 1) (* 1/9 (pow x 2)))

prune676.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 15.1b

localize25.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))

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
22×add-sqr-sqrt
20×*-un-lft-identity
18×add-cube-cbrt
18×prod-diff
16×cbrt-prod
fma-neg
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
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 → 67
Calls
3 calls:
Slowest
8.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
1.0ms
(cbrt (+ x 1))
0.0ms
(pow x 1/3)

series379.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
222.0ms
(pow x 1/3)
112.0ms
(- (cbrt (+ x 1)) (pow x 1/3))
44.0ms
(cbrt (+ x 1))

simplify2.1s

Counts
61 → 76
Calls
61 calls:
Slowest
370.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))))
338.0ms
(- (+ (* 1/3 x) 1) (+ (* 1/9 (pow x 2)) (pow x 1/3)))
229.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))))
128.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)))

prune708.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize57.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)

rewrite18.0ms

Algorithm
rewrite-expression-head
Rules
187×prod-diff
145×add-sqr-sqrt
138×cube-prod
138×unpow-prod-down
125×*-un-lft-identity
115×add-cube-cbrt
78×cbrt-prod
29×unpow3
29×cube-mult
17×fma-neg
15×difference-of-squares
add-log-exp
distribute-lft-out--
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
unpow1/3
pow-to-exp
flip--
diff-log
flip3--
sub-neg
difference-cubes
Counts
4 → 272
Calls
4 calls:
Slowest
13.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)

series890.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
317.0ms
(pow x 1/3)
287.0ms
(pow x 1/3)
263.0ms
(pow x 1/3)
23.0ms
(- (pow (cbrt (+ x 1)) 3) (pow (pow x 1/3) 3))

simplify31.3s

Counts
444 → 284
Calls
444 calls:
Slowest
332.0ms
(fma (- (pow (cbrt (pow x 1/3)) 3)) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3) (* (pow (cbrt (pow x 1/3)) 3) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3)))
330.0ms
(fma (- (pow (cbrt (pow x 1/3)) 3)) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3) (* (pow (cbrt (pow x 1/3)) 3) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3)))
330.0ms
(fma (- (pow (cbrt (pow x 1/3)) 3)) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3) (* (pow (cbrt (pow x 1/3)) 3) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3)))
327.0ms
(fma (- (pow (cbrt (pow x 1/3)) 3)) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3) (* (pow (cbrt (pow x 1/3)) 3) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3)))
316.0ms
(fma (- (pow (cbrt (pow x 1/3)) 3)) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3) (* (pow (cbrt (pow x 1/3)) 3) (pow (* (cbrt (pow x 1/3)) (cbrt (pow x 1/3))) 3)))

prune2.9s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.3b

localize8.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))

rewrite7.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
log1p-expm1-u
cbrt-unprod
prod-exp
pow1
expm1-log1p-u
associate-*l*
associate-*r*
pow-prod-up
*-commutative
pow-prod-down
pow2
Counts
4 → 60
Calls
4 calls:
Slowest
5.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)

series926.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
254.0ms
(pow x 1/3)
226.0ms
(pow x 1/3)
224.0ms
(* (pow x 1/3) (pow x 1/3))
223.0ms
(pow x 1/3)

simplify432.0ms

Counts
27 → 72
Calls
27 calls:
Slowest
125.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
109.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
107.0ms
(exp (* 1/3 (- (log -1) (log (/ -1 x)))))
17.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)))
11.0ms
(* x (* (* (pow x 1/3) (pow x 1/3)) (pow x 1/3)))

prune639.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.2b

regimes57.0ms

Accuracy

92.5% (0.2b remaining)

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

bsearch74.0ms

end0.0ms

sample2.4s

Algorithm
intervals
Results
703.0ms1723×body1280valid
565.0ms8004×body80nan
347.0ms1212×body640valid
342.0ms4065×body80valid
159.0ms665×body320valid
42.0ms335×body160valid