Average Error: 5.7 → 1.9
Time: 26.9s
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}\;y \le -3.345137941616381777884138899549945673491 \cdot 10^{-109}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(y \cdot 18\right) \cdot \left(\left(t \cdot x\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\ \mathbf{elif}\;y \le 1510181401013655094183193792723860586496:\\ \;\;\;\;\mathsf{fma}\left(b, c, t \cdot \left(z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), 27 \cdot \left(k \cdot j\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(t \cdot \left(x \cdot z\right)\right) \cdot \left(y \cdot 18\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \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}\;y \le -3.345137941616381777884138899549945673491 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(y \cdot 18\right) \cdot \left(\left(t \cdot x\right) \cdot z\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(t \cdot \left(x \cdot z\right)\right) \cdot \left(y \cdot 18\right) - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \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 r111681 = x;
        double r111682 = 18.0;
        double r111683 = r111681 * r111682;
        double r111684 = y;
        double r111685 = r111683 * r111684;
        double r111686 = z;
        double r111687 = r111685 * r111686;
        double r111688 = t;
        double r111689 = r111687 * r111688;
        double r111690 = a;
        double r111691 = 4.0;
        double r111692 = r111690 * r111691;
        double r111693 = r111692 * r111688;
        double r111694 = r111689 - r111693;
        double r111695 = b;
        double r111696 = c;
        double r111697 = r111695 * r111696;
        double r111698 = r111694 + r111697;
        double r111699 = r111681 * r111691;
        double r111700 = i;
        double r111701 = r111699 * r111700;
        double r111702 = r111698 - r111701;
        double r111703 = j;
        double r111704 = 27.0;
        double r111705 = r111703 * r111704;
        double r111706 = k;
        double r111707 = r111705 * r111706;
        double r111708 = r111702 - r111707;
        return r111708;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r111709 = y;
        double r111710 = -3.345137941616382e-109;
        bool r111711 = r111709 <= r111710;
        double r111712 = b;
        double r111713 = c;
        double r111714 = 18.0;
        double r111715 = r111709 * r111714;
        double r111716 = t;
        double r111717 = x;
        double r111718 = r111716 * r111717;
        double r111719 = z;
        double r111720 = r111718 * r111719;
        double r111721 = r111715 * r111720;
        double r111722 = 4.0;
        double r111723 = a;
        double r111724 = i;
        double r111725 = r111724 * r111717;
        double r111726 = fma(r111716, r111723, r111725);
        double r111727 = 27.0;
        double r111728 = j;
        double r111729 = r111727 * r111728;
        double r111730 = k;
        double r111731 = r111729 * r111730;
        double r111732 = fma(r111722, r111726, r111731);
        double r111733 = r111721 - r111732;
        double r111734 = fma(r111712, r111713, r111733);
        double r111735 = 1.510181401013655e+39;
        bool r111736 = r111709 <= r111735;
        double r111737 = r111714 * r111717;
        double r111738 = r111709 * r111737;
        double r111739 = r111719 * r111738;
        double r111740 = r111716 * r111739;
        double r111741 = r111730 * r111728;
        double r111742 = r111727 * r111741;
        double r111743 = fma(r111722, r111726, r111742);
        double r111744 = r111740 - r111743;
        double r111745 = fma(r111712, r111713, r111744);
        double r111746 = r111717 * r111719;
        double r111747 = r111716 * r111746;
        double r111748 = r111747 * r111715;
        double r111749 = r111748 - r111732;
        double r111750 = fma(r111712, r111713, r111749);
        double r111751 = r111736 ? r111745 : r111750;
        double r111752 = r111711 ? r111734 : r111751;
        return r111752;
}

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 y < -3.345137941616382e-109

    1. Initial program 8.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. Simplified8.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. Using strategy rm
    4. Applied associate-*r*6.6

      \[\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. Simplified4.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*7.9

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(t \cdot x\right) \cdot \left(\left(y \cdot 18\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)\]
    8. Simplified7.9

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

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

    if -3.345137941616382e-109 < y < 1.510181401013655e+39

    1. Initial program 1.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. Simplified1.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-*l*1.2

      \[\leadsto \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), \color{blue}{27 \cdot \left(j \cdot k\right)}\right)\right)\]

    if 1.510181401013655e+39 < y

    1. Initial program 13.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. Simplified13.0

      \[\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*10.8

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

      \[\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*12.9

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(t \cdot x\right) \cdot \left(\left(y \cdot 18\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)\]
    8. Simplified12.9

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

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

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

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

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

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

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

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

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

Reproduce

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