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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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