Average Error: 0.4 → 0.0
Time: 5.3s
Precision: binary64
\[1 \leq a \land a \leq 2 \land 2 \leq b \land b \leq 4 \land 4 \leq c \land c \leq 8 \land 8 \leq d \land d \leq 16 \land 16 \leq e \land e \leq 32\]
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\log \left(\left(e^{d} \cdot \left(e^{a} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right) \cdot e^{b}\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(\left(e^{d} \cdot \left(e^{a} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right) \cdot e^{b}\right)
(FPCore (a b c d e) :precision binary64 (+ (+ (+ (+ e d) c) b) a))
(FPCore (a b c d e)
 :precision binary64
 (log (* (* (exp d) (* (exp a) (* (exp c) (exp e)))) (exp b))))
double code(double a, double b, double c, double d, double e) {
	return (((e + d) + c) + b) + a;
}
double code(double a, double b, double c, double d, double e) {
	return log((exp(d) * (exp(a) * (exp(c) * exp(e)))) * exp(b));
}

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.0
\[\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+_binary64_30800.3

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

    \[\leadsto \left(\left(e + d\right) + c\right) + \color{blue}{\left(a + b\right)}\]
  5. Using strategy rm
  6. Applied associate-+r+_binary64_30790.4

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

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

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

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

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

    \[\leadsto \left(d + \left(a + \color{blue}{\log \left(e^{c} \cdot e^{e}\right)}\right)\right) + \log \left(e^{b}\right)\]
  13. Applied add-log-exp_binary64_31860.4

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

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

    \[\leadsto \left(\color{blue}{\log \left(e^{d}\right)} + \log \left(e^{a} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right) + \log \left(e^{b}\right)\]
  16. Applied sum-log_binary64_32380.2

    \[\leadsto \color{blue}{\log \left(e^{d} \cdot \left(e^{a} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right)} + \log \left(e^{b}\right)\]
  17. Applied sum-log_binary64_32380.0

    \[\leadsto \color{blue}{\log \left(\left(e^{d} \cdot \left(e^{a} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right) \cdot e^{b}\right)}\]
  18. Final simplification0.0

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

Reproduce

herbie shell --seed 2021015 
(FPCore (a b c d e)
  :name "Expression 1, p15"
  :precision binary64
  :pre (<= 1.0 a 2.0 b 4.0 c 8.0 d 16.0 e 32.0)

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

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