Average Error: 29.8 → 29.7
Time: 15.1s
Precision: 64
Internal Precision: 128
\[\sqrt{x + 1} - \sqrt{x}\]
\[(e^{\log_* (1 + \frac{\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]{x + 1}}\right) \cdot \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]{x + 1}}\right) - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x} + \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}\right| \cdot \sqrt{\sqrt[3]{x + 1}}})} - 1)^*\]

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 expm1-log1p-u29.7

    \[\leadsto \color{blue}{(e^{\log_* (1 + \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))} - 1)^*}\]
  10. Using strategy rm
  11. Applied flip--29.7

    \[\leadsto (e^{\log_* (1 + \color{blue}{\frac{\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}}\right) \cdot \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}}\right) - \sqrt{x} \cdot \sqrt{x}}{\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}}})} - 1)^*\]
  12. Final simplification29.7

    \[\leadsto (e^{\log_* (1 + \frac{\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]{x + 1}}\right) \cdot \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]{x + 1}}\right) - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x} + \left|\sqrt[3]{\sqrt[3]{x + 1} \cdot \left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right)}\right| \cdot \sqrt{\sqrt[3]{x + 1}}})} - 1)^*\]

Reproduce

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

sample51.0ms

Algorithm
intervals

simplify7.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 33.6b

localize21.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
Counts
2 → 57
Calls

2 calls. Slowest were:

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

series76.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify947.0ms

Counts
59 → 63
Calls

59 calls. Slowest were:

102.0ms
(- (+ (* 1/2 x) 1) (* 1/8 (pow x 2)))
43.0ms
(fma (sqrt (sqrt (+ x 1))) (sqrt (sqrt (+ x 1))) (- (* (sqrt (sqrt x)) (sqrt (sqrt x)))))
35.0ms
(sqrt (- (* x x) (* 1 1)))

prune504.0ms

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 32.9b

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 75
Calls

4 calls. Slowest were:

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

series183.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

67.0ms
(- (* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1)))) (sqrt x))
48.0ms
(cbrt (+ x 1))
37.0ms
(* (fabs (cbrt (+ 1 x))) (sqrt (cbrt (+ x 1))))
31.0ms
(cbrt (+ 1 x))

simplify2.1s

Counts
46 → 87
Calls

46 calls. Slowest were:

440.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))))
301.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))))
260.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))))

prune987.0ms

Pruning

17 alts after pruning (17 fresh and 0 done)

Merged error: 32.9b

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

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

series244.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

83.0ms
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
59.0ms
(cbrt (+ 1 x))
51.0ms
(cbrt (+ 1 x))
51.0ms
(cbrt (+ 1 x))

simplify1.4s

Counts
35 → 75
Calls

35 calls. Slowest were:

224.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))))
204.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))))
185.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.1s

Pruning

17 alts after pruning (17 fresh and 0 done)

Merged error: 32.9b

localize8.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.4b
(expm1 (log1p (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))))
0.3b
(cbrt (+ x 1))
0.3b
(cbrt (+ 1 x))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 59
Calls

4 calls. Slowest were:

8.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 (+ x 1))

series312.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

169.0ms
(expm1 (log1p (- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))))
80.0ms
(- (* (fabs (cbrt (* (* (cbrt (+ 1 x)) (cbrt (+ 1 x))) (cbrt (+ 1 x))))) (sqrt (cbrt (+ x 1)))) (sqrt x))
32.0ms
(cbrt (+ 1 x))
31.0ms
(cbrt (+ x 1))

simplify1.0s

Counts
31 → 71
Calls

31 calls. Slowest were:

241.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))))
213.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 x) 1) (* 1/9 (pow x 2)))

prune1.1s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 32.9b

regimes273.0ms

Accuracy

0% (0.7b remaining)

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

bsearch2.0ms

end0.0ms

sample2.4s

Algorithm
intervals