Average Error: 0.4 → 0.3
Time: 39.6s
Precision: 64
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\log \left(e^{\left(\left(c + a\right) + b\right) + \left(e + d\right)}\right)\]
double f(double a, double b, double c, double d, double e) {
        double r16817717 = e;
        double r16817718 = d;
        double r16817719 = r16817717 + r16817718;
        double r16817720 = c;
        double r16817721 = r16817719 + r16817720;
        double r16817722 = b;
        double r16817723 = r16817721 + r16817722;
        double r16817724 = a;
        double r16817725 = r16817723 + r16817724;
        return r16817725;
}

double f(double a, double b, double c, double d, double e) {
        double r16817726 = c;
        double r16817727 = a;
        double r16817728 = r16817726 + r16817727;
        double r16817729 = b;
        double r16817730 = r16817728 + r16817729;
        double r16817731 = e;
        double r16817732 = d;
        double r16817733 = r16817731 + r16817732;
        double r16817734 = r16817730 + r16817733;
        double r16817735 = exp(r16817734);
        double r16817736 = log(r16817735);
        return r16817736;
}

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

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Bits error versus e

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) + b\right) + \color{blue}{\log \left(e^{a}\right)}\]
  4. Applied add-log-exp0.4

    \[\leadsto \left(\left(\left(e + d\right) + c\right) + \color{blue}{\log \left(e^{b}\right)}\right) + \log \left(e^{a}\right)\]
  5. 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) + \log \left(e^{a}\right)\]
  6. Applied add-log-exp0.4

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

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

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

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

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

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

Reproduce

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