Average Error: 14.2 → 11.4
Time: 15.4s
Precision: 64
\[\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
\[\begin{array}{l} \mathbf{if}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le -2.785706008794766879863204057570132018763 \cdot 10^{-252}:\\ \;\;\;\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\\ \mathbf{elif}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le 0.0:\\ \;\;\;\;top_row_norm \cdot \left(\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot bottom_row_norm\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)} \cdot \sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)}\\ \end{array}\]
\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)
\begin{array}{l}
\mathbf{if}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le -2.785706008794766879863204057570132018763 \cdot 10^{-252}:\\
\;\;\;\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\\

\mathbf{elif}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le 0.0:\\
\;\;\;\;top_row_norm \cdot \left(\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot bottom_row_norm\right)\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)} \cdot \sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)}\\

\end{array}
double f(double top_row_norm, double bottom_row_norm, double top_row_pivot_element, double bottom_row_pivot_element) {
        double r140887 = top_row_norm;
        double r140888 = bottom_row_norm;
        double r140889 = r140887 * r140888;
        double r140890 = top_row_pivot_element;
        double r140891 = r140890 * r140888;
        double r140892 = r140891 * r140890;
        double r140893 = bottom_row_pivot_element;
        double r140894 = r140893 * r140887;
        double r140895 = r140893 * r140894;
        double r140896 = r140892 + r140895;
        double r140897 = r140889 * r140896;
        return r140897;
}

double f(double top_row_norm, double bottom_row_norm, double top_row_pivot_element, double bottom_row_pivot_element) {
        double r140898 = top_row_norm;
        double r140899 = bottom_row_norm;
        double r140900 = r140898 * r140899;
        double r140901 = top_row_pivot_element;
        double r140902 = r140901 * r140899;
        double r140903 = r140902 * r140901;
        double r140904 = bottom_row_pivot_element;
        double r140905 = r140904 * r140898;
        double r140906 = r140904 * r140905;
        double r140907 = r140903 + r140906;
        double r140908 = r140900 * r140907;
        double r140909 = -2.785706008794767e-252;
        bool r140910 = r140908 <= r140909;
        double r140911 = cbrt(r140903);
        double r140912 = r140911 * r140911;
        double r140913 = r140912 * r140911;
        double r140914 = r140913 + r140906;
        double r140915 = r140900 * r140914;
        double r140916 = 0.0;
        bool r140917 = r140908 <= r140916;
        double r140918 = r140907 * r140899;
        double r140919 = r140898 * r140918;
        double r140920 = r140907 * r140900;
        double r140921 = sqrt(r140920);
        double r140922 = r140921 * r140921;
        double r140923 = r140917 ? r140919 : r140922;
        double r140924 = r140910 ? r140915 : r140923;
        return r140924;
}

Error

Bits error versus top_row_norm

Bits error versus bottom_row_norm

Bits error versus top_row_pivot_element

Bits error versus bottom_row_pivot_element

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (* (* top_row_norm bottom_row_norm) (+ (* (* top_row_pivot_element bottom_row_norm) top_row_pivot_element) (* bottom_row_pivot_element (* bottom_row_pivot_element top_row_norm)))) < -2.785706008794767e-252

    1. Initial program 12.8

      \[\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt13.2

      \[\leadsto \left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\color{blue}{\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]

    if -2.785706008794767e-252 < (* (* top_row_norm bottom_row_norm) (+ (* (* top_row_pivot_element bottom_row_norm) top_row_pivot_element) (* bottom_row_pivot_element (* bottom_row_pivot_element top_row_norm)))) < 0.0

    1. Initial program 12.1

      \[\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt12.1

      \[\leadsto \left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\color{blue}{\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
    4. Using strategy rm
    5. Applied associate-*l*2.8

      \[\leadsto \color{blue}{top_row_norm \cdot \left(bottom_row_norm \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\right)}\]
    6. Simplified2.7

      \[\leadsto top_row_norm \cdot \color{blue}{\left(\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot bottom_row_norm\right)}\]

    if 0.0 < (* (* top_row_norm bottom_row_norm) (+ (* (* top_row_pivot_element bottom_row_norm) top_row_pivot_element) (* bottom_row_pivot_element (* bottom_row_pivot_element top_row_norm))))

    1. Initial program 15.6

      \[\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt15.8

      \[\leadsto \left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\color{blue}{\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt15.9

      \[\leadsto \color{blue}{\sqrt{\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)} \cdot \sqrt{\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)}}\]
    6. Simplified15.8

      \[\leadsto \color{blue}{\sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)}} \cdot \sqrt{\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)}\]
    7. Simplified15.7

      \[\leadsto \sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)} \cdot \color{blue}{\sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification11.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le -2.785706008794766879863204057570132018763 \cdot 10^{-252}:\\ \;\;\;\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(\sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element}\right) \cdot \sqrt[3]{\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element} + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right)\\ \mathbf{elif}\;\left(top_row_norm \cdot bottom_row_norm\right) \cdot \left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \le 0.0:\\ \;\;\;\;top_row_norm \cdot \left(\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot bottom_row_norm\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)} \cdot \sqrt{\left(\left(top_row_pivot_element \cdot bottom_row_norm\right) \cdot top_row_pivot_element + bottom_row_pivot_element \cdot \left(bottom_row_pivot_element \cdot top_row_norm\right)\right) \cdot \left(top_row_norm \cdot bottom_row_norm\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (top_row_norm bottom_row_norm top_row_pivot_element bottom_row_pivot_element)
  :name "top_row_norm * bottom_row_norm*(((top_row_pivot_element * bottom_row_norm) * top_row_pivot_element) + (bottom_row_pivot_element*(bottom_row_pivot_element * top_row_norm)))"
  :precision binary64
  (* (* top_row_norm bottom_row_norm) (+ (* (* top_row_pivot_element bottom_row_norm) top_row_pivot_element) (* bottom_row_pivot_element (* bottom_row_pivot_element top_row_norm)))))