Average Error: 0.0 → 0.0
Time: 10.4s
Precision: 64
Internal Precision: 128
\[x \cdot \left(x \cdot x\right) + x \cdot x\]
\[(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\]

Error

Bits error versus x

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\left(1.0 + x\right) \cdot x\right) \cdot x\]

Derivation

  1. Initial program 0.0

    \[x \cdot \left(x \cdot x\right) + x \cdot x\]
  2. Initial simplification0.0

    \[\leadsto (\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\]
  3. Final simplification0.0

    \[\leadsto (\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\]

Reproduce

herbie shell --seed 2018362 +o rules:numerics
(FPCore (x)
  :name "Expression 3, p15"
  :pre (<= 0 x 2)

  :herbie-target
  (* (* (+ 1.0 x) x) x)

  (+ (* x (* x x)) (* x x)))

Details

Time bar (total: 9.0s)Debug log

start33.0ms

Algorithm
intervals

setup126.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize7.0ms

Local error

Found 1 expressions with local error:

0.0b
(fma (* x x) x (* x x))

rewrite0.0ms

Algorithm
rewrite-expression-head
Counts
1 → 10
Calls

1 calls. Slowest were:

0.0ms
(fma (* x x) x (* x x))

series50.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

49.0ms
(fma (* x x) x (* x x))

simplify39.0ms

Counts
3 → 13
Calls

3 calls. Slowest were:

13.0ms
(+ (pow x 3) (pow x 2))
13.0ms
(+ (pow x 3) (pow x 2))
12.0ms
(+ (pow x 3) (pow x 2))

prune132.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 4 expressions with local error:

31.0b
(sqrt (fma (* x x) x (* x x)))
31.0b
(sqrt (fma (* x x) x (* x x)))
0.0b
(fma (* x x) x (* x x))
0.0b
(fma (* x x) x (* x x))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

2.0ms
(sqrt (fma (* x x) x (* x x)))
1.0ms
(sqrt (fma (* x x) x (* x x)))
0.0ms
(fma (* x x) x (* x x))

series151.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

57.0ms
(fma (* x x) x (* x x))
55.0ms
(fma (* x x) x (* x x))
21.0ms
(sqrt (fma (* x x) x (* x x)))
18.0ms
(sqrt (fma (* x x) x (* x x)))

simplify1.0s

Counts
20 → 60
Calls

20 calls. Slowest were:

455.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
329.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
42.0ms
(sqrt (* (cbrt (fma (* x x) x (* x x))) (cbrt (fma (* x x) x (* x x)))))

prune607.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize27.0ms

Local error

Found 4 expressions with local error:

31.0b
(sqrt (* (fma x x x) x))
31.0b
(sqrt (fma (* x x) x (* x x)))
31.0b
(sqrt (fma (* x x) x (* x x)))
0.5b
(* (sqrt (sqrt (* (fma x x x) x))) (sqrt (sqrt (fma (* x x) x (* x x)))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 70
Calls

4 calls. Slowest were:

7.0ms
(* (sqrt (sqrt (* (fma x x x) x))) (sqrt (sqrt (fma (* x x) x (* x x)))))
1.0ms
(sqrt (* (fma x x x) x))
1.0ms
(sqrt (fma (* x x) x (* x x)))

series207.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

110.0ms
(* (sqrt (sqrt (* (fma x x x) x))) (sqrt (sqrt (fma (* x x) x (* x x)))))
35.0ms
(sqrt (fma (* x x) x (* x x)))
32.0ms
(sqrt (fma (* x x) x (* x x)))
30.0ms
(sqrt (* (fma x x x) x))

simplify2.4s

Counts
41 → 82
Calls

41 calls. Slowest were:

450.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
424.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
337.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))

prune874.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize40.0ms

Local error

Found 4 expressions with local error:

32.1b
(cbrt (fma (* x x) x (* x x)))
32.1b
(cbrt (fma (* x x) x (* x x)))
32.1b
(cbrt (* x (fma x x x)))
31.0b
(sqrt (* (fma x x x) x))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

3.0ms
(sqrt (* (fma x x x) x))
2.0ms
(cbrt (* x (fma x x x)))
1.0ms
(cbrt (fma (* x x) x (* x x)))

series205.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

69.0ms
(cbrt (* x (fma x x x)))
51.0ms
(cbrt (fma (* x x) x (* x x)))
50.0ms
(cbrt (fma (* x x) x (* x x)))
35.0ms
(sqrt (* (fma x x x) x))

simplify1.9s

Counts
20 → 60
Calls

20 calls. Slowest were:

396.0ms
(- (+ (* 1/3 (/ (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x)))))) x)) (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x))))))) (* 1/9 (/ (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x)))))) (pow x 2))))
346.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
320.0ms
(- (+ (* 1/3 (/ (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x)))))) x)) (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x))))))) (* 1/9 (/ (exp (* 1/3 (- (log -1) (* 3 (log (/ -1 x)))))) (pow x 2))))

prune1.2s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

regimes52.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms