Average Error: 5.5 → 3.9
Time: 29.0s
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 -4.802521353136590134090568041763149695323 \cdot 10^{-178}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(\left(\left(y \cdot x\right) \cdot 18\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\\ \mathbf{elif}\;t \le 4.339340101075432744492970777980355608709 \cdot 10^{-63}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot y\right) \cdot \left(t \cdot z\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\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 -4.802521353136590134090568041763149695323 \cdot 10^{-178}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(\left(y \cdot x\right) \cdot 18\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right)\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(27 \cdot k\right) \cdot j\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 r84690 = x;
        double r84691 = 18.0;
        double r84692 = r84690 * r84691;
        double r84693 = y;
        double r84694 = r84692 * r84693;
        double r84695 = z;
        double r84696 = r84694 * r84695;
        double r84697 = t;
        double r84698 = r84696 * r84697;
        double r84699 = a;
        double r84700 = 4.0;
        double r84701 = r84699 * r84700;
        double r84702 = r84701 * r84697;
        double r84703 = r84698 - r84702;
        double r84704 = b;
        double r84705 = c;
        double r84706 = r84704 * r84705;
        double r84707 = r84703 + r84706;
        double r84708 = r84690 * r84700;
        double r84709 = i;
        double r84710 = r84708 * r84709;
        double r84711 = r84707 - r84710;
        double r84712 = j;
        double r84713 = 27.0;
        double r84714 = r84712 * r84713;
        double r84715 = k;
        double r84716 = r84714 * r84715;
        double r84717 = r84711 - r84716;
        return r84717;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r84718 = t;
        double r84719 = -4.80252135313659e-178;
        bool r84720 = r84718 <= r84719;
        double r84721 = c;
        double r84722 = b;
        double r84723 = y;
        double r84724 = x;
        double r84725 = r84723 * r84724;
        double r84726 = 18.0;
        double r84727 = r84725 * r84726;
        double r84728 = z;
        double r84729 = r84727 * r84728;
        double r84730 = r84729 * r84718;
        double r84731 = fma(r84721, r84722, r84730);
        double r84732 = 4.0;
        double r84733 = a;
        double r84734 = i;
        double r84735 = r84724 * r84734;
        double r84736 = fma(r84718, r84733, r84735);
        double r84737 = j;
        double r84738 = 27.0;
        double r84739 = r84737 * r84738;
        double r84740 = k;
        double r84741 = r84739 * r84740;
        double r84742 = fma(r84732, r84736, r84741);
        double r84743 = r84731 - r84742;
        double r84744 = 4.339340101075433e-63;
        bool r84745 = r84718 <= r84744;
        double r84746 = r84724 * r84726;
        double r84747 = r84746 * r84723;
        double r84748 = r84718 * r84728;
        double r84749 = r84747 * r84748;
        double r84750 = fma(r84721, r84722, r84749);
        double r84751 = r84738 * r84740;
        double r84752 = r84751 * r84737;
        double r84753 = fma(r84732, r84736, r84752);
        double r84754 = r84750 - r84753;
        double r84755 = r84723 * r84728;
        double r84756 = r84746 * r84755;
        double r84757 = r84756 * r84718;
        double r84758 = fma(r84721, r84722, r84757);
        double r84759 = r84758 - r84753;
        double r84760 = r84745 ? r84754 : r84759;
        double r84761 = r84720 ? r84743 : r84760;
        return r84761;
}

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 3 regimes
  2. if t < -4.80252135313659e-178

    1. Initial program 4.0

      \[\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. Simplified3.9

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

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

      \[\leadsto \mathsf{fma}\left(c, b, \left(\left(x \cdot \color{blue}{\left(y \cdot 18\right)}\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)\]
    6. Using strategy rm
    7. Applied associate-*r*3.9

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

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

    if -4.80252135313659e-178 < t < 4.339340101075433e-63

    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(c, b, \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, x \cdot i\right), \left(j \cdot 27\right) \cdot k\right)}\]
    3. Using strategy rm
    4. Applied pow18.5

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

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

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

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

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

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

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

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

    if 4.339340101075433e-63 < t

    1. Initial program 3.0

      \[\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.9

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019208 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1"
  :precision binary64
  (- (- (+ (- (* (* (* (* x 18) y) z) t) (* (* a 4) t)) (* b c)) (* (* x 4) i)) (* (* j 27) k)))