Average Error: 0.4 → 0.2
Time: 15.6s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\log \left(e^{e + \left(\left(a + c\right) + \left(b + d\right)\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.2
\[\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. Using strategy rm
  5. Applied associate-+l+0.3

    \[\leadsto \color{blue}{\left(e + \left(d + c\right)\right)} + \left(b + a\right)\]
  6. Using strategy rm
  7. Applied add-log-exp0.3

    \[\leadsto \left(e + \left(d + c\right)\right) + \color{blue}{\log \left(e^{b + a}\right)}\]
  8. Applied add-log-exp0.3

    \[\leadsto \color{blue}{\log \left(e^{e + \left(d + c\right)}\right)} + \log \left(e^{b + a}\right)\]
  9. Applied sum-log0.3

    \[\leadsto \color{blue}{\log \left(e^{e + \left(d + c\right)} \cdot e^{b + a}\right)}\]
  10. Simplified0.2

    \[\leadsto \log \color{blue}{\left(e^{\left(\left(d + b\right) + \left(a + c\right)\right) + e}\right)}\]
  11. Final simplification0.2

    \[\leadsto \log \left(e^{e + \left(\left(a + c\right) + \left(b + d\right)\right)}\right)\]

Reproduce

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

sample41.0ms

Algorithm
intervals

simplify205.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize26.0ms

Local error

Found 3 expressions with local error:

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

rewrite95.0ms

Algorithm
rewrite-expression-head
Counts
3 → 48
Calls

3 calls. Slowest were:

66.0ms
(+ (+ (+ (+ e d) c) b) a)
23.0ms
(+ (+ (+ e d) c) b)
5.0ms
(+ (+ e d) c)

series118.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

64.0ms
(+ (+ (+ (+ e d) c) b) a)
34.0ms
(+ (+ (+ e d) c) b)
21.0ms
(+ (+ e d) c)

simplify160.0ms

Counts
17 → 57
Calls

17 calls. Slowest were:

53.0ms
(* (cbrt (+ (+ (+ e d) c) b)) (cbrt (+ (+ (+ e d) c) b)))
25.0ms
(sqrt (+ (+ (+ e d) c) b))
8.0ms
(* (cbrt (+ (+ e d) c)) (cbrt (+ (+ e d) c)))

prune592.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite32.0ms

Algorithm
rewrite-expression-head
Counts
2 → 39
Calls

2 calls. Slowest were:

26.0ms
(+ (+ (+ e d) c) (+ b a))
5.0ms
(+ (+ e d) c)

series83.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

63.0ms
(+ (+ (+ e d) c) (+ b a))
21.0ms
(+ (+ e d) c)

simplify1.7s

Counts
21 → 45
Calls

21 calls. Slowest were:

308.0ms
(* (+ (* (+ e d) (+ e d)) (- (* c c) (* (+ e d) c))) (- b a))
224.0ms
(+ (* (- (* (+ e d) (+ e d)) (* c c)) (+ (* b b) (- (* a a) (* b a)))) (* (- (+ e d) c) (+ (pow b 3) (pow a 3))))
222.0ms
(* (exp (+ (+ e d) c)) (exp (+ b a)))

prune487.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0b

localize7.0ms

Local error

Found 2 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

8.0ms
(+ (+ e (+ d c)) (+ b a))
1.0ms
(+ e (+ d c))

series63.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

51.0ms
(+ (+ e (+ d c)) (+ b a))
11.0ms
(+ e (+ d c))

simplify2.6s

Counts
18 → 42
Calls

18 calls. Slowest were:

797.0ms
(* (- e (+ d c)) (- b a))
390.0ms
(* (+ (* e e) (- (* (+ d c) (+ d c)) (* e (+ d c)))) (- b a))
315.0ms
(* (- e (+ d c)) (+ (* b b) (- (* a a) (* b a))))

prune495.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

3.4b
(exp (+ (+ (+ d b) (+ a c)) e))
0.2b
(+ (+ (+ d b) (+ a c)) e)
0.2b
(+ (+ d b) (+ a c))
0.0b
(log (exp (+ (+ (+ d b) (+ a c)) e)))

rewrite162.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

78.0ms
(log (exp (+ (+ (+ d b) (+ a c)) e)))
56.0ms
(exp (+ (+ (+ d b) (+ a c)) e))
20.0ms
(+ (+ (+ d b) (+ a c)) e)

series171.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

56.0ms
(exp (+ (+ (+ d b) (+ a c)) e))
45.0ms
(+ (+ (+ d b) (+ a c)) e)
43.0ms
(log (exp (+ (+ (+ d b) (+ a c)) e)))
27.0ms
(+ (+ d b) (+ a c))

simplify4.7s

Counts
40 → 84
Calls

40 calls. Slowest were:

536.0ms
(+ (* (+ (pow d 3) (pow b 3)) (- a c)) (* (+ (* d d) (- (* b b) (* d b))) (- (* a a) (* c c))))
520.0ms
(+ (* (- (* d d) (* b b)) (- a c)) (* (- d b) (- (* a a) (* c c))))
489.0ms
(* (+ (* d d) (- (* b b) (* d b))) (+ (* a a) (- (* c c) (* a c))))

prune1.1s

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

regimes353.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample1.3s

Algorithm
intervals