Average Error: 0.4 → 0.0
Time: 8.6s
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(\left(e^{e} \cdot e^{d}\right) \cdot e^{c}\right) \cdot e^{b}\right) \cdot e^{a}\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(\left(\left(\left(e^{e} \cdot e^{d}\right) \cdot e^{c}\right) \cdot e^{b}\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 c)) (exp b)) (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(c)) * exp(b)) * 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 add-log-exp_binary64_45500.4

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

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

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

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

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

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

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

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

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

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

Reproduce

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