Average Error: 0.5 → 0.4
Time: 7.5s
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 2018365 
(FPCore (x)
  :name "sqrt times"
  (* (sqrt (- x 1)) (sqrt x)))

Details

Time bar (total: 2.5s)Debug log

start333.0ms

Algorithm
intervals

setup20.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.5b

localize12.0ms

Local error

Found 2 expressions with local error:

0.5b
(* (sqrt (+ x -1)) (sqrt x))
0.0b
(sqrt (+ x -1))

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
2 → 38
Calls

2 calls. Slowest were:

27.0ms
(* (sqrt (+ x -1)) (sqrt x))
1.0ms
(sqrt (+ x -1))

series68.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

52.0ms
(* (sqrt (+ x -1)) (sqrt x))
16.0ms
(sqrt (+ x -1))

simplify1.1s

Counts
27 → 44
Calls

27 calls. Slowest were:

525.0ms
(- (+ (* 1/2 (/ x (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 2) (pow (sqrt -1) 3))))
288.0ms
(* (* (* (sqrt (+ x -1)) (sqrt (+ x -1))) (sqrt (+ x -1))) (* (* (sqrt x) (sqrt x)) (sqrt x)))
122.0ms
(* (sqrt (- (* x x) (* -1 -1))) (sqrt x))

prune385.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize15.0ms

Local error

Found 0 expressions with local error:

rewrite0.0ms

Algorithm
rewrite-expression-head
Counts
0 → 0
Calls

0 calls. Slowest were:

series0.0ms

Counts
0 → 0
Calls

0 calls. Slowest were:

simplify0.0ms

Counts
0 → 0
Calls

0 calls. Slowest were:

prune3.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize5.0ms

Local error

Found 1 expressions with local error:

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

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

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

series14.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify343.0ms

Counts
6 → 14
Calls

6 calls. Slowest were:

204.0ms
(sqrt (* (- (* x x) (* -1 -1)) x))
65.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))
39.0ms
(- (+ (* 1/8 (/ 1 x)) 1/2) x)

prune109.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes20.0ms

Accuracy

0% (0.4b remaining)

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

bsearch1.0ms