Average Error: 29.7 → 29.6
Time: 16.1s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[e^{\log \left(\sqrt{\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}} \cdot \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right| - \sqrt{x}\right)}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original29.7
Target0.2
Herbie29.6
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.7

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

    \[\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-prod29.7

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

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

    \[\leadsto \left|\sqrt[3]{1 + x}\right| \cdot \sqrt{\sqrt[3]{\color{blue}{\sqrt{x + 1} \cdot \sqrt{x + 1}}}} - \sqrt{x}\]
  8. Applied cbrt-prod29.7

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

    \[\leadsto \color{blue}{e^{\log \left(\left|\sqrt[3]{1 + x}\right| \cdot \sqrt{\sqrt[3]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}} - \sqrt{x}\right)}}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt29.6

    \[\leadsto e^{\log \left(\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]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}} - \sqrt{x}\right)}\]
  13. Applied cbrt-prod29.6

    \[\leadsto e^{\log \left(\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]{\sqrt{x + 1}} \cdot \sqrt[3]{\sqrt{x + 1}}} - \sqrt{x}\right)}\]
  14. Final simplification29.6

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

Reproduce

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

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

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

Details

Time bar (total: 10.8s)Debug log

sample61.0ms

Algorithm
intervals

simplify6.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

6.0ms
(- (sqrt (+ x 1)) (sqrt x))

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 27.8b

localize22.0ms

Local error

Found 2 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
2 → 29
Calls

2 calls. Slowest were:

11.0ms
(- (sqrt (+ x 1)) (sqrt x))
1.0ms
(sqrt (+ x 1))

series56.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

38.0ms
(- (sqrt (+ x 1)) (sqrt x))
17.0ms
(sqrt (+ x 1))

simplify144.0ms

Counts
18 → 35
Calls

18 calls. Slowest were:

55.0ms
(- (+ (* 1/2 x) 1) (* 1/8 (pow x 2)))
38.0ms
(/ (exp (sqrt (+ x 1))) (exp (sqrt x)))
14.0ms
(sqrt (- (* x x) (* 1 1)))

prune252.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 27.2b

localize22.0ms

Local error

Found 4 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

9.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
7.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
1.0ms
(cbrt (+ x 1))

series190.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

68.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
42.0ms
(cbrt (+ x 1))
41.0ms
(cbrt (+ 1 x))
39.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))

simplify1.3s

Counts
39 → 75
Calls

39 calls. Slowest were:

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

prune921.0ms

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 27.2b

localize13.0ms

Local error

Found 4 expressions with local error:

9.8b
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
0.3b
(cbrt (+ 1 x))
0.3b
(cbrt (sqrt (+ x 1)))
0.3b
(cbrt (sqrt (+ x 1)))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

15.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
1.0ms
(cbrt (sqrt (+ x 1)))
1.0ms
(cbrt (sqrt (+ x 1)))

series227.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

85.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
56.0ms
(cbrt (sqrt (+ x 1)))
51.0ms
(cbrt (+ 1 x))
35.0ms
(cbrt (sqrt (+ x 1)))

simplify1.2s

Counts
34 → 69
Calls

34 calls. Slowest were:

207.0ms
(- (+ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) (* 1/6 (/ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) x))) (* 5/72 (/ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) (pow x 2))))
203.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))))
178.0ms
(- (+ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) (* 1/6 (/ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) x))) (* 5/72 (/ (exp (* 1/6 (- (log -1) (log (/ -1 x))))) (pow x 2))))

prune1.0s

Pruning

22 alts after pruning (22 fresh and 0 done)

Merged error: 27.2b

localize18.0ms

Local error

Found 4 expressions with local error:

9.8b
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
6.9b
(log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x)))
0.4b
(exp (log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))))
0.3b
(cbrt (+ 1 x))

rewrite78.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

27.0ms
(exp (log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))))
25.0ms
(log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x)))
24.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))

series248.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

92.0ms
(log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x)))
63.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
52.0ms
(exp (log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))))
41.0ms
(cbrt (+ 1 x))

simplify954.0ms

Counts
34 → 68
Calls

34 calls. Slowest were:

218.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))))
173.0ms
(exp (log (- (pow (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) 3) (pow (sqrt x) 3))))
144.0ms
(log (- (pow (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) 3) (pow (sqrt x) 3)))

prune985.0ms

Pruning

34 alts after pruning (34 fresh and 0 done)

Merged error: 27.2b

regimes360.0ms

Accuracy

0% (0.7b remaining)

Error of 29.6b against oracle of 28.8b and baseline of 29.6b

bsearch4.0ms

end0.0ms

sample2.6s

Algorithm
intervals