Average Error: 0.4 → 0.3
Time: 3.1s
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\]
\[e + \left(d + \sqrt{c + \left(b + a\right)} \cdot \sqrt{c + \left(b + a\right)}\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
e + \left(d + \sqrt{c + \left(b + a\right)} \cdot \sqrt{c + \left(b + 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) sqrt(((double) (c + ((double) (b + a)))))) * ((double) sqrt(((double) (c + ((double) (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.3
\[\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. Simplified0.2

    \[\leadsto \color{blue}{e + \left(d + \left(c + \left(b + a\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.3

    \[\leadsto e + \left(d + \color{blue}{\sqrt{c + \left(b + a\right)} \cdot \sqrt{c + \left(b + a\right)}}\right)\]
  5. Final simplification0.3

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

Reproduce

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