Average Error: 0.5 → 0.4
Time: 11.4s
Precision: 64
Internal Precision: 128
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\[\frac{\frac{-1}{8}}{x} - \left(\frac{1}{2} - x\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

    \[\sqrt{x - 1} \cdot \sqrt{x}\]
  2. Taylor expanded around inf 0.4

    \[\leadsto \color{blue}{x - \left(\frac{1}{8} \cdot \frac{1}{x} + \frac{1}{2}\right)}\]
  3. Simplified0.4

    \[\leadsto \color{blue}{\frac{\frac{-1}{8}}{x} - \left(\frac{1}{2} - x\right)}\]
  4. Final simplification0.4

    \[\leadsto \frac{\frac{-1}{8}}{x} - \left(\frac{1}{2} - x\right)\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (x)
  :name "sqrt times"
  (* (sqrt (- x 1)) (sqrt x)))

Details

Time bar (total: 6.3s)Debug log

start942.0ms

Algorithm
intervals

setup76.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize63.0ms

Local error

Found 1 expressions with local error:

0.4b
(* (sqrt (- x 1)) (sqrt x))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
1 → 26
Calls

1 calls. Slowest were:

18.0ms
(* (sqrt (- x 1)) (sqrt x))

series67.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

66.0ms
(* (sqrt (- x 1)) (sqrt x))

simplify505.0ms

Counts
18 → 29
Calls

18 calls. Slowest were:

280.0ms
(* (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))) (* (* (sqrt x) (sqrt x)) (sqrt x)))
79.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))
56.0ms
(* (sqrt (- (* x x) (* 1 1))) (sqrt x))

prune206.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize11.0ms

Local error

Found 1 expressions with local error:

0.0b
(- (/ -1/8 x) (- 1/2 x))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
1 → 37
Calls

1 calls. Slowest were:

8.0ms
(- (/ -1/8 x) (- 1/2 x))

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(- (/ -1/8 x) (- 1/2 x))

simplify3.1s

Counts
39 → 40
Calls

39 calls. Slowest were:

449.0ms
(- (* -1/8 (+ 1/2 x)) (* x (- (* 1/2 1/2) (* x x))))
209.0ms
(* x (+ (* 1/2 1/2) (+ (* x x) (* 1/2 x))))
160.0ms
(- (* -1/8 (+ (* 1/2 1/2) (+ (* x x) (* 1/2 x)))) (* x (- (pow 1/2 3) (pow x 3))))

prune385.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize5.0ms

Local error

Found 2 expressions with local error:

29.9b
(sqrt (* (- x 1) x))
0.0b
(* (- x 1) x)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 28
Calls

2 calls. Slowest were:

2.0ms
(* (- x 1) x)
1.0ms
(sqrt (* (- x 1) x))

series34.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

20.0ms
(* (- x 1) x)
14.0ms
(sqrt (* (- x 1) x))

simplify460.0ms

Counts
13 → 34
Calls

13 calls. Slowest were:

118.0ms
(* (- (* x x) (* 1 1)) x)
109.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))
98.0ms
(sqrt (* (- (* x x) (* 1 1)) x))

prune279.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes77.0ms

Accuracy

0% (0.4b remaining)

Error of 0.4b against oracle of 0.0b and baseline of 0.4b

bsearch1.0ms