Average Error: 0.4 → 0.3
Time: 11.0s
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\]
\[a + \log \left(e^{e + c} \cdot e^{b + d}\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
a + \log \left(e^{e + c} \cdot e^{b + d}\right)
double f(double a, double b, double c, double d, double e) {
        double r2042690 = e;
        double r2042691 = d;
        double r2042692 = r2042690 + r2042691;
        double r2042693 = c;
        double r2042694 = r2042692 + r2042693;
        double r2042695 = b;
        double r2042696 = r2042694 + r2042695;
        double r2042697 = a;
        double r2042698 = r2042696 + r2042697;
        return r2042698;
}

double f(double a, double b, double c, double d, double e) {
        double r2042699 = a;
        double r2042700 = e;
        double r2042701 = c;
        double r2042702 = r2042700 + r2042701;
        double r2042703 = exp(r2042702);
        double r2042704 = b;
        double r2042705 = d;
        double r2042706 = r2042704 + r2042705;
        double r2042707 = exp(r2042706);
        double r2042708 = r2042703 * r2042707;
        double r2042709 = log(r2042708);
        double r2042710 = r2042699 + r2042709;
        return r2042710;
}

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. Using strategy rm
  3. Applied add-log-exp0.4

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

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

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

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

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

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

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

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

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

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

Reproduce

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