Average Error: 5.8 → 3.5
Time: 25.8s
Precision: 64
\[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;t \le -0.42577583405425712 \lor \neg \left(t \le 4.3806417945575718 \cdot 10^{-114}\right):\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(y \cdot 18\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(z \cdot \left(x \cdot 18\right)\right) \cdot \left(y \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \end{array}\]
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\begin{array}{l}
\mathbf{if}\;t \le -0.42577583405425712 \lor \neg \left(t \le 4.3806417945575718 \cdot 10^{-114}\right):\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(y \cdot 18\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(z \cdot \left(x \cdot 18\right)\right) \cdot \left(y \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\

\end{array}
double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r120810 = x;
        double r120811 = 18.0;
        double r120812 = r120810 * r120811;
        double r120813 = y;
        double r120814 = r120812 * r120813;
        double r120815 = z;
        double r120816 = r120814 * r120815;
        double r120817 = t;
        double r120818 = r120816 * r120817;
        double r120819 = a;
        double r120820 = 4.0;
        double r120821 = r120819 * r120820;
        double r120822 = r120821 * r120817;
        double r120823 = r120818 - r120822;
        double r120824 = b;
        double r120825 = c;
        double r120826 = r120824 * r120825;
        double r120827 = r120823 + r120826;
        double r120828 = r120810 * r120820;
        double r120829 = i;
        double r120830 = r120828 * r120829;
        double r120831 = r120827 - r120830;
        double r120832 = j;
        double r120833 = 27.0;
        double r120834 = r120832 * r120833;
        double r120835 = k;
        double r120836 = r120834 * r120835;
        double r120837 = r120831 - r120836;
        return r120837;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r120838 = t;
        double r120839 = -0.4257758340542571;
        bool r120840 = r120838 <= r120839;
        double r120841 = 4.380641794557572e-114;
        bool r120842 = r120838 <= r120841;
        double r120843 = !r120842;
        bool r120844 = r120840 || r120843;
        double r120845 = b;
        double r120846 = c;
        double r120847 = y;
        double r120848 = 18.0;
        double r120849 = r120847 * r120848;
        double r120850 = x;
        double r120851 = r120849 * r120850;
        double r120852 = z;
        double r120853 = r120851 * r120852;
        double r120854 = r120853 * r120838;
        double r120855 = 4.0;
        double r120856 = a;
        double r120857 = i;
        double r120858 = r120850 * r120857;
        double r120859 = fma(r120838, r120856, r120858);
        double r120860 = 27.0;
        double r120861 = k;
        double r120862 = r120860 * r120861;
        double r120863 = j;
        double r120864 = r120862 * r120863;
        double r120865 = fma(r120855, r120859, r120864);
        double r120866 = r120854 - r120865;
        double r120867 = fma(r120845, r120846, r120866);
        double r120868 = r120850 * r120848;
        double r120869 = r120852 * r120868;
        double r120870 = r120847 * r120838;
        double r120871 = r120869 * r120870;
        double r120872 = r120863 * r120861;
        double r120873 = r120860 * r120872;
        double r120874 = fma(r120855, r120859, r120873);
        double r120875 = r120871 - r120874;
        double r120876 = fma(r120845, r120846, r120875);
        double r120877 = r120844 ? r120867 : r120876;
        return r120877;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus i

Bits error versus j

Bits error versus k

Derivation

  1. Split input into 2 regimes
  2. if t < -0.4257758340542571 or 4.380641794557572e-114 < t

    1. Initial program 2.9

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
    2. Simplified2.8

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)}\]
    3. Using strategy rm
    4. Applied pow12.8

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(x \cdot 18\right) \cdot \color{blue}{{y}^{1}}\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    5. Applied pow12.8

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(x \cdot \color{blue}{{18}^{1}}\right) \cdot {y}^{1}\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    6. Applied pow12.8

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(\color{blue}{{x}^{1}} \cdot {18}^{1}\right) \cdot {y}^{1}\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    7. Applied pow-prod-down2.8

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\color{blue}{{\left(x \cdot 18\right)}^{1}} \cdot {y}^{1}\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    8. Applied pow-prod-down2.8

      \[\leadsto \mathsf{fma}\left(b, c, \left(\color{blue}{{\left(\left(x \cdot 18\right) \cdot y\right)}^{1}} \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    9. Simplified2.8

      \[\leadsto \mathsf{fma}\left(b, c, \left({\color{blue}{\left(\left(y \cdot 18\right) \cdot x\right)}}^{1} \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]

    if -0.4257758340542571 < t < 4.380641794557572e-114

    1. Initial program 8.5

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\]
    2. Simplified8.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, c, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)}\]
    3. Using strategy rm
    4. Applied pow18.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot \color{blue}{{z}^{1}}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    5. Applied pow18.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(x \cdot 18\right) \cdot \color{blue}{{y}^{1}}\right) \cdot {z}^{1}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    6. Applied pow18.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(x \cdot \color{blue}{{18}^{1}}\right) \cdot {y}^{1}\right) \cdot {z}^{1}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    7. Applied pow18.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\left(\color{blue}{{x}^{1}} \cdot {18}^{1}\right) \cdot {y}^{1}\right) \cdot {z}^{1}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    8. Applied pow-prod-down8.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\color{blue}{{\left(x \cdot 18\right)}^{1}} \cdot {y}^{1}\right) \cdot {z}^{1}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    9. Applied pow-prod-down8.5

      \[\leadsto \mathsf{fma}\left(b, c, \left(\color{blue}{{\left(\left(x \cdot 18\right) \cdot y\right)}^{1}} \cdot {z}^{1}\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    10. Applied pow-prod-down8.5

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{{\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right)}^{1}} \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    11. Simplified8.2

      \[\leadsto \mathsf{fma}\left(b, c, {\color{blue}{\left(\left(z \cdot \left(x \cdot 18\right)\right) \cdot y\right)}}^{1} \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\]
    12. Using strategy rm
    13. Applied associate-*l*8.1

      \[\leadsto \mathsf{fma}\left(b, c, {\left(\left(z \cdot \left(x \cdot 18\right)\right) \cdot y\right)}^{1} \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \color{blue}{27 \cdot \left(k \cdot j\right)}\right)\right)\]
    14. Simplified8.1

      \[\leadsto \mathsf{fma}\left(b, c, {\left(\left(z \cdot \left(x \cdot 18\right)\right) \cdot y\right)}^{1} \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \color{blue}{\left(j \cdot k\right)}\right)\right)\]
    15. Using strategy rm
    16. Applied unpow-prod-down8.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left({\left(z \cdot \left(x \cdot 18\right)\right)}^{1} \cdot {y}^{1}\right)} \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    17. Applied associate-*l*4.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{{\left(z \cdot \left(x \cdot 18\right)\right)}^{1} \cdot \left({y}^{1} \cdot t\right)} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
    18. Simplified4.1

      \[\leadsto \mathsf{fma}\left(b, c, {\left(z \cdot \left(x \cdot 18\right)\right)}^{1} \cdot \color{blue}{\left(y \cdot t\right)} - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification3.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -0.42577583405425712 \lor \neg \left(t \le 4.3806417945575718 \cdot 10^{-114}\right):\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(\left(y \cdot 18\right) \cdot x\right) \cdot z\right) \cdot t - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(z \cdot \left(x \cdot 18\right)\right) \cdot \left(y \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))