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(\left(e^{e} \cdot e^{d}\right) \cdot \left(e^{b} \cdot e^{c}\right)\right) \cdot e^{a}\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(\left(\left(e^{e} \cdot e^{d}\right) \cdot \left(e^{b} \cdot e^{c}\right)\right) \cdot e^{a}\right)
(FPCore (a b c d e) :precision binary64 (+ (+ (+ (+ e d) c) b) a))
(FPCore (a b c d e)
 :precision binary64
 (log (* (* (* (exp e) (exp d)) (* (exp b) (exp c))) (exp a))))
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(e) * exp(d)) * (exp(b) * exp(c))) * exp(a));
}

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_27390.3

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2021032 
(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))