Average Error: 5.3 → 0.8
Time: 29.2s
Precision: 64
\[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
\[\begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \end{array}\]
\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\

\mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\
\;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\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 r34437288 = x;
        double r34437289 = 18.0;
        double r34437290 = r34437288 * r34437289;
        double r34437291 = y;
        double r34437292 = r34437290 * r34437291;
        double r34437293 = z;
        double r34437294 = r34437292 * r34437293;
        double r34437295 = t;
        double r34437296 = r34437294 * r34437295;
        double r34437297 = a;
        double r34437298 = 4.0;
        double r34437299 = r34437297 * r34437298;
        double r34437300 = r34437299 * r34437295;
        double r34437301 = r34437296 - r34437300;
        double r34437302 = b;
        double r34437303 = c;
        double r34437304 = r34437302 * r34437303;
        double r34437305 = r34437301 + r34437304;
        double r34437306 = r34437288 * r34437298;
        double r34437307 = i;
        double r34437308 = r34437306 * r34437307;
        double r34437309 = r34437305 - r34437308;
        double r34437310 = j;
        double r34437311 = 27.0;
        double r34437312 = r34437310 * r34437311;
        double r34437313 = k;
        double r34437314 = r34437312 * r34437313;
        double r34437315 = r34437309 - r34437314;
        return r34437315;
}

double f(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
        double r34437316 = t;
        double r34437317 = x;
        double r34437318 = 18.0;
        double r34437319 = r34437317 * r34437318;
        double r34437320 = y;
        double r34437321 = r34437319 * r34437320;
        double r34437322 = z;
        double r34437323 = r34437321 * r34437322;
        double r34437324 = r34437316 * r34437323;
        double r34437325 = a;
        double r34437326 = 4.0;
        double r34437327 = r34437325 * r34437326;
        double r34437328 = r34437327 * r34437316;
        double r34437329 = r34437324 - r34437328;
        double r34437330 = c;
        double r34437331 = b;
        double r34437332 = r34437330 * r34437331;
        double r34437333 = r34437329 + r34437332;
        double r34437334 = r34437317 * r34437326;
        double r34437335 = i;
        double r34437336 = r34437334 * r34437335;
        double r34437337 = r34437333 - r34437336;
        double r34437338 = 27.0;
        double r34437339 = j;
        double r34437340 = r34437338 * r34437339;
        double r34437341 = k;
        double r34437342 = r34437340 * r34437341;
        double r34437343 = r34437337 - r34437342;
        double r34437344 = -inf.0;
        bool r34437345 = r34437343 <= r34437344;
        double r34437346 = r34437316 * r34437322;
        double r34437347 = r34437320 * r34437318;
        double r34437348 = r34437346 * r34437347;
        double r34437349 = r34437348 * r34437317;
        double r34437350 = r34437317 * r34437335;
        double r34437351 = fma(r34437316, r34437325, r34437350);
        double r34437352 = r34437341 * r34437339;
        double r34437353 = r34437352 * r34437338;
        double r34437354 = fma(r34437326, r34437351, r34437353);
        double r34437355 = r34437349 - r34437354;
        double r34437356 = fma(r34437331, r34437330, r34437355);
        double r34437357 = 2.0918175593925538e+304;
        bool r34437358 = r34437343 <= r34437357;
        double r34437359 = r34437358 ? r34437343 : r34437356;
        double r34437360 = r34437345 ? r34437356 : r34437359;
        return r34437360;
}

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

Target

Original5.3
Target1.6
Herbie0.8
\[\begin{array}{l} \mathbf{if}\;t \lt -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;\left(\left(18.0 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - \left(a \cdot t + i \cdot x\right) \cdot 4.0\right) - \left(\left(k \cdot j\right) \cdot 27.0 - c \cdot b\right)\\ \mathbf{elif}\;t \lt 165.68027943805222:\\ \;\;\;\;\left(\left(18.0 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - \left(a \cdot t + i \cdot x\right) \cdot 4.0\right) + \left(c \cdot b - 27.0 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(18.0 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - \left(a \cdot t + i \cdot x\right) \cdot 4.0\right) - \left(\left(k \cdot j\right) \cdot 27.0 - c \cdot b\right)\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < -inf.0 or 2.0918175593925538e+304 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k))

    1. Initial program 55.7

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
    2. Simplified14.5

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

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

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(t \cdot \left(x \cdot z\right)\right)} \cdot \left(y \cdot 18.0\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    6. Using strategy rm
    7. Applied add-cube-cbrt11.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{\left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right)} \cdot \left(y \cdot 18.0\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    8. Using strategy rm
    9. Applied pow111.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \left(y \cdot \color{blue}{{18.0}^{1}}\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    10. Applied pow111.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \left(\color{blue}{{y}^{1}} \cdot {18.0}^{1}\right) - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    11. Applied pow-prod-down11.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \color{blue}{{\left(y \cdot 18.0\right)}^{1}} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    12. Applied pow111.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}}\right) \cdot {\left(y \cdot 18.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    13. Applied pow111.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(y \cdot 18.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    14. Applied pow111.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\left(\color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(y \cdot 18.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    15. Applied pow-prod-down11.1

      \[\leadsto \mathsf{fma}\left(b, c, \left(\color{blue}{{\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(\sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}\right) \cdot {\left(y \cdot 18.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    16. Applied pow-prod-down11.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{{\left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right)}^{1}} \cdot {\left(y \cdot 18.0\right)}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    17. Applied pow-prod-down11.1

      \[\leadsto \mathsf{fma}\left(b, c, \color{blue}{{\left(\left(\left(\sqrt[3]{t \cdot \left(x \cdot z\right)} \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \sqrt[3]{t \cdot \left(x \cdot z\right)}\right) \cdot \left(y \cdot 18.0\right)\right)}^{1}} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]
    18. Simplified6.0

      \[\leadsto \mathsf{fma}\left(b, c, {\color{blue}{\left(x \cdot \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right)\right)}}^{1} - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), 27.0 \cdot \left(k \cdot j\right)\right)\right)\]

    if -inf.0 < (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)) < 2.0918175593925538e+304

    1. Initial program 0.2

      \[\left(\left(\left(\left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4.0\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(j \cdot 27.0\right) \cdot k\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k = -\infty:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \mathbf{elif}\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k \le 2.0918175593925538 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\left(t \cdot \left(\left(\left(x \cdot 18.0\right) \cdot y\right) \cdot z\right) - \left(a \cdot 4.0\right) \cdot t\right) + c \cdot b\right) - \left(x \cdot 4.0\right) \cdot i\right) - \left(27.0 \cdot j\right) \cdot k\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, c, \left(\left(t \cdot z\right) \cdot \left(y \cdot 18.0\right)\right) \cdot x - \mathsf{fma}\left(4.0, \mathsf{fma}\left(t, a, x \cdot i\right), \left(k \cdot j\right) \cdot 27.0\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"

  :herbie-target
  (if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))

  (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))