Average Error: 10.9 → 12.0
Time: 24.0s
Precision: 64
\[\left(z1 \cdot z2\right) \cdot \left(\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\right)\]
\[\begin{array}{l} \mathbf{if}\;y21 \le -7.242552672135088 \cdot 10^{+70}:\\ \;\;\;\;z1 \cdot \left(\left(\left(z2 \cdot y11\right) \cdot y1k + y2k \cdot \left(z1 \cdot y21\right)\right) \cdot z2\right)\\ \mathbf{elif}\;y21 \le -4.118045274009781 \cdot 10^{-14}:\\ \;\;\;\;\left(z1 \cdot z2\right) \cdot \left(\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\right)\\ \mathbf{elif}\;y21 \le 8.494940353844113 \cdot 10^{-150}:\\ \;\;\;\;z1 \cdot \left(\left(\left(z2 \cdot y11\right) \cdot y1k + y2k \cdot \left(z1 \cdot y21\right)\right) \cdot z2\right)\\ \mathbf{elif}\;y21 \le 3.253411104844043 \cdot 10^{+170}:\\ \;\;\;\;\left(z1 \cdot z2\right) \cdot \left(\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y21 \cdot z2\right) \cdot \left(\left(z1 \cdot z1\right) \cdot y2k\right) + \left(z1 \cdot \left(\left(y1k \cdot z2\right) \cdot z2\right)\right) \cdot y11\\ \end{array}\]
\left(z1 \cdot z2\right) \cdot \left(\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\right)
\begin{array}{l}
\mathbf{if}\;y21 \le -7.242552672135088 \cdot 10^{+70}:\\
\;\;\;\;z1 \cdot \left(\left(\left(z2 \cdot y11\right) \cdot y1k + y2k \cdot \left(z1 \cdot y21\right)\right) \cdot z2\right)\\

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

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

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

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

\end{array}
double f(double z1, double z2, double y11, double y1k, double y21, double y2k) {
        double r55923822 = z1;
        double r55923823 = z2;
        double r55923824 = r55923822 * r55923823;
        double r55923825 = y11;
        double r55923826 = r55923825 * r55923823;
        double r55923827 = y1k;
        double r55923828 = r55923826 * r55923827;
        double r55923829 = y21;
        double r55923830 = r55923829 * r55923822;
        double r55923831 = y2k;
        double r55923832 = r55923830 * r55923831;
        double r55923833 = r55923828 + r55923832;
        double r55923834 = r55923824 * r55923833;
        return r55923834;
}

double f(double z1, double z2, double y11, double y1k, double y21, double y2k) {
        double r55923835 = y21;
        double r55923836 = -7.242552672135088e+70;
        bool r55923837 = r55923835 <= r55923836;
        double r55923838 = z1;
        double r55923839 = z2;
        double r55923840 = y11;
        double r55923841 = r55923839 * r55923840;
        double r55923842 = y1k;
        double r55923843 = r55923841 * r55923842;
        double r55923844 = y2k;
        double r55923845 = r55923838 * r55923835;
        double r55923846 = r55923844 * r55923845;
        double r55923847 = r55923843 + r55923846;
        double r55923848 = r55923847 * r55923839;
        double r55923849 = r55923838 * r55923848;
        double r55923850 = -4.118045274009781e-14;
        bool r55923851 = r55923835 <= r55923850;
        double r55923852 = r55923838 * r55923839;
        double r55923853 = r55923835 * r55923844;
        double r55923854 = r55923853 * r55923838;
        double r55923855 = r55923842 * r55923839;
        double r55923856 = r55923855 * r55923840;
        double r55923857 = r55923854 + r55923856;
        double r55923858 = r55923852 * r55923857;
        double r55923859 = 8.494940353844113e-150;
        bool r55923860 = r55923835 <= r55923859;
        double r55923861 = 3.253411104844043e+170;
        bool r55923862 = r55923835 <= r55923861;
        double r55923863 = r55923835 * r55923839;
        double r55923864 = r55923838 * r55923838;
        double r55923865 = r55923864 * r55923844;
        double r55923866 = r55923863 * r55923865;
        double r55923867 = r55923855 * r55923839;
        double r55923868 = r55923838 * r55923867;
        double r55923869 = r55923868 * r55923840;
        double r55923870 = r55923866 + r55923869;
        double r55923871 = r55923862 ? r55923858 : r55923870;
        double r55923872 = r55923860 ? r55923849 : r55923871;
        double r55923873 = r55923851 ? r55923858 : r55923872;
        double r55923874 = r55923837 ? r55923849 : r55923873;
        return r55923874;
}

Error

Bits error versus z1

Bits error versus z2

Bits error versus y11

Bits error versus y1k

Bits error versus y21

Bits error versus y2k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if y21 < -7.242552672135088e+70 or -4.118045274009781e-14 < y21 < 8.494940353844113e-150

    1. Initial program 10.1

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

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

    if -7.242552672135088e+70 < y21 < -4.118045274009781e-14 or 8.494940353844113e-150 < y21 < 3.253411104844043e+170

    1. Initial program 9.2

      \[\left(z1 \cdot z2\right) \cdot \left(\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\right)\]
    2. Taylor expanded around inf 10.1

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

    if 3.253411104844043e+170 < y21

    1. Initial program 23.3

      \[\left(z1 \cdot z2\right) \cdot \left(\left(y11 \cdot z2\right) \cdot y1k + \left(y21 \cdot z1\right) \cdot y2k\right)\]
    2. Taylor expanded around -inf 31.4

      \[\leadsto \color{blue}{{z1}^{2} \cdot \left(z2 \cdot \left(y21 \cdot y2k\right)\right) + z1 \cdot \left(y11 \cdot \left({z2}^{2} \cdot y1k\right)\right)}\]
    3. Simplified25.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y21 \le -7.242552672135088 \cdot 10^{+70}:\\ \;\;\;\;z1 \cdot \left(\left(\left(z2 \cdot y11\right) \cdot y1k + y2k \cdot \left(z1 \cdot y21\right)\right) \cdot z2\right)\\ \mathbf{elif}\;y21 \le -4.118045274009781 \cdot 10^{-14}:\\ \;\;\;\;\left(z1 \cdot z2\right) \cdot \left(\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\right)\\ \mathbf{elif}\;y21 \le 8.494940353844113 \cdot 10^{-150}:\\ \;\;\;\;z1 \cdot \left(\left(\left(z2 \cdot y11\right) \cdot y1k + y2k \cdot \left(z1 \cdot y21\right)\right) \cdot z2\right)\\ \mathbf{elif}\;y21 \le 3.253411104844043 \cdot 10^{+170}:\\ \;\;\;\;\left(z1 \cdot z2\right) \cdot \left(\left(y21 \cdot y2k\right) \cdot z1 + \left(y1k \cdot z2\right) \cdot y11\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y21 \cdot z2\right) \cdot \left(\left(z1 \cdot z1\right) \cdot y2k\right) + \left(z1 \cdot \left(\left(y1k \cdot z2\right) \cdot z2\right)\right) \cdot y11\\ \end{array}\]

Reproduce

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