Average Error: 5.9 → 1.8
Time: 26.7s
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}\;z \le -817524477245330816:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot x\right) \cdot \left(18 \cdot y\right)\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot k\right) \cdot j\right)\right)\\ \mathbf{elif}\;z \le 9.069839166806894665192579007227268998295 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(b, c, t \cdot \left(\left(18 \cdot y\right) \cdot \left(z \cdot x\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), k \cdot \left(27 \cdot j\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot z\right) \cdot \left(\left(y \cdot t\right) \cdot x\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(j \cdot k\right) \cdot 27\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}\;z \le -817524477245330816:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot x\right) \cdot \left(18 \cdot y\right)\right) \cdot z - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot k\right) \cdot j\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(18 \cdot z\right) \cdot \left(\left(y \cdot t\right) \cdot x\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(j \cdot k\right) \cdot 27\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 r127787 = x;
        double r127788 = 18.0;
        double r127789 = r127787 * r127788;
        double r127790 = y;
        double r127791 = r127789 * r127790;
        double r127792 = z;
        double r127793 = r127791 * r127792;
        double r127794 = t;
        double r127795 = r127793 * r127794;
        double r127796 = a;
        double r127797 = 4.0;
        double r127798 = r127796 * r127797;
        double r127799 = r127798 * r127794;
        double r127800 = r127795 - r127799;
        double r127801 = b;
        double r127802 = c;
        double r127803 = r127801 * r127802;
        double r127804 = r127800 + r127803;
        double r127805 = r127787 * r127797;
        double r127806 = i;
        double r127807 = r127805 * r127806;
        double r127808 = r127804 - r127807;
        double r127809 = j;
        double r127810 = 27.0;
        double r127811 = r127809 * r127810;
        double r127812 = k;
        double r127813 = r127811 * r127812;
        double r127814 = r127808 - r127813;
        return r127814;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r127815 = z;
        double r127816 = -8.175244772453308e+17;
        bool r127817 = r127815 <= r127816;
        double r127818 = b;
        double r127819 = c;
        double r127820 = t;
        double r127821 = x;
        double r127822 = r127820 * r127821;
        double r127823 = 18.0;
        double r127824 = y;
        double r127825 = r127823 * r127824;
        double r127826 = r127822 * r127825;
        double r127827 = r127826 * r127815;
        double r127828 = 4.0;
        double r127829 = a;
        double r127830 = i;
        double r127831 = r127830 * r127821;
        double r127832 = fma(r127820, r127829, r127831);
        double r127833 = 27.0;
        double r127834 = k;
        double r127835 = r127833 * r127834;
        double r127836 = j;
        double r127837 = r127835 * r127836;
        double r127838 = fma(r127828, r127832, r127837);
        double r127839 = r127827 - r127838;
        double r127840 = fma(r127818, r127819, r127839);
        double r127841 = 9.069839166806895e-30;
        bool r127842 = r127815 <= r127841;
        double r127843 = r127815 * r127821;
        double r127844 = r127825 * r127843;
        double r127845 = r127820 * r127844;
        double r127846 = r127833 * r127836;
        double r127847 = r127834 * r127846;
        double r127848 = fma(r127828, r127832, r127847);
        double r127849 = r127845 - r127848;
        double r127850 = fma(r127818, r127819, r127849);
        double r127851 = r127823 * r127815;
        double r127852 = r127824 * r127820;
        double r127853 = r127852 * r127821;
        double r127854 = r127851 * r127853;
        double r127855 = r127836 * r127834;
        double r127856 = r127855 * r127833;
        double r127857 = fma(r127828, r127832, r127856);
        double r127858 = r127854 - r127857;
        double r127859 = fma(r127818, r127819, r127858);
        double r127860 = r127842 ? r127850 : r127859;
        double r127861 = r127817 ? r127840 : r127860;
        return r127861;
}

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 z < -8.175244772453308e+17

    1. Initial program 7.4

      \[\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. Simplified7.3

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

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

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

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

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

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

    if -8.175244772453308e+17 < z < 9.069839166806895e-30

    1. Initial program 5.2

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

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

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

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

    if 9.069839166806895e-30 < z

    1. Initial program 6.2

      \[\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. Simplified6.2

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

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

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

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

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

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

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

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

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

Reproduce

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