Average Error: 0.4 → 0.3
Time: 7.6s
Precision: 64
\[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\]
\[\left(a + e\right) + \left(\left(d + c\right) + b\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\left(a + e\right) + \left(\left(d + c\right) + b\right)
double f(double a, double b, double c, double d, double e) {
        double r156938 = e;
        double r156939 = d;
        double r156940 = r156938 + r156939;
        double r156941 = c;
        double r156942 = r156940 + r156941;
        double r156943 = b;
        double r156944 = r156942 + r156943;
        double r156945 = a;
        double r156946 = r156944 + r156945;
        return r156946;
}

double f(double a, double b, double c, double d, double e) {
        double r156947 = a;
        double r156948 = e;
        double r156949 = r156947 + r156948;
        double r156950 = d;
        double r156951 = c;
        double r156952 = r156950 + r156951;
        double r156953 = b;
        double r156954 = r156952 + r156953;
        double r156955 = r156949 + r156954;
        return r156955;
}

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.3

    \[\leadsto \color{blue}{\left(c + \left(d + e\right)\right) + \left(b + a\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.3

    \[\leadsto \left(c + \left(d + e\right)\right) + \color{blue}{1 \cdot \left(b + a\right)}\]
  5. Applied *-un-lft-identity0.3

    \[\leadsto \color{blue}{1 \cdot \left(c + \left(d + e\right)\right)} + 1 \cdot \left(b + a\right)\]
  6. Applied distribute-lft-out0.3

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

    \[\leadsto 1 \cdot \color{blue}{\left(\left(a + \left(b + e\right)\right) + \left(c + d\right)\right)}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.3

    \[\leadsto 1 \cdot \left(\left(a + \left(b + e\right)\right) + \color{blue}{1 \cdot \left(c + d\right)}\right)\]
  10. Applied *-un-lft-identity0.3

    \[\leadsto 1 \cdot \left(\color{blue}{1 \cdot \left(a + \left(b + e\right)\right)} + 1 \cdot \left(c + d\right)\right)\]
  11. Applied distribute-lft-out0.3

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

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (a b c d e)
  :name "Expression 1, p15"
  :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))