Average Error: 29.8 → 29.7
Time: 13.6s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[e^{\log \left(\left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}\right| \cdot \sqrt{\sqrt[3]{\sqrt[3]{x + 1}} \cdot \left(\sqrt[3]{\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.8
Target0.2
Herbie29.7
\[\frac{1}{\sqrt{x + 1} + \sqrt{x}}\]

Derivation

  1. Initial program 29.8

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

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

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

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

    \[\leadsto \left|\color{blue}{\sqrt[3]{\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. Using strategy rm
  9. Applied add-exp-log29.7

    \[\leadsto \color{blue}{e^{\log \left(\left|\sqrt[3]{\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}\right)}}\]
  10. Using strategy rm
  11. Applied add-cube-cbrt29.7

    \[\leadsto e^{\log \left(\left|\sqrt[3]{\left(\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}\right) \cdot \sqrt[3]{1 + x}}\right| \cdot \sqrt{\color{blue}{\left(\sqrt[3]{\sqrt[3]{x + 1}} \cdot \sqrt[3]{\sqrt[3]{x + 1}}\right) \cdot \sqrt[3]{\sqrt[3]{x + 1}}}} - \sqrt{x}\right)}\]
  12. Final simplification29.7

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

Reproduce

herbie shell --seed 2019007 
(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.1s)Debug log

sample70.0ms

Algorithm
intervals

simplify4.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 33.6b

localize37.0ms

Local error

Found 2 expressions with local error:

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
2 → 29
Calls

2 calls. Slowest were:

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

series54.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

37.0ms
(- (sqrt (+ x 1)) (sqrt x))
18.0ms
(sqrt (+ x 1))

simplify159.0ms

Counts
18 → 35
Calls

18 calls. Slowest were:

74.0ms
(- (+ (* 1/2 x) 1) (* 1/8 (pow x 2)))
27.0ms
(sqrt (- (* x x) (* 1 1)))
13.0ms
(/ (exp (sqrt (+ x 1))) (exp (sqrt x)))

prune295.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 33.0b

localize35.0ms

Local error

Found 4 expressions with local error:

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

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

series223.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

90.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
51.0ms
(cbrt (+ 1 x))
46.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
36.0ms
(cbrt (+ x 1))

simplify1.2s

Counts
39 → 75
Calls

39 calls. Slowest were:

189.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))))
179.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))))
178.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))))

prune962.0ms

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 32.9b

localize31.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 51
Calls

4 calls. Slowest were:

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

series240.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

88.0ms
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
51.0ms
(cbrt (+ 1 x))
50.0ms
(cbrt (+ 1 x))
50.0ms
(cbrt (+ 1 x))

simplify920.0ms

Counts
28 → 63
Calls

28 calls. Slowest were:

173.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))))
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))))
133.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))))

prune882.0ms

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 32.9b

localize17.0ms

Local error

Found 4 expressions with local error:

14.8b
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
3.5b
(log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x)))
0.5b
(exp (log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))))
0.3b
(cbrt (+ x 1))

rewrite54.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

20.0ms
(exp (log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))))
18.0ms
(log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x)))
13.0ms
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))

series256.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

88.0ms
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
79.0ms
(log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x)))
52.0ms
(exp (log (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))))
37.0ms
(cbrt (+ x 1))

simplify823.0ms

Counts
34 → 68
Calls

34 calls. Slowest were:

210.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))))
106.0ms
(exp (log (- (pow (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) 3) (pow (sqrt x) 3))))
80.0ms
(log (- (pow (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) 3) (pow (sqrt x) 3)))

prune952.0ms

Pruning

25 alts after pruning (25 fresh and 0 done)

Merged error: 32.9b

regimes407.0ms

Accuracy

0% (0.8b remaining)

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

bsearch4.0ms

end0.0ms

sample2.4s

Algorithm
intervals