Average Error: 0.4 → 0.0
Time: 11.9s
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^{b} \cdot \left(e^{a} \cdot \left(\left(e^{e} \cdot e^{c}\right) \cdot e^{d}\right)\right)\right)\]
\left(\left(\left(e + d\right) + c\right) + b\right) + a
\log \left(e^{b} \cdot \left(e^{a} \cdot \left(\left(e^{e} \cdot e^{c}\right) \cdot e^{d}\right)\right)\right)
double f(double a, double b, double c, double d, double e) {
        double r1770021 = e;
        double r1770022 = d;
        double r1770023 = r1770021 + r1770022;
        double r1770024 = c;
        double r1770025 = r1770023 + r1770024;
        double r1770026 = b;
        double r1770027 = r1770025 + r1770026;
        double r1770028 = a;
        double r1770029 = r1770027 + r1770028;
        return r1770029;
}

double f(double a, double b, double c, double d, double e) {
        double r1770030 = b;
        double r1770031 = exp(r1770030);
        double r1770032 = a;
        double r1770033 = exp(r1770032);
        double r1770034 = e;
        double r1770035 = exp(r1770034);
        double r1770036 = c;
        double r1770037 = exp(r1770036);
        double r1770038 = r1770035 * r1770037;
        double r1770039 = d;
        double r1770040 = exp(r1770039);
        double r1770041 = r1770038 * r1770040;
        double r1770042 = r1770033 * r1770041;
        double r1770043 = r1770031 * r1770042;
        double r1770044 = log(r1770043);
        return r1770044;
}

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.0
\[\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(\left(e + \color{blue}{\log \left(e^{d}\right)}\right) + \log \left(e^{c}\right)\right) + \log \left(e^{b}\right)\right) + \log \left(e^{a}\right)\]
  7. 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) + \log \left(e^{a}\right)\]
  8. 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) + \log \left(e^{a}\right)\]
  9. 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) + \log \left(e^{a}\right)\]
  10. 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)} + \log \left(e^{a}\right)\]
  11. Applied sum-log0.0

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \log \left(e^{\color{blue}{\log \left(\left(e^{a} \cdot \left(e^{d} \cdot \left(e^{c} \cdot e^{e}\right)\right)\right) \cdot e^{b}\right)}}\right)\]
  23. Applied rem-exp-log0.0

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

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

Reproduce

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