Average Error: 0.4 → 0.2
Time: 13.6s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\log \left(e^{e + \left(\left(a + d\right) + \left(b + c\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. Taylor expanded around 0 0.3

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

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

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

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

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

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

Reproduce

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

sample33.0ms

Algorithm
intervals

simplify148.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize12.0ms

Local error

Found 3 expressions with local error:

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

rewrite65.0ms

Algorithm
rewrite-expression-head
Counts
3 → 48
Calls

3 calls. Slowest were:

50.0ms
(+ (+ (+ (+ e d) c) b) a)
12.0ms
(+ (+ (+ e d) c) b)
2.0ms
(+ (+ e d) c)

series92.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

44.0ms
(+ (+ (+ (+ e d) c) b) a)
29.0ms
(+ (+ (+ e d) c) b)
18.0ms
(+ (+ e d) c)

simplify143.0ms

Counts
17 → 57
Calls

17 calls. Slowest were:

33.0ms
(* (cbrt (+ (+ (+ e d) c) b)) (cbrt (+ (+ (+ e d) c) b)))
26.0ms
(sqrt (+ (+ (+ e d) c) b))
7.0ms
(* (cbrt (+ (+ e d) c)) (cbrt (+ (+ e d) c)))

prune403.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0b

localize5.0ms

Local error

Found 2 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
2 → 39
Calls

2 calls. Slowest were:

13.0ms
(+ (+ (+ e d) c) (+ b a))
2.0ms
(+ (+ e d) c)

series49.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

37.0ms
(+ (+ (+ e d) c) (+ b a))
12.0ms
(+ (+ e d) c)

simplify1.3s

Counts
21 → 45
Calls

21 calls. Slowest were:

242.0ms
(* (+ (* (+ e d) (+ e d)) (- (* c c) (* (+ e d) c))) (- b a))
173.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))))
170.0ms
(* (exp (+ (+ e d) c)) (exp (+ b a)))

prune334.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 (+ c d)) (+ b a))
0.2b
(+ e (+ c d))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

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

series48.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.6s

Counts
18 → 42
Calls

18 calls. Slowest were:

290.0ms
(* (+ (* e e) (- (* (+ c d) (+ c d)) (* e (+ c d)))) (- b a))
277.0ms
(* (- e (+ c d)) (- b a))
207.0ms
(* (- e (+ c d)) (+ (* b b) (- (* a a) (* b a))))

prune407.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite93.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

39.0ms
(log (exp (+ (+ (+ c b) (+ a d)) e)))
34.0ms
(exp (+ (+ (+ c b) (+ a d)) e))
15.0ms
(+ (+ (+ c b) (+ a d)) e)

series130.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

37.0ms
(+ (+ (+ c b) (+ a d)) e)
37.0ms
(exp (+ (+ (+ c b) (+ a d)) e))
36.0ms
(log (exp (+ (+ (+ c b) (+ a d)) e)))
20.0ms
(+ (+ c b) (+ a d))

simplify4.6s

Counts
40 → 84
Calls

40 calls. Slowest were:

507.0ms
(+ (* (+ (pow c 3) (pow b 3)) (- a d)) (* (+ (* c c) (- (* b b) (* c b))) (- (* a a) (* d d))))
480.0ms
(+ (* (- (* c c) (* b b)) (- a d)) (* (- c b) (- (* a a) (* d d))))
369.0ms
(* (+ (* c c) (- (* b b) (* c b))) (+ (* a a) (- (* d d) (* a d))))

prune1.5s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

regimes365.0ms

Accuracy

0% (0.2b remaining)

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

bsearch3.0ms

end0.0ms

sample1.2s

Algorithm
intervals