Average Error: 10.4 → 1.5
Time: 44.0s
Precision: 64
\[\left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \left(A \cdot \left(d - b \cdot b\right) - \left(2 \cdot B\right) \cdot c\right)\]
\[\left(\left(\left(-2 \cdot A\right) \cdot \left(B \cdot c\right) - \left(A \cdot b\right) \cdot \left(A \cdot b\right)\right) + A \cdot \left(d \cdot A\right)\right) + \left(\left(B + D\right) \cdot \left(B - D\right) + \left(b \cdot \left(2 \cdot A\right) - a \cdot B\right) \cdot \left(a \cdot B\right)\right)\]
\left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \left(A \cdot \left(d - b \cdot b\right) - \left(2 \cdot B\right) \cdot c\right)
\left(\left(\left(-2 \cdot A\right) \cdot \left(B \cdot c\right) - \left(A \cdot b\right) \cdot \left(A \cdot b\right)\right) + A \cdot \left(d \cdot A\right)\right) + \left(\left(B + D\right) \cdot \left(B - D\right) + \left(b \cdot \left(2 \cdot A\right) - a \cdot B\right) \cdot \left(a \cdot B\right)\right)
double f(double B, double D, double a, double A, double b, double d, double c) {
        double r17898888 = B;
        double r17898889 = D;
        double r17898890 = r17898888 + r17898889;
        double r17898891 = r17898888 - r17898889;
        double r17898892 = r17898890 * r17898891;
        double r17898893 = a;
        double r17898894 = r17898893 * r17898888;
        double r17898895 = 2.0;
        double r17898896 = A;
        double r17898897 = r17898895 * r17898896;
        double r17898898 = b;
        double r17898899 = r17898897 * r17898898;
        double r17898900 = r17898899 - r17898894;
        double r17898901 = r17898894 * r17898900;
        double r17898902 = r17898892 + r17898901;
        double r17898903 = d;
        double r17898904 = r17898898 * r17898898;
        double r17898905 = r17898903 - r17898904;
        double r17898906 = r17898896 * r17898905;
        double r17898907 = r17898895 * r17898888;
        double r17898908 = c;
        double r17898909 = r17898907 * r17898908;
        double r17898910 = r17898906 - r17898909;
        double r17898911 = r17898896 * r17898910;
        double r17898912 = r17898902 + r17898911;
        return r17898912;
}

double f(double B, double D, double a, double A, double b, double d, double c) {
        double r17898913 = -2.0;
        double r17898914 = A;
        double r17898915 = r17898913 * r17898914;
        double r17898916 = B;
        double r17898917 = c;
        double r17898918 = r17898916 * r17898917;
        double r17898919 = r17898915 * r17898918;
        double r17898920 = b;
        double r17898921 = r17898914 * r17898920;
        double r17898922 = r17898921 * r17898921;
        double r17898923 = r17898919 - r17898922;
        double r17898924 = d;
        double r17898925 = r17898924 * r17898914;
        double r17898926 = r17898914 * r17898925;
        double r17898927 = r17898923 + r17898926;
        double r17898928 = D;
        double r17898929 = r17898916 + r17898928;
        double r17898930 = r17898916 - r17898928;
        double r17898931 = r17898929 * r17898930;
        double r17898932 = 2.0;
        double r17898933 = r17898932 * r17898914;
        double r17898934 = r17898920 * r17898933;
        double r17898935 = a;
        double r17898936 = r17898935 * r17898916;
        double r17898937 = r17898934 - r17898936;
        double r17898938 = r17898937 * r17898936;
        double r17898939 = r17898931 + r17898938;
        double r17898940 = r17898927 + r17898939;
        return r17898940;
}

Error

Bits error versus B

Bits error versus D

Bits error versus a

Bits error versus A

Bits error versus b

Bits error versus d

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 10.4

    \[\left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \left(A \cdot \left(d - b \cdot b\right) - \left(2 \cdot B\right) \cdot c\right)\]
  2. Using strategy rm
  3. Applied sub-neg10.4

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \left(A \cdot \color{blue}{\left(d + \left(-b \cdot b\right)\right)} - \left(2 \cdot B\right) \cdot c\right)\]
  4. Applied distribute-lft-in10.4

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \left(\color{blue}{\left(A \cdot d + A \cdot \left(-b \cdot b\right)\right)} - \left(2 \cdot B\right) \cdot c\right)\]
  5. Applied associate--l+10.4

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + A \cdot \color{blue}{\left(A \cdot d + \left(A \cdot \left(-b \cdot b\right) - \left(2 \cdot B\right) \cdot c\right)\right)}\]
  6. Applied distribute-lft-in10.4

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + \color{blue}{\left(A \cdot \left(A \cdot d\right) + A \cdot \left(A \cdot \left(-b \cdot b\right) - \left(2 \cdot B\right) \cdot c\right)\right)}\]
  7. Simplified4.5

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + \left(A \cdot \left(A \cdot d\right) + \color{blue}{\left(-2 \cdot \left(c \cdot B\right) - \left(A \cdot b\right) \cdot b\right) \cdot A}\right)\]
  8. Taylor expanded around inf 13.2

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + \left(A \cdot \left(A \cdot d\right) + \color{blue}{\left(-\left({A}^{2} \cdot {b}^{2} + 2 \cdot \left(A \cdot \left(B \cdot c\right)\right)\right)\right)}\right)\]
  9. Simplified1.5

    \[\leadsto \left(\left(B + D\right) \cdot \left(B - D\right) + \left(a \cdot B\right) \cdot \left(\left(2 \cdot A\right) \cdot b - a \cdot B\right)\right) + \left(A \cdot \left(A \cdot d\right) + \color{blue}{\left(\left(B \cdot c\right) \cdot \left(A \cdot -2\right) - \left(A \cdot b\right) \cdot \left(A \cdot b\right)\right)}\right)\]
  10. Final simplification1.5

    \[\leadsto \left(\left(\left(-2 \cdot A\right) \cdot \left(B \cdot c\right) - \left(A \cdot b\right) \cdot \left(A \cdot b\right)\right) + A \cdot \left(d \cdot A\right)\right) + \left(\left(B + D\right) \cdot \left(B - D\right) + \left(b \cdot \left(2 \cdot A\right) - a \cdot B\right) \cdot \left(a \cdot B\right)\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (B D a A b d c)
  :name "(B + D) * (B - D) + a * B * (2 * A * b - a * B) + A * (A * (d - b * b) - 2 * B * c)"
  (+ (+ (* (+ B D) (- B D)) (* (* a B) (- (* (* 2 A) b) (* a B)))) (* A (- (* A (- d (* b b))) (* (* 2 B) c)))))