Average Error: 0.4 → 0.2
Time: 11.7s
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\]
\[\log \left(e^{d + c}\right) + \left(e + \left(a + b\right)\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(e^{d + c}\right) + \left(e + \left(a + b\right)\right)
double f(double a, double b, double c, double d, double e) {
        double r2091755 = e;
        double r2091756 = d;
        double r2091757 = r2091755 + r2091756;
        double r2091758 = c;
        double r2091759 = r2091757 + r2091758;
        double r2091760 = b;
        double r2091761 = r2091759 + r2091760;
        double r2091762 = a;
        double r2091763 = r2091761 + r2091762;
        return r2091763;
}

double f(double a, double b, double c, double d, double e) {
        double r2091764 = d;
        double r2091765 = c;
        double r2091766 = r2091764 + r2091765;
        double r2091767 = exp(r2091766);
        double r2091768 = log(r2091767);
        double r2091769 = e;
        double r2091770 = a;
        double r2091771 = b;
        double r2091772 = r2091770 + r2091771;
        double r2091773 = r2091769 + r2091772;
        double r2091774 = r2091768 + r2091773;
        return r2091774;
}

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. Taylor expanded around -inf 0.4

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

    \[\leadsto \left(\left(e + \left(c + d\right)\right) + \color{blue}{\log \left(e^{b}\right)}\right) + a\]
  5. Applied add-log-exp0.4

    \[\leadsto \left(\color{blue}{\log \left(e^{e + \left(c + d\right)}\right)} + \log \left(e^{b}\right)\right) + a\]
  6. Applied sum-log0.4

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

    \[\leadsto \log \color{blue}{\left(e^{\left(c + d\right) + \left(e + b\right)}\right)} + a\]
  8. Using strategy rm
  9. Applied exp-sum0.3

    \[\leadsto \log \color{blue}{\left(e^{c + d} \cdot e^{e + b}\right)} + a\]
  10. Applied log-prod0.3

    \[\leadsto \color{blue}{\left(\log \left(e^{c + d}\right) + \log \left(e^{e + b}\right)\right)} + a\]
  11. Applied associate-+l+0.3

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

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

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

Reproduce

herbie shell --seed 2019153 
(FPCore (a b c d e)
  :name "Expression 1, p15"
  :pre (<= 1 a 2 b 4 c 8 d 16 e 32)

  :herbie-target
  (+ (+ d (+ c (+ a b))) e)

  (+ (+ (+ (+ e d) c) b) a))