Average Error: 8.2 → 1.7
Time: 33.6s
Precision: 64
\[\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\]
\[\begin{array}{l} \mathbf{if}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k = -\infty:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le -9.09321147905735 \cdot 10^{-127}:\\ \;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 0.0:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 1.701739534180803 \cdot 10^{+290}:\\ \;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\ \mathbf{else}:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \end{array}\]
\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k
\begin{array}{l}
\mathbf{if}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k = -\infty:\\
\;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\

\mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le -9.09321147905735 \cdot 10^{-127}:\\
\;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\

\mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 0.0:\\
\;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\

\mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 1.701739534180803 \cdot 10^{+290}:\\
\;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\

\mathbf{else}:\\
\;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\

\end{array}
double f(double y11, double z2, double y1k, double y21, double z1, double y2k) {
        double r55325804 = y11;
        double r55325805 = z2;
        double r55325806 = r55325804 * r55325805;
        double r55325807 = y1k;
        double r55325808 = r55325806 * r55325807;
        double r55325809 = y21;
        double r55325810 = z1;
        double r55325811 = r55325809 * r55325810;
        double r55325812 = y2k;
        double r55325813 = r55325811 * r55325812;
        double r55325814 = r55325808 + r55325813;
        return r55325814;
}

double f(double y11, double z2, double y1k, double y21, double z1, double y2k) {
        double r55325815 = z2;
        double r55325816 = y11;
        double r55325817 = r55325815 * r55325816;
        double r55325818 = y1k;
        double r55325819 = r55325817 * r55325818;
        double r55325820 = y21;
        double r55325821 = z1;
        double r55325822 = r55325820 * r55325821;
        double r55325823 = y2k;
        double r55325824 = r55325822 * r55325823;
        double r55325825 = r55325819 + r55325824;
        double r55325826 = -inf.0;
        bool r55325827 = r55325825 <= r55325826;
        double r55325828 = r55325820 * r55325823;
        double r55325829 = r55325828 * r55325821;
        double r55325830 = r55325818 * r55325815;
        double r55325831 = r55325830 * r55325816;
        double r55325832 = r55325829 + r55325831;
        double r55325833 = -9.09321147905735e-127;
        bool r55325834 = r55325825 <= r55325833;
        double r55325835 = 0.0;
        bool r55325836 = r55325825 <= r55325835;
        double r55325837 = 1.701739534180803e+290;
        bool r55325838 = r55325825 <= r55325837;
        double r55325839 = r55325838 ? r55325825 : r55325832;
        double r55325840 = r55325836 ? r55325832 : r55325839;
        double r55325841 = r55325834 ? r55325825 : r55325840;
        double r55325842 = r55325827 ? r55325832 : r55325841;
        return r55325842;
}

Error

Bits error versus y11

Bits error versus z2

Bits error versus y1k

Bits error versus y21

Bits error versus z1

Bits error versus y2k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k)) < -inf.0 or -9.09321147905735e-127 < (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k)) < 0.0 or 1.701739534180803e+290 < (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k))

    1. Initial program 32.9

      \[\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\]
    2. Using strategy rm
    3. Applied associate-*l*18.3

      \[\leadsto \color{blue}{y11 \cdot \left(z2 \cdot y1k\right)} + \left(y21 \cdot z1\right) \cdot y2k\]
    4. Taylor expanded around -inf 5.0

      \[\leadsto \color{blue}{y11 \cdot \left(z2 \cdot y1k\right) + z1 \cdot \left(y21 \cdot y2k\right)}\]

    if -inf.0 < (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k)) < -9.09321147905735e-127 or 0.0 < (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k)) < 1.701739534180803e+290

    1. Initial program 0.8

      \[\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\]
    2. Using strategy rm
    3. Applied associate-*l*4.9

      \[\leadsto \color{blue}{y11 \cdot \left(z2 \cdot y1k\right)} + \left(y21 \cdot z1\right) \cdot y2k\]
    4. Using strategy rm
    5. Applied associate-*r*0.8

      \[\leadsto \color{blue}{\left(y11 \cdot z2\right) \cdot y1k} + \left(y21 \cdot z1\right) \cdot y2k\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k = -\infty:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le -9.09321147905735 \cdot 10^{-127}:\\ \;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 0.0:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \mathbf{elif}\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k \le 1.701739534180803 \cdot 10^{+290}:\\ \;\;\;\;\left(z2 \cdot y11\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\\ \mathbf{else}:\\ \;\;\;\;\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (y11 z2 y1k y21 z1 y2k)
  :name "y11*z2*y1k + y21*z1*y2k"
  (+ (* (* y11 z2) y1k) (* (* y21 z1) y2k)))