Average Error: 0.4 → 0.3
Time: 12.7s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\log \left(e^{\left(e + b\right) + \left(\left(c + d\right) + a\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 add-sqr-sqrt0.6

    \[\leadsto \left(\left(\color{blue}{\sqrt{e + d} \cdot \sqrt{e + d}} + c\right) + b\right) + a\]
  4. Applied fma-def0.5

    \[\leadsto \left(\color{blue}{(\left(\sqrt{e + d}\right) \cdot \left(\sqrt{e + d}\right) + c)_*} + b\right) + a\]
  5. Using strategy rm
  6. Applied associate-+l+0.5

    \[\leadsto \color{blue}{(\left(\sqrt{e + d}\right) \cdot \left(\sqrt{e + d}\right) + c)_* + \left(b + a\right)}\]
  7. Simplified0.3

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

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

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

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

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

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

Reproduce

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

sample45.0ms

Algorithm
intervals

simplify171.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize24.0ms

Local error

Found 3 expressions with local error:

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

rewrite106.0ms

Algorithm
rewrite-expression-head
Counts
3 → 48
Calls

3 calls. Slowest were:

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

series80.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

38.0ms
(+ (+ (+ (+ e d) c) b) a)
25.0ms
(+ (+ (+ e d) c) b)
17.0ms
(+ (+ e d) c)

simplify252.0ms

Counts
17 → 57
Calls

17 calls. Slowest were:

54.0ms
(* (cbrt (+ (+ (+ e d) c) b)) (cbrt (+ (+ (+ e d) c) b)))
30.0ms
(sqrt (+ (+ (+ e d) c) b))
24.0ms
(* (cbrt (+ e d)) (cbrt (+ e d)))

prune574.0ms

Pruning

8 alts after pruning (8 fresh and 0 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.3b
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
0.3b
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
0.1b
(sqrt (+ e d))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

23.0ms
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
5.0ms
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
1.0ms
(sqrt (+ e d))

series460.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

190.0ms
(+ (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b) a)
163.0ms
(+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)
80.0ms
(fma (sqrt (+ e d)) (sqrt (+ e d)) c)
27.0ms
(sqrt (+ e d))

simplify284.0ms

Counts
24 → 70
Calls

24 calls. Slowest were:

61.0ms
(* (cbrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)) (cbrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b)))
60.0ms
(sqrt (+ (fma (sqrt (+ e d)) (sqrt (+ e d)) c) b))
29.0ms
(sqrt (- (* e e) (* d d)))

prune803.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0b

localize9.0ms

Local error

Found 2 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
2 → 39
Calls

2 calls. Slowest were:

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

series55.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

44.0ms
(+ (+ (+ d c) e) (+ b a))
10.0ms
(+ (+ d c) e)

simplify1.6s

Counts
21 → 45
Calls

21 calls. Slowest were:

325.0ms
(* (+ (* (+ d c) (+ d c)) (- (* e e) (* (+ d c) e))) (- b a))
229.0ms
(+ (* (- (* (+ d c) (+ d c)) (* e e)) (+ (* b b) (- (* a a) (* b a)))) (* (- (+ d c) e) (+ (pow b 3) (pow a 3))))
203.0ms
(* (exp (+ (+ d c) e)) (exp (+ b a)))

prune503.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

localize28.0ms

Local error

Found 4 expressions with local error:

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

rewrite58.0ms

Algorithm
rewrite-expression-head
Counts
4 → 71
Calls

4 calls. Slowest were:

23.0ms
(log (exp (+ (+ a (+ c d)) (+ e b))))
20.0ms
(exp (+ (+ a (+ c d)) (+ e b)))
12.0ms
(+ (+ a (+ c d)) (+ e b))

series139.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

45.0ms
(log (exp (+ (+ a (+ c d)) (+ e b))))
43.0ms
(exp (+ (+ a (+ c d)) (+ e b)))
34.0ms
(+ (+ a (+ c d)) (+ e b))
17.0ms
(+ a (+ c d))

simplify4.5s

Counts
40 → 83
Calls

40 calls. Slowest were:

646.0ms
(* (exp (+ a (+ c d))) (exp (+ e b)))
428.0ms
(* (+ (* a a) (- (* (+ c d) (+ c d)) (* a (+ c d)))) (- e b))
358.0ms
(* (- a (+ c d)) (- e b))

prune730.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes337.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