Average Error: 0.5 → 0.4
Time: 7.7s
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 2018360 +o rules:numerics
(FPCore (x)
  :name "sqrt times"
  (* (sqrt (- x 1)) (sqrt x)))

Details

Time bar (total: 2.3s)Debug log

start235.0ms

Algorithm
intervals

setup39.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.5b

localize24.0ms

Local error

Found 1 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
1 → 26
Calls

1 calls. Slowest were:

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

series472.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify490.0ms

Counts
18 → 29
Calls

18 calls. Slowest were:

233.0ms
(* (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))) (* (* (sqrt x) (sqrt x)) (sqrt x)))
85.0ms
(* (sqrt (- (* x x) (* 1 1))) (sqrt x))
65.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))

prune304.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize9.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

localize3.0ms

Local error

Found 1 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 26
Calls

1 calls. Slowest were:

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

series43.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify396.0ms

Counts
18 → 29
Calls

18 calls. Slowest were:

242.0ms
(* (* (* (sqrt x) (sqrt x)) (sqrt x)) (* (* (sqrt (- x 1)) (sqrt (- x 1))) (sqrt (- x 1))))
45.0ms
(- x (+ (* 1/8 (/ 1 x)) 1/2))
18.0ms
(sqrt (+ (* x x) (+ (* 1 1) (* x 1))))

prune251.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes26.0ms

Accuracy

0% (0.4b remaining)

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

bsearch2.0ms