Average Error: 0.0 → 0.0
Time: 3.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. Simplified0.0

    \[\leadsto \color{blue}{(\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 2019016 +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.1s)Debug log

sample29.0ms

Algorithm
intervals
Results
256×(pre true 80)
256×(body real 80)

simplify109.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
109.0ms
(+ (* x (* x x)) (* x x))

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 1 expressions with local error:

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

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
log1p-expm1-u
fma-udef
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
pow1
expm1-log1p-u
add-sqr-sqrt
Counts
1 → 10
Calls
1 calls:
Slowest
0.0ms
(fma (* x x) x (* x x))

series38.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
38.0ms
(fma (* x x) x (* x x))

simplify24.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
10.0ms
(+ (pow x 3) (pow x 2))
7.0ms
(+ (pow x 3) (pow x 2))
7.0ms
(+ (pow x 3) (pow x 2))

prune73.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize6.0ms

Local error

Found 4 expressions with local error:

32.5b
(sqrt (fma (* x x) x (* x x)))
32.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))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
12×sqrt-prod
12×add-sqr-sqrt
10×add-cube-cbrt
10×*-un-lft-identity
pow1
add-exp-log
associate-*l*
associate-*r*
pow1/2
add-cbrt-cube
add-log-exp
log1p-expm1-u
expm1-log1p-u
pow-prod-up
pow-prod-down
rem-sqrt-square
fma-udef
cbrt-unprod
*-commutative
prod-exp
sqrt-unprod
pow-plus
rem-square-sqrt
pow2
Counts
4 → 70
Calls
4 calls:
Slowest
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)))
0.0ms
(fma (* x x) x (* x x))

series111.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
41.0ms
(fma (* x x) x (* x x))
34.0ms
(* (sqrt (fma (* x x) x (* x x))) (sqrt (fma (* x x) x (* x x))))
19.0ms
(sqrt (fma (* x x) x (* x x)))
18.0ms
(sqrt (fma (* x x) x (* x x)))

simplify1.5s

Counts
42 → 82
Calls
42 calls:
Slowest
306.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
286.0ms
(- (+ x (* 1/2 (pow x 2))) (* 1/8 (pow x 3)))
179.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))
167.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))
151.0ms
(* (* (* (sqrt (fma (* x x) x (* x x))) (sqrt (fma (* x x) x (* x x)))) (sqrt (fma (* x x) x (* x x)))) (* (* (sqrt (fma (* x x) x (* x x))) (sqrt (fma (* x x) x (* x x)))) (sqrt (fma (* x x) x (* x x)))))

prune602.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes17.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample612.0ms

Algorithm
intervals
Results
8000×(pre true 80)
8000×(body real 80)