Average Error: 0.4 → 0.2
Time: 6.6s
Precision: binary64
\[1 \le a \le 2 \le b \le 4 \le c \le 8 \le d \le 16 \le e \le 32\]
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[e + \left(d + \left(\left(b + c\right) + a\right)\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
e + \left(d + \left(\left(b + c\right) + a\right)\right)
double code(double a, double b, double c, double d, double e) {
	return ((double) (((double) (((double) (((double) (e + d)) + c)) + b)) + a));
}
double code(double a, double b, double c, double d, double e) {
	return ((double) (e + ((double) (d + ((double) (((double) (b + c)) + 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.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+0.3

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

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

    \[\leadsto \color{blue}{e + \left(d + \left(c + \left(b + a\right)\right)\right)}\]
  8. Using strategy rm
  9. Applied associate-+r+0.2

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

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

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

Reproduce

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