Average Error: 0.4 → 0.0
Time: 7.2s
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(e^{d} \cdot \left(e^{e} \cdot \left(\left(e^{b} \cdot e^{c}\right) \cdot e^{a}\right)\right)\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(e^{d} \cdot \left(e^{e} \cdot \left(\left(e^{b} \cdot e^{c}\right) \cdot e^{a}\right)\right)\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 e) (* (* (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(d) * (exp(e) * ((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. Taylor expanded around 0 0.3

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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