Average Error: 0.0 → 0.0
Time: 6.1s
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 2019022 +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: 5.8s)Debug log

sample25.0ms

Algorithm
intervals
Results
12.0ms256×body80valid
6.0ms256×pre80true

simplify62.0ms

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 1 expressions with local error:

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

rewrite0.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))

series42.0ms

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

simplify28.0ms

Counts
3 → 13
Calls
3 calls:
Slowest
11.0ms
(+ (pow x 3) (pow x 2))
8.0ms
(+ (pow x 3) (pow x 2))
8.0ms
(+ (pow x 3) (pow x 2))

prune82.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 3 expressions with local error:

30.6b
(log (fma (* x x) x (* x x)))
2.8b
(exp (log (fma (* x x) x (* x x))))
0.0b
(fma (* x x) x (* x x))

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
log-prod
add-sqr-sqrt
pow1
add-exp-log
exp-prod
add-log-exp
log1p-expm1-u
exp-sum
add-cbrt-cube
expm1-log1p-u
log-pow
rem-exp-log
fma-udef
rem-log-exp
Counts
3 → 41
Calls
3 calls:
Slowest
3.0ms
(exp (log (fma (* x x) x (* x x))))
1.0ms
(log (fma (* x x) x (* x x)))
0.0ms
(fma (* x x) x (* x x))

series117.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
45.0ms
(exp (log (fma (* x x) x (* x x))))
38.0ms
(fma (* x x) x (* x x))
34.0ms
(log (fma (* x x) x (* x x)))

simplify600.0ms

Counts
21 → 50
Calls
21 calls:
Slowest
195.0ms
(- (+ (/ 1 x) (log -1)) (+ (* 3 (log (/ -1 x))) (* 1/2 (/ 1 (pow x 2)))))
128.0ms
(- (/ 1 x) (+ (* 3 (log (/ 1 x))) (* 1/2 (/ 1 (pow x 2)))))
72.0ms
(- (+ x (* 2 (log x))) (* 1/2 (pow x 2)))
33.0ms
(exp (* (cbrt (log (fma (* x x) x (* x x)))) (cbrt (log (fma (* x x) x (* x x))))))
31.0ms
(exp (sqrt (log (fma (* x x) x (* x x)))))

prune316.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 4 expressions with local error:

18.9b
(cbrt (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))))
0.1b
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))
0.1b
(* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x)))
0.0b
(fma (* x x) x (* x x))

rewrite27.0ms

Algorithm
rewrite-expression-head
Rules
23×pow1
11×add-exp-log
11×add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
pow-prod-up
associate-*r*
pow-plus
fma-udef
add-log-exp
log1p-expm1-u
cbrt-unprod
prod-exp
pow-prod-down
associate-*l*
expm1-log1p-u
pow2
*-commutative
pow3
distribute-lft-in
distribute-rgt-in
rem-cbrt-cube
pow1/3
cbrt-prod
Counts
4 → 75
Calls
4 calls:
Slowest
10.0ms
(* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x)))
8.0ms
(cbrt (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))))
8.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))
0.0ms
(fma (* x x) x (* x x))

series96.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
34.0ms
(fma (* x x) x (* x x))
32.0ms
(cbrt (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))))
15.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))
14.0ms
(* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x)))

simplify3.1s

Counts
49 → 87
Calls
49 calls:
Slowest
915.0ms
(* (* (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))) (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x)))) (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))))
523.0ms
(* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (* x x))
360.0ms
(* (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))) (* (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x))) (fma (* x x) x (* x x))))
179.0ms
(+ (log (* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))) (log (fma (* x x) x (* x x))))
156.0ms
(* (fma (* x x) x (* x x)) (fma (* x x) x (* x x)))

prune596.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0.0b

regimes23.0ms

Accuracy

0% (0.0b remaining)

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

bsearch0.0ms

end0.0ms

sample647.0ms

Algorithm
intervals
Results
372.0ms8000×body80valid
183.0ms8000×pre80true