Average Error: 29.7 → 29.6
Time: 17.5s
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 +o rules:numerics
(FPCore (x)
  :name "2sqrt (example 3.1)"

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

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

Details

Time bar (total: 13.8s)Debug log

sample51.0ms

Algorithm
intervals

simplify4.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 27.8b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 57
Calls

2 calls. Slowest were:

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

series40.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify926.0ms

Counts
59 → 63
Calls

59 calls. Slowest were:

74.0ms
(- (+ (* 1/2 x) 1) (* 1/8 (pow x 2)))
42.0ms
(fma (sqrt (sqrt (+ x 1))) (sqrt (sqrt (+ x 1))) (- (* (sqrt (sqrt x)) (sqrt (sqrt x)))))
34.0ms
(fma (sqrt (sqrt (+ x 1))) (sqrt (sqrt (+ x 1))) (- (* (sqrt (sqrt x)) (sqrt (sqrt x)))))

prune611.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 27.2b

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

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

series207.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

69.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
59.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
47.0ms
(cbrt (+ x 1))
32.0ms
(cbrt (+ 1 x))

simplify2.1s

Counts
46 → 87
Calls

46 calls. Slowest were:

406.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))))
331.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))))
223.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))))

prune1.3s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 27.2b

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

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

series189.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

65.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
48.0ms
(cbrt (sqrt (+ x 1)))
44.0ms
(cbrt (sqrt (+ x 1)))
32.0ms
(cbrt (+ 1 x))

simplify1.5s

Counts
41 → 81
Calls

41 calls. Slowest were:

269.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))))
230.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))))
200.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.2s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 27.2b

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

rewrite86.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

34.0ms
(exp (log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))))
29.0ms
(log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x)))
22.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))

series301.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

102.0ms
(log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x)))
84.0ms
(exp (log (- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))))
59.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) (sqrt x))
56.0ms
(cbrt (+ 1 x))

simplify1.0s

Counts
41 → 80
Calls

41 calls. Slowest were:

233.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))))
134.0ms
(log (- (pow (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) 3) (pow (sqrt x) 3)))
119.0ms
(exp (log (- (pow (* (fabs (cbrt (+ 1 x))) (sqrt (* (cbrt (sqrt (+ x 1))) (cbrt (sqrt (+ x 1)))))) 3) (pow (sqrt x) 3))))

prune1.3s

Pruning

24 alts after pruning (24 fresh and 0 done)

Merged error: 27.2b

regimes201.0ms

Accuracy

0% (0.7b remaining)

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

bsearch2.0ms

end0.0ms

sample2.6s

Algorithm
intervals