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

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. Simplified0.0

    \[\leadsto \color{blue}{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.0

    \[\leadsto \color{blue}{\sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*} \cdot \sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*}}\]
  5. Using strategy rm
  6. Applied pow1/20.0

    \[\leadsto \sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*} \cdot \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}}\]
  7. Applied pow1/20.0

    \[\leadsto \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}} \cdot {\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}\]
  8. Applied pow-prod-up0.0

    \[\leadsto \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)}}\]
  9. Simplified0.0

    \[\leadsto {\color{blue}{\left((x \cdot x + x)_* \cdot x\right)}}^{\left(\frac{1}{2} + \frac{1}{2}\right)}\]
  10. Simplified0.0

    \[\leadsto {\left((x \cdot x + x)_* \cdot x\right)}^{\color{blue}{1}}\]
  11. Final simplification0.0

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

Reproduce

herbie shell --seed 2019007 +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: 3.4s)Debug log

sample32.0ms

Algorithm
intervals

simplify113.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

113.0ms
(+ (* x (* x x)) (* x x))

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 1 expressions with local error:

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

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 10
Calls

1 calls. Slowest were:

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

series58.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

58.0ms
(fma (* x x) x (* x x))

simplify20.0ms

Counts
3 → 13
Calls

3 calls. Slowest were:

7.0ms
(+ (pow x 3) (pow x 2))
7.0ms
(+ (pow x 3) (pow x 2))
6.0ms
(+ (pow x 3) (pow x 2))

prune62.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 4 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 70
Calls

4 calls. Slowest were:

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

series128.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

53.0ms
(fma (* x x) x (* x x))
37.0ms
(* (sqrt (fma (* x x) x (* x x))) (sqrt (fma (* x x) x (* x x))))
20.0ms
(sqrt (fma (* x x) x (* x x)))
17.0ms
(sqrt (fma (* x x) x (* x x)))

simplify1.5s

Counts
42 → 82
Calls

42 calls. Slowest were:

326.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
278.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
186.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))

prune609.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 1 expressions with local error:

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

3.0ms
(* (fma x x x) x)

series37.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

37.0ms
(* (fma x x x) x)

simplify46.0ms

Counts
5 → 16
Calls

5 calls. Slowest were:

11.0ms
(+ (pow x 3) (pow x 2))
11.0ms
(+ (pow x 3) (pow x 2))
11.0ms
(+ (pow x 3) (pow x 2))

prune140.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0.0b

regimes14.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample635.0ms

Algorithm
intervals