Average Error: 0.4 → 0.3
Time: 26.6s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\left(b + a\right) + \left(c + \left(d + e\right)\right)\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Bits error versus e

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.4
Target0.2
Herbie0.3
\[\left(d + \left(c + \left(a + b\right)\right)\right) + e\]

Derivation

  1. Initial program 0.4

    \[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
  2. Using strategy rm
  3. Applied associate-+l+0.3

    \[\leadsto \color{blue}{\left(\left(e + d\right) + c\right) + \left(b + a\right)}\]
  4. Final simplification0.3

    \[\leadsto \left(b + a\right) + \left(c + \left(d + e\right)\right)\]

Reproduce

herbie shell --seed 2019016 +o rules:numerics
(FPCore (a b c d e)
  :name "Expression 1, p15"
  :pre (<= 1 a 2 b 4 c 8 d 16 e 32)

  :herbie-target
  (+ (+ d (+ c (+ a b))) e)

  (+ (+ (+ (+ e d) c) b) a))

Details

Time bar (total: 25.5s)Debug log

sample47.0ms

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

simplify235.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
235.0ms
(+ (+ (+ (+ e d) c) b) a)

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize23.0ms

Local error

Found 3 expressions with local error:

0.2b
(+ (+ (+ (+ e d) c) b) a)
0.2b
(+ (+ (+ e d) c) b)
0.1b
(+ (+ e d) c)

rewrite76.0ms

Algorithm
rewrite-expression-head
Rules
fma-def
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
log1p-expm1-u
flip-+
add-exp-log
add-cbrt-cube
flip3-+
associate-+l+
+-commutative
pow1
expm1-log1p-u
Counts
3 → 48
Calls
3 calls:
Slowest
61.0ms
(+ (+ (+ (+ e d) c) b) a)
12.0ms
(+ (+ (+ e d) c) b)
3.0ms
(+ (+ e d) c)

series80.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
38.0ms
(+ (+ (+ (+ e d) c) b) a)
32.0ms
(+ (+ (+ e d) c) b)
10.0ms
(+ (+ e d) c)

simplify185.0ms

Counts
17 → 57
Calls
17 calls:
Slowest
49.0ms
(sqrt (+ (+ (+ e d) c) b))
30.0ms
(* (cbrt (+ (+ (+ e d) c) b)) (cbrt (+ (+ (+ e d) c) b)))
12.0ms
(+ b (+ c d))
12.0ms
(+ b (+ c d))
11.0ms
(+ e (+ c d))

prune602.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 2 expressions with local error:

0.2b
(+ (+ (+ e d) c) (+ b a))
0.1b
(+ (+ e d) c)

rewrite31.0ms

Algorithm
rewrite-expression-head
Rules
flip-+
flip3-+
*-un-lft-identity
fma-def
add-log-exp
add-cube-cbrt
frac-add
add-sqr-sqrt
log1p-expm1-u
add-exp-log
add-cbrt-cube
associate-+l+
+-commutative
pow1
expm1-log1p-u
distribute-lft-out
sum-log
associate-+r+
Counts
2 → 39
Calls
2 calls:
Slowest
25.0ms
(+ (+ (+ e d) c) (+ b a))
5.0ms
(+ (+ e d) c)

series51.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
39.0ms
(+ (+ (+ e d) c) (+ b a))
12.0ms
(+ (+ e d) c)

simplify2.3s

Counts
21 → 45
Calls
21 calls:
Slowest
601.0ms
(+ (+ (+ e d) c) (+ b a))
386.0ms
(* (+ (* (+ e d) (+ e d)) (- (* c c) (* (+ e d) c))) (- b a))
266.0ms
(+ (* (- (* (+ e d) (+ e d)) (* c c)) (+ (* b b) (- (* a a) (* b a)))) (* (- (+ e d) c) (+ (pow b 3) (pow a 3))))
250.0ms
(* (exp (+ (+ e d) c)) (exp (+ b a)))
192.0ms
(+ (* (+ (pow (+ e d) 3) (pow c 3)) (+ (* b b) (- (* a a) (* b a)))) (* (+ (* (+ e d) (+ e d)) (- (* c c) (* (+ e d) c))) (+ (pow b 3) (pow a 3))))

prune501.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

localize26.0ms

Local error

Found 4 expressions with local error:

0.5b
(* (+ (+ e d) c) (+ (+ e d) c))
0.4b
(/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b))
0.3b
(- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))
0.2b
(+ (/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b)) a)

rewrite216.0ms

Algorithm
rewrite-expression-head
Rules
24×times-frac
23×add-cube-cbrt
23×*-un-lft-identity
23×add-sqr-sqrt
18×fma-def
pow1
difference-of-squares
add-exp-log
add-cbrt-cube
flip-+
flip3-+
add-log-exp
associate-/l*
flip--
log1p-expm1-u
associate-/r/
flip3--
frac-times
expm1-log1p-u
associate-*l*
associate-*r*
associate-/r*
associate-/l/
div-inv
associate-*r/
associate--l+
associate-*l/
div-sub
distribute-lft-in
distribute-rgt-in
cbrt-unprod
associate-+l-
pow-prod-up
*-commutative
prod-exp
pow-prod-down
prod-diff
div-exp
diff-log
fma-neg
pow-plus
frac-2neg
sub-neg
clear-num
+-commutative
cbrt-undiv
pow2
Counts
4 → 120
Calls
4 calls:
Slowest
145.0ms
(+ (/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b)) a)
37.0ms
(/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b))
23.0ms
(* (+ (+ e d) c) (+ (+ e d) c))
10.0ms
(- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))

series756.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
473.0ms
(+ (/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b)) a)
150.0ms
(- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))
100.0ms
(/ (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)) (- (+ (+ e d) c) b))
32.0ms
(* (+ (+ e d) c) (+ (+ e d) c))

simplify15.1s

Counts
100 → 132
Calls
100 calls:
Slowest
764.0ms
(* (- (* (+ e d) (+ e d)) (* c c)) (- (* (+ e d) (+ e d)) (* c c)))
695.0ms
(- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))
684.0ms
(/ (sqrt (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))) 1)
643.0ms
(/ (sqrt (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))) 1)
634.0ms
(/ (* (cbrt (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b))) (cbrt (- (* (+ (+ e d) c) (+ (+ e d) c)) (* b b)))) 1)

prune1.5s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0b

localize24.0ms

Local error

Found 4 expressions with local error:

0.4b
(fma (sqrt (+ e d)) (sqrt (+ e d)) c)
0.2b
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
0.2b
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
0.2b
(sqrt (+ e d))

rewrite23.0ms

Algorithm
rewrite-expression-head
Rules
add-sqr-sqrt
add-cube-cbrt
*-un-lft-identity
fma-def
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
pow1
expm1-log1p-u
flip-+
sqrt-prod
flip3-+
fma-udef
sqrt-div
associate-+l+
+-commutative
pow1/2
rem-sqrt-square
Counts
4 → 58
Calls
4 calls:
Slowest
19.0ms
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
3.0ms
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
1.0ms
(sqrt (+ e d))
0.0ms
(fma (sqrt (+ e d)) (sqrt (+ e d)) c)

series473.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
201.0ms
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
162.0ms
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
82.0ms
(fma (sqrt (+ e d)) (sqrt (+ e d)) c)
28.0ms
(sqrt (+ e d))

simplify202.0ms

Counts
24 → 70
Calls
24 calls:
Slowest
35.0ms
(sqrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b))
34.0ms
(sqrt (- (* e e) (* d d)))
31.0ms
(* (cbrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)) (cbrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)))
17.0ms
(* (cbrt (fma (sqrt (+ e d)) (sqrt (+ e d)) c)) (cbrt (fma (sqrt (+ e d)) (sqrt (+ e d)) c)))
15.0ms
(sqrt (fma (sqrt (+ e d)) (sqrt (+ e d)) c))

prune858.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0b

regimes653.0ms

Accuracy

0% (0.3b remaining)

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

bsearch1.0ms

end0.0ms

sample1.5s

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