Average Error: 0.4 → 0.2
Time: 2.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\]
\[\left(\left(a + \left(c + b\right)\right) + e\right) + d\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\left(\left(a + \left(c + b\right)\right) + e\right) + d
(FPCore (a b c d e) :precision binary64 (+ (+ (+ (+ e d) c) b) a))
(FPCore (a b c d e) :precision binary64 (+ (+ (+ a (+ c b)) e) d))
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 ((a + (c + b)) + e) + d;
}

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.2
\[\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_18290.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 associate-+l+_binary64_18290.3

    \[\leadsto \color{blue}{\left(e + d\right) + \left(\left(b + c\right) + a\right)}\]
  7. Using strategy rm
  8. Applied associate-+l+_binary64_18290.2

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

    \[\leadsto e + \color{blue}{\left(\left(a + \left(c + b\right)\right) + d\right)}\]
  10. Using strategy rm
  11. Applied associate-+r+_binary64_18280.2

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

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

    \[\leadsto \left(\left(a + \left(c + b\right)\right) + e\right) + d\]

Reproduce

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