Average Error: 5.6 → 4.5
Time: 19.2s
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 -2.7690389049687299 \cdot 10^{-100}:\\ \;\;\;\;\mathsf{fma}\left(t, \left(x \cdot \left(18 \cdot y\right)\right) \cdot z, b \cdot c\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{elif}\;t \le 1.52913347537115725 \cdot 10^{-82}:\\ \;\;\;\;\mathsf{fma}\left(t, 0, b \cdot c\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\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 -2.7690389049687299 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(t, \left(x \cdot \left(18 \cdot y\right)\right) \cdot z, b \cdot c\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\right)\right)\\

\mathbf{elif}\;t \le 1.52913347537115725 \cdot 10^{-82}:\\
\;\;\;\;\mathsf{fma}\left(t, 0, b \cdot c\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(x \cdot \left(z \cdot y\right)\right)\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), j \cdot \left(27 \cdot k\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 r147739 = x;
        double r147740 = 18.0;
        double r147741 = r147739 * r147740;
        double r147742 = y;
        double r147743 = r147741 * r147742;
        double r147744 = z;
        double r147745 = r147743 * r147744;
        double r147746 = t;
        double r147747 = r147745 * r147746;
        double r147748 = a;
        double r147749 = 4.0;
        double r147750 = r147748 * r147749;
        double r147751 = r147750 * r147746;
        double r147752 = r147747 - r147751;
        double r147753 = b;
        double r147754 = c;
        double r147755 = r147753 * r147754;
        double r147756 = r147752 + r147755;
        double r147757 = r147739 * r147749;
        double r147758 = i;
        double r147759 = r147757 * r147758;
        double r147760 = r147756 - r147759;
        double r147761 = j;
        double r147762 = 27.0;
        double r147763 = r147761 * r147762;
        double r147764 = k;
        double r147765 = r147763 * r147764;
        double r147766 = r147760 - r147765;
        return r147766;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r147767 = t;
        double r147768 = -2.76903890496873e-100;
        bool r147769 = r147767 <= r147768;
        double r147770 = x;
        double r147771 = 18.0;
        double r147772 = y;
        double r147773 = r147771 * r147772;
        double r147774 = r147770 * r147773;
        double r147775 = z;
        double r147776 = r147774 * r147775;
        double r147777 = b;
        double r147778 = c;
        double r147779 = r147777 * r147778;
        double r147780 = fma(r147767, r147776, r147779);
        double r147781 = 4.0;
        double r147782 = a;
        double r147783 = i;
        double r147784 = r147783 * r147770;
        double r147785 = fma(r147767, r147782, r147784);
        double r147786 = j;
        double r147787 = 27.0;
        double r147788 = k;
        double r147789 = r147787 * r147788;
        double r147790 = r147786 * r147789;
        double r147791 = fma(r147781, r147785, r147790);
        double r147792 = r147780 - r147791;
        double r147793 = 1.5291334753711572e-82;
        bool r147794 = r147767 <= r147793;
        double r147795 = 0.0;
        double r147796 = fma(r147767, r147795, r147779);
        double r147797 = r147796 - r147791;
        double r147798 = r147775 * r147772;
        double r147799 = r147770 * r147798;
        double r147800 = r147767 * r147799;
        double r147801 = r147771 * r147800;
        double r147802 = fma(r147777, r147778, r147801);
        double r147803 = r147802 - r147791;
        double r147804 = r147794 ? r147797 : r147803;
        double r147805 = r147769 ? r147792 : r147804;
        return r147805;
}

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 < -2.76903890496873e-100

    1. Initial program 2.6

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

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

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

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

    if -2.76903890496873e-100 < t < 1.5291334753711572e-82

    1. Initial program 9.1

      \[\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. Simplified9.1

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

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

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

    if 1.5291334753711572e-82 < t

    1. Initial program 2.6

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020043 +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)))