Average Error: 0.4 → 0.3
Time: 8.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\]
\[e + \left(\left(c + d\right) + \left(b + a\right)\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
e + \left(\left(c + d\right) + \left(b + a\right)\right)
double f(double a, double b, double c, double d, double e) {
        double r79585 = e;
        double r79586 = d;
        double r79587 = r79585 + r79586;
        double r79588 = c;
        double r79589 = r79587 + r79588;
        double r79590 = b;
        double r79591 = r79589 + r79590;
        double r79592 = a;
        double r79593 = r79591 + r79592;
        return r79593;
}

double f(double a, double b, double c, double d, double e) {
        double r79594 = e;
        double r79595 = c;
        double r79596 = d;
        double r79597 = r79595 + r79596;
        double r79598 = b;
        double r79599 = a;
        double r79600 = r79598 + r79599;
        double r79601 = r79597 + r79600;
        double r79602 = r79594 + r79601;
        return r79602;
}

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(d + c\right) + \left(\left(a + e\right) + b\right)\right)}\]
  8. Using strategy rm
  9. Applied associate-+l+0.3

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(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))