Average Error: 0.4 → 0.2
Time: 3.0s
Precision: binary64
\[\]
\[\]
\[\]
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) (c + b)) + 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
\[\]

Derivation

  1. Initial program 0.4

    \[\]
  2. Simplified0.2

    \[\leadsto \]
  3. Using strategy rm
  4. Applied associate-+r+0.2

    \[\leadsto \]
  5. Final simplification0.2

    \[\leadsto \]

Reproduce

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