Average Error: 0.5 → 0.4
Time: 9.2s
Precision: 64
Internal Precision: 128
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\[\frac{\frac{-1}{8}}{x} + \left(x + \frac{-1}{2}\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. Initial simplification0.5

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

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

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

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

Reproduce

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

Details

Time bar (total: 4.0s)Debug log

start658.0ms

Algorithm
intervals

setup48.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize25.0ms

Local error

Found 1 expressions with local error:

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

rewrite36.0ms

Algorithm
rewrite-expression-head
Counts
1 → 24
Calls

1 calls. Slowest were:

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

series49.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

49.0ms
(* (sqrt (+ x -1)) (sqrt x))

simplify839.0ms

Counts
18 → 27
Calls

18 calls. Slowest were:

598.0ms
(* (* (* (sqrt (+ x -1)) (sqrt (+ x -1))) (sqrt (+ x -1))) (* (* (sqrt x) (sqrt x)) (sqrt x)))
99.0ms
(* (sqrt (- (* x x) (* -1 -1))) (sqrt x))
87.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))

prune283.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 1 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

6.0ms
(+ (/ -1/8 x) (+ x -1/2))

series16.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

16.0ms
(+ (/ -1/8 x) (+ x -1/2))

simplify866.0ms

Counts
9 → 18
Calls

9 calls. Slowest were:

232.0ms
(+ (* -1/8 (- x -1/2)) (* x (- (* x x) (* -1/2 -1/2))))
174.0ms
(+ (* -1/8 (+ (* x x) (- (* -1/2 -1/2) (* x -1/2)))) (* x (+ (pow x 3) (pow -1/2 3))))
148.0ms
(* x (+ (* x x) (- (* -1/2 -1/2) (* x -1/2))))

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
2 → 24
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)
13.0ms
(sqrt (* (+ x -1) x))

simplify653.0ms

Counts
13 → 30
Calls

13 calls. Slowest were:

252.0ms
(sqrt (* (- (* x x) (* -1 -1)) x))
209.0ms
(* (- (* x x) (* -1 -1)) x)
65.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))

prune294.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes40.0ms

Accuracy

0% (0.4b remaining)

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

bsearch1.0ms