Average Error: 5.8 → 2.0
Time: 28.1s
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 -6.442181096393705101750420734141792839571 \cdot 10^{95}:\\ \;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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}\;t \le 1208.546700118903572729323059320449829102:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(y \cdot 18\right) \cdot \left(t \cdot x\right)\right) \cdot z - \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, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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 -6.442181096393705101750420734141792839571 \cdot 10^{95}:\\
\;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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}\;t \le 1208.546700118903572729323059320449829102:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(y \cdot 18\right) \cdot \left(t \cdot x\right)\right) \cdot z - \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, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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 r4184283 = x;
        double r4184284 = 18.0;
        double r4184285 = r4184283 * r4184284;
        double r4184286 = y;
        double r4184287 = r4184285 * r4184286;
        double r4184288 = z;
        double r4184289 = r4184287 * r4184288;
        double r4184290 = t;
        double r4184291 = r4184289 * r4184290;
        double r4184292 = a;
        double r4184293 = 4.0;
        double r4184294 = r4184292 * r4184293;
        double r4184295 = r4184294 * r4184290;
        double r4184296 = r4184291 - r4184295;
        double r4184297 = b;
        double r4184298 = c;
        double r4184299 = r4184297 * r4184298;
        double r4184300 = r4184296 + r4184299;
        double r4184301 = r4184283 * r4184293;
        double r4184302 = i;
        double r4184303 = r4184301 * r4184302;
        double r4184304 = r4184300 - r4184303;
        double r4184305 = j;
        double r4184306 = 27.0;
        double r4184307 = r4184305 * r4184306;
        double r4184308 = k;
        double r4184309 = r4184307 * r4184308;
        double r4184310 = r4184304 - r4184309;
        return r4184310;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r4184311 = t;
        double r4184312 = -6.442181096393705e+95;
        bool r4184313 = r4184311 <= r4184312;
        double r4184314 = b;
        double r4184315 = c;
        double r4184316 = 18.0;
        double r4184317 = z;
        double r4184318 = y;
        double r4184319 = r4184317 * r4184318;
        double r4184320 = x;
        double r4184321 = r4184319 * r4184320;
        double r4184322 = r4184311 * r4184321;
        double r4184323 = r4184316 * r4184322;
        double r4184324 = 4.0;
        double r4184325 = a;
        double r4184326 = i;
        double r4184327 = r4184326 * r4184320;
        double r4184328 = fma(r4184311, r4184325, r4184327);
        double r4184329 = 27.0;
        double r4184330 = j;
        double r4184331 = r4184329 * r4184330;
        double r4184332 = k;
        double r4184333 = r4184331 * r4184332;
        double r4184334 = fma(r4184324, r4184328, r4184333);
        double r4184335 = r4184323 - r4184334;
        double r4184336 = fma(r4184314, r4184315, r4184335);
        double r4184337 = 1208.5467001189036;
        bool r4184338 = r4184311 <= r4184337;
        double r4184339 = r4184318 * r4184316;
        double r4184340 = r4184311 * r4184320;
        double r4184341 = r4184339 * r4184340;
        double r4184342 = r4184341 * r4184317;
        double r4184343 = r4184332 * r4184330;
        double r4184344 = r4184329 * r4184343;
        double r4184345 = fma(r4184324, r4184328, r4184344);
        double r4184346 = r4184342 - r4184345;
        double r4184347 = fma(r4184314, r4184315, r4184346);
        double r4184348 = r4184338 ? r4184347 : r4184336;
        double r4184349 = r4184313 ? r4184336 : r4184348;
        return r4184349;
}

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 2 regimes
  2. if t < -6.442181096393705e+95 or 1208.5467001189036 < t

    1. Initial program 1.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. Simplified1.5

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

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

      \[\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)\]

    if -6.442181096393705e+95 < t < 1208.5467001189036

    1. Initial program 7.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. Simplified7.5

      \[\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.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. Using strategy rm
    6. Applied associate-*r*2.1

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

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(t \cdot \left(x \cdot 18\right)\right) \cdot y\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)\]
    9. Using strategy rm
    10. Applied *-un-lft-identity2.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.442181096393705101750420734141792839571 \cdot 10^{95}:\\ \;\;\;\;\mathsf{fma}\left(b, c, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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}\;t \le 1208.546700118903572729323059320449829102:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(y \cdot 18\right) \cdot \left(t \cdot x\right)\right) \cdot z - \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, 18 \cdot \left(t \cdot \left(\left(z \cdot y\right) \cdot x\right)\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 2019171 +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)))