Average Error: 0.4 → 0.3
Time: 8.8s
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 2019022 +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: 8.1s)Debug log

sample31.0ms

Algorithm
intervals
Results
11.0ms256×pre80true
9.0ms256×body80valid

simplify152.0ms

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

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize11.0ms

Local error

Found 3 expressions with local error:

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

rewrite83.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
66.0ms
(+ (+ (+ (+ e d) c) b) a)
13.0ms
(+ (+ (+ e d) c) b)
3.0ms
(+ (+ e d) c)

series85.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
47.0ms
(+ (+ (+ (+ e d) c) b) a)
27.0ms
(+ (+ (+ e d) c) b)
11.0ms
(+ (+ e d) c)

simplify174.0ms

Counts
17 → 57
Calls
17 calls:
Slowest
37.0ms
(* (cbrt (+ (+ (+ e d) c) b)) (cbrt (+ (+ (+ e d) c) b)))
31.0ms
(sqrt (+ (+ (+ e d) c) b))
11.0ms
(* (cbrt (+ (+ e d) c)) (cbrt (+ (+ e d) c)))
10.0ms
(sqrt (+ (+ e d) c))
9.0ms
(+ a (+ b c))

prune442.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize5.0ms

Local error

Found 2 expressions with local error:

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

rewrite20.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
17.0ms
(+ (+ (+ e d) c) (+ b a))
2.0ms
(+ (+ e d) c)

series48.0ms

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

simplify1.6s

Counts
21 → 45
Calls
21 calls:
Slowest
311.0ms
(* (+ (* (+ e d) (+ e d)) (- (* c c) (* (+ e d) c))) (- b a))
224.0ms
(* (exp (+ (+ e d) c)) (exp (+ b a)))
205.0ms
(+ (* (- (* (+ e d) (+ e d)) (* c c)) (+ (* b b) (- (* a a) (* b a)))) (* (- (+ e d) c) (+ (pow b 3) (pow a 3))))
182.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))))
144.0ms
(+ (+ (+ e d) c) (+ b a))

prune395.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize7.0ms

Local error

Found 2 expressions with local error:

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

rewrite24.0ms

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

series92.0ms

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

simplify2.1s

Counts
21 → 46
Calls
21 calls:
Slowest
460.0ms
(+ (* (+ (pow e 3) (pow d 3)) (- c b)) (* (+ (* e e) (- (* d d) (* e d))) (- (* c c) (* b b))))
457.0ms
(+ (* (- (* e e) (* d d)) (- c b)) (* (- e d) (- (* c c) (* b b))))
415.0ms
(* (+ (* e e) (- (* d d) (* e d))) (+ (* c c) (- (* b b) (* c b))))
185.0ms
(* (- e d) (+ (* c c) (- (* b b) (* c b))))
116.0ms
(* (+ (* e e) (- (* d d) (* e d))) (- c b))

prune408.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

localize9.0ms

Local error

Found 3 expressions with local error:

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

rewrite31.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-+
+-commutative
pow1
expm1-log1p-u
associate-+l+
associate-+r+
Counts
3 → 45
Calls
3 calls:
Slowest
25.0ms
(+ (+ (+ e (+ c d)) b) a)
4.0ms
(+ (+ e (+ c d)) b)
1.0ms
(+ e (+ c d))

series87.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
49.0ms
(+ (+ (+ e (+ c d)) b) a)
22.0ms
(+ (+ e (+ c d)) b)
15.0ms
(+ e (+ c d))

simplify194.0ms

Counts
14 → 54
Calls
14 calls:
Slowest
48.0ms
(* (cbrt (+ (+ e (+ c d)) b)) (cbrt (+ (+ e (+ c d)) b)))
33.0ms
(sqrt (+ (+ e (+ c d)) b))
12.0ms
(* (cbrt (+ e (+ c d))) (cbrt (+ e (+ c d))))
12.0ms
(sqrt (+ e (+ c d)))
10.0ms
(+ e (+ c d))

prune432.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes495.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.1s

Algorithm
intervals
Results
530.0ms8000×pre80true
418.0ms8000×body80valid