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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(x \cdot \left(t \cdot 18\right)\right) \cdot \left(y \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)\\

\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 r71556 = x;
        double r71557 = 18.0;
        double r71558 = r71556 * r71557;
        double r71559 = y;
        double r71560 = r71558 * r71559;
        double r71561 = z;
        double r71562 = r71560 * r71561;
        double r71563 = t;
        double r71564 = r71562 * r71563;
        double r71565 = a;
        double r71566 = 4.0;
        double r71567 = r71565 * r71566;
        double r71568 = r71567 * r71563;
        double r71569 = r71564 - r71568;
        double r71570 = b;
        double r71571 = c;
        double r71572 = r71570 * r71571;
        double r71573 = r71569 + r71572;
        double r71574 = r71556 * r71566;
        double r71575 = i;
        double r71576 = r71574 * r71575;
        double r71577 = r71573 - r71576;
        double r71578 = j;
        double r71579 = 27.0;
        double r71580 = r71578 * r71579;
        double r71581 = k;
        double r71582 = r71580 * r71581;
        double r71583 = r71577 - r71582;
        return r71583;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r71584 = t;
        double r71585 = -1.2962901786369045e+32;
        bool r71586 = r71584 <= r71585;
        double r71587 = b;
        double r71588 = c;
        double r71589 = x;
        double r71590 = 18.0;
        double r71591 = r71589 * r71590;
        double r71592 = y;
        double r71593 = r71591 * r71592;
        double r71594 = z;
        double r71595 = r71593 * r71594;
        double r71596 = r71595 * r71584;
        double r71597 = 4.0;
        double r71598 = a;
        double r71599 = i;
        double r71600 = r71599 * r71589;
        double r71601 = fma(r71584, r71598, r71600);
        double r71602 = 27.0;
        double r71603 = j;
        double r71604 = k;
        double r71605 = r71603 * r71604;
        double r71606 = r71602 * r71605;
        double r71607 = fma(r71597, r71601, r71606);
        double r71608 = r71596 - r71607;
        double r71609 = fma(r71587, r71588, r71608);
        double r71610 = 4.876643435439088e-122;
        bool r71611 = r71584 <= r71610;
        double r71612 = r71584 * r71594;
        double r71613 = r71589 * r71612;
        double r71614 = r71592 * r71613;
        double r71615 = r71614 * r71590;
        double r71616 = r71602 * r71603;
        double r71617 = r71616 * r71604;
        double r71618 = fma(r71597, r71601, r71617);
        double r71619 = r71615 - r71618;
        double r71620 = fma(r71587, r71588, r71619);
        double r71621 = r71584 * r71590;
        double r71622 = r71589 * r71621;
        double r71623 = r71592 * r71594;
        double r71624 = r71622 * r71623;
        double r71625 = r71624 - r71618;
        double r71626 = fma(r71587, r71588, r71625);
        double r71627 = r71611 ? r71620 : r71626;
        double r71628 = r71586 ? r71609 : r71627;
        return r71628;
}

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 < -1.2962901786369045e+32

    1. Initial program 1.8

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

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

      \[\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.2962901786369045e+32 < t < 4.876643435439088e-122

    1. Initial program 7.8

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

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

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

      \[\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. Taylor expanded around inf 9.0

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{18 \cdot \left(t \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)\]
    7. Simplified6.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(18 \cdot \left(t \cdot x\right)\right) \cdot \left(y \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. Using strategy rm
    9. Applied associate-*l*6.1

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

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \color{blue}{\left(\left(\left(x \cdot t\right) \cdot z\right) \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 pow11.6

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left(\left(\left(x \cdot t\right) \cdot \color{blue}{{z}^{1}}\right) \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 pow11.6

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left(\left(\left(x \cdot \color{blue}{{t}^{1}}\right) \cdot {z}^{1}\right) \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 pow11.6

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left(\left(\left(\color{blue}{{x}^{1}} \cdot {t}^{1}\right) \cdot {z}^{1}\right) \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-down1.6

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left(\left(\color{blue}{{\left(x \cdot t\right)}^{1}} \cdot {z}^{1}\right) \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-down1.6

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left(\color{blue}{{\left(\left(x \cdot t\right) \cdot z\right)}^{1}} \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. Simplified1.0

      \[\leadsto \mathsf{fma}\left(b, c, 18 \cdot \left({\color{blue}{\left(\left(z \cdot t\right) \cdot x\right)}}^{1} \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 4.876643435439088e-122 < t

    1. Initial program 3.7

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

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

      \[\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. Simplified6.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. Taylor expanded around inf 3.5

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{18 \cdot \left(t \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)\]
    7. Simplified6.0

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(18 \cdot \left(t \cdot x\right)\right) \cdot \left(y \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. Using strategy rm
    9. Applied associate-*r*6.2

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\left(18 \cdot t\right) \cdot x\right)} \cdot \left(y \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. Recombined 3 regimes into one program.
  4. Final simplification2.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -129629017863690450409738691674112:\\ \;\;\;\;\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, i \cdot x\right), 27 \cdot \left(j \cdot k\right)\right)\right)\\ \mathbf{elif}\;t \le 4.876643435439087564674222281670203784324 \cdot 10^{-122}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(y \cdot \left(x \cdot \left(t \cdot z\right)\right)\right) \cdot 18 - \mathsf{fma}\left(4, \mathsf{fma}\left(t, a, i \cdot x\right), \left(27 \cdot j\right) \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(x \cdot \left(t \cdot 18\right)\right) \cdot \left(y \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)\\ \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)))