Average Error: 30.1 → 30.0
Time: 15.4s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[\frac{\left(\sqrt{\sqrt[3]{x + 1}} \cdot \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right|\right) \cdot \left(\sqrt{\sqrt[3]{x + 1}} \cdot \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right|\right) - \sqrt{\sqrt{x}} \cdot \left(\sqrt{\sqrt{x}} \cdot \sqrt{x}\right)}{\sqrt{x} + \sqrt{\sqrt[3]{x + 1}} \cdot \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right|}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original30.1
Target0.2
Herbie30.0
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 30.1

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

    \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} - \sqrt{x}\]
  4. Applied sqrt-prod30.1

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

    \[\leadsto \color{blue}{\left|\sqrt[3]{1 + x}\right|} \cdot \sqrt{\sqrt[3]{x + 1}} - \sqrt{x}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt30.1

    \[\leadsto \left|\sqrt[3]{\color{blue}{\left(\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right) \cdot \sqrt[3]{1 + x}}}\right| \cdot \sqrt{\sqrt[3]{x + 1}} - \sqrt{x}\]
  8. Applied cbrt-prod30.0

    \[\leadsto \left|\color{blue}{\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}}\right| \cdot \sqrt{\sqrt[3]{x + 1}} - \sqrt{x}\]
  9. Using strategy rm
  10. Applied flip--30.0

    \[\leadsto \color{blue}{\frac{\left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) \cdot \left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) - \sqrt{x} \cdot \sqrt{x}}{\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}} + \sqrt{x}}}\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt30.0

    \[\leadsto \frac{\left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) \cdot \left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) - \color{blue}{\left(\sqrt{\sqrt{x}} \cdot \sqrt{\sqrt{x}}\right)} \cdot \sqrt{x}}{\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}} + \sqrt{x}}\]
  13. Applied associate-*l*30.0

    \[\leadsto \frac{\left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) \cdot \left(\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}}\right) - \color{blue}{\sqrt{\sqrt{x}} \cdot \left(\sqrt{\sqrt{x}} \cdot \sqrt{x}\right)}}{\left|\sqrt[3]{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt[3]{\sqrt[3]{1 + x}}\right| \cdot \sqrt{\sqrt[3]{x + 1}} + \sqrt{x}}\]
  14. Final simplification30.0

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

Reproduce

herbie shell --seed 2019010 
(FPCore (x)
  :name "2sqrt (example 3.1)"

  :herbie-target
  (/ 1 (+ (sqrt (+ x 1)) (sqrt x)))

  (- (sqrt (+ x 1)) (sqrt x)))

Details

Time bar (total: 12.2s)Debug log

sample85.0ms

Algorithm
intervals

simplify8.0ms

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 25.9b

localize19.0ms

Local error

Found 2 expressions with local error:

3.3b
(- (sqrt (+ x 1)) (sqrt x))
0.0b
(sqrt (+ x 1))

rewrite15.0ms

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

series62.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
50.0ms
(- (sqrt (+ x 1)) (sqrt x))
11.0ms
(sqrt (+ x 1))

simplify119.0ms

Counts
18 → 35
Calls
18 calls:
Slowest
44.0ms
(- (+ (* 1/2 x) 1) (* 1/8 (pow x 2)))
25.0ms
(sqrt (- (* x x) (* 1 1)))
14.0ms
(/ (exp (sqrt (+ x 1))) (exp (sqrt x)))
5.0ms
(- (sqrt (sqrt (+ x 1))) (sqrt (sqrt x)))
5.0ms
(- (sqrt (sqrt (+ x 1))) (sqrt (sqrt x)))

prune279.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 25.3b

localize28.0ms

Local error

Found 4 expressions with local error:

13.0b
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
0.2b
(cbrt (+ x 1))
0.2b
(cbrt (+ 1 x))
0.1b
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))

rewrite14.0ms

Algorithm
rewrite-expression-head
Rules
10×add-cube-cbrt
10×*-un-lft-identity
10×add-sqr-sqrt
associate-*r*
cbrt-prod
add-log-exp
sqrt-prod
add-exp-log
add-cbrt-cube
cbrt-div
pow1
flip-+
associate-*l*
flip3-+
associate-*r/
sqrt-div
pow1/3
flip--
cbrt-unprod
*-commutative
prod-exp
pow-prod-down
diff-log
flip3--
sub-neg
Counts
4 → 63
Calls
4 calls:
Slowest
7.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
5.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
1.0ms
(cbrt (+ x 1))
1.0ms
(cbrt (+ 1 x))

series202.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
61.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
60.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
40.0ms
(cbrt (+ x 1))
40.0ms
(cbrt (+ 1 x))

simplify1.3s

Counts
39 → 75
Calls
39 calls:
Slowest
243.0ms
(- (+ (fabs (pow (+ x 1) 1/3)) (* 1/6 (* (fabs (pow (+ x 1) 1/3)) x))) (* 5/72 (* (fabs (pow (+ x 1) 1/3)) (pow x 2))))
170.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))))
161.0ms
(- (+ (* 1/6 (/ (* (fabs (pow (+ x 1) 1/3)) (exp (* 1/6 (- (log -1) (log (/ -1 x)))))) x)) (* (fabs (pow (+ x 1) 1/3)) (exp (* 1/6 (- (log -1) (log (/ -1 x))))))) (* 5/72 (/ (* (fabs (pow (+ x 1) 1/3)) (exp (* 1/6 (- (log -1) (log (/ -1 x)))))) (pow x 2))))
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))))
141.0ms
(- (+ (* 1/6 (* (fabs (pow (+ x 1) 1/3)) (pow (/ 1 (pow x 5)) 1/6))) (* (fabs (pow (+ x 1) 1/3)) (pow x 1/6))) (* 5/72 (* (fabs (pow (+ x 1) 1/3)) (pow (/ 1 (pow x 11)) 1/6))))

prune1.0s

Pruning

17 alts after pruning (17 fresh and 0 done)

Merged error: 25.3b

localize34.0ms

Local error

Found 4 expressions with local error:

16.4b
(- (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
0.2b
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
0.2b
(cbrt (+ x 1))
0.2b
(cbrt (+ 1 x))

rewrite27.0ms

Algorithm
rewrite-expression-head
Rules
16×cbrt-div
12×cbrt-prod
10×add-cube-cbrt
10×*-un-lft-identity
10×add-sqr-sqrt
pow1
flip-+
flip3-+
add-log-exp
add-exp-log
associate-*l*
associate-*r*
pow1/3
add-cbrt-cube
frac-times
pow-prod-up
associate-*r/
associate-*l/
pow-prod-down
flip--
cbrt-unprod
*-commutative
prod-exp
diff-log
flip3--
pow-plus
sub-neg
pow2
Counts
4 → 74
Calls
4 calls:
Slowest
13.0ms
(- (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
10.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
1.0ms
(cbrt (+ x 1))
1.0ms
(cbrt (+ 1 x))

series198.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
82.0ms
(- (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
48.0ms
(cbrt (+ 1 x))
36.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
32.0ms
(cbrt (+ x 1))

simplify1.3s

Counts
55 → 86
Calls
55 calls:
Slowest
225.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))))
190.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))))
69.0ms
(- (+ (* 1/3 (pow (/ 1 (pow x 2)) 1/3)) (pow (/ 1 x) -1/3)) (* 1/9 (pow (/ 1 (pow x 5)) 1/3)))
61.0ms
(- (+ (* 2/3 (pow (/ 1 x) 1/3)) (pow (/ -1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))
60.0ms
(- (+ (* 2/3 x) 1) (* 1/9 (pow x 2)))

prune1.3s

Pruning

18 alts after pruning (18 fresh and 0 done)

Merged error: 25.3b

localize38.0ms

Local error

Found 4 expressions with local error:

16.1b
(- (* (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1))))) (* (sqrt x) (sqrt x)))
0.5b
(* (sqrt x) (sqrt x))
0.2b
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
0.2b
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))

rewrite46.0ms

Algorithm
rewrite-expression-head
Rules
24×cbrt-div
19×pow1
15×associate-*l*
15×associate-*r*
14×add-cube-cbrt
14×*-un-lft-identity
14×add-sqr-sqrt
12×flip-+
12×flip3-+
12×cbrt-prod
10×add-exp-log
pow1/3
frac-times
add-log-exp
pow-prod-up
pow-prod-down
add-cbrt-cube
associate-*r/
associate-*l/
pow1/2
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
difference-of-squares
flip--
diff-log
sqrt-unprod
flip3--
rem-square-sqrt
sub-neg
Counts
4 → 109
Calls
4 calls:
Slowest
29.0ms
(- (* (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1))))) (* (sqrt x) (sqrt x)))
7.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
5.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
4.0ms
(* (sqrt x) (sqrt x))

series129.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
56.0ms
(- (* (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (* (fabs (* (cbrt (* (cbrt (+ 1 x)) (cbrt (+ 1 x)))) (cbrt (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1))))) (* (sqrt x) (sqrt x)))
34.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
32.0ms
(* (cbrt (+ 1 x)) (cbrt (+ 1 x)))
7.0ms
(* (sqrt x) (sqrt x))

simplify1.5s

Counts
93 → 121
Calls
93 calls:
Slowest
320.0ms
(- (+ (pow (fabs (pow (+ x 1) 1/3)) 2) (* 1/3 (* (pow (fabs (pow (+ x 1) 1/3)) 2) x))) (+ x (* 1/9 (* (pow (fabs (pow (+ x 1) 1/3)) 2) (pow x 2)))))
94.0ms
(- (+ (* 1/3 (* (pow (fabs (pow (+ x 1) 1/3)) 2) (pow (/ 1 (pow x 2)) 1/3))) (* (pow (fabs (pow (+ x 1) 1/3)) 2) (pow x 1/3))) x)
83.0ms
(- (+ (* 2/3 x) 1) (* 1/9 (pow x 2)))
69.0ms
(- (+ (* 2/3 (pow (/ 1 x) 1/3)) (pow (/ -1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))
67.0ms
(- (+ (* 2/3 (pow (/ 1 x) 1/3)) (pow (/ 1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))

prune2.1s

Pruning

21 alts after pruning (21 fresh and 0 done)

Merged error: 24.9b

regimes163.0ms

Accuracy

0% (1.1b remaining)

Error of 30.0b against oracle of 28.9b and baseline of 30.0b

bsearch3.0ms

end0.0ms

sample2.3s

Algorithm
intervals