Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E

?

Percentage Accurate: 85.2% → 93.7%
Time: 33.8s
Precision: binary64
Cost: 27208

?

\[ \begin{array}{c}[y, z] = \mathsf{sort}([y, z])\\ [j, k] = \mathsf{sort}([j, k])\\ \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} t_1 := \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right)\\ \mathbf{if}\;t \leq -4 \cdot 10^{-39}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, t_1, b \cdot c\right)\right)\right)\\ \mathbf{elif}\;t \leq 10^{-84}:\\ \;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, t_1, \mathsf{fma}\left(b, c, \mathsf{fma}\left(x, i \cdot -4, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\ \end{array} \]
(FPCore (x y z t a b c i j k)
 :precision binary64
 (-
  (-
   (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
   (* (* x 4.0) i))
  (* (* j 27.0) k)))
(FPCore (x y z t a b c i j k)
 :precision binary64
 (let* ((t_1 (fma x (* 18.0 (* y z)) (* -4.0 a))))
   (if (<= t -4e-39)
     (fma j (* k -27.0) (fma x (* i -4.0) (fma t t_1 (* b c))))
     (if (<= t 1e-84)
       (-
        (-
         (+ (* b c) (* x (- (* 18.0 (* y (* t z))) (* i 4.0))))
         (* 4.0 (* t a)))
        (* k (* j 27.0)))
       (fma t t_1 (fma b c (fma x (* i -4.0) (* k (* j -27.0)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double t_1 = fma(x, (18.0 * (y * z)), (-4.0 * a));
	double tmp;
	if (t <= -4e-39) {
		tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, t_1, (b * c))));
	} else if (t <= 1e-84) {
		tmp = (((b * c) + (x * ((18.0 * (y * (t * z))) - (i * 4.0)))) - (4.0 * (t * a))) - (k * (j * 27.0));
	} else {
		tmp = fma(t, t_1, fma(b, c, fma(x, (i * -4.0), (k * (j * -27.0)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i, j, k)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k))
end
function code(x, y, z, t, a, b, c, i, j, k)
	t_1 = fma(x, Float64(18.0 * Float64(y * z)), Float64(-4.0 * a))
	tmp = 0.0
	if (t <= -4e-39)
		tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, t_1, Float64(b * c))));
	elseif (t <= 1e-84)
		tmp = Float64(Float64(Float64(Float64(b * c) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0)))) - Float64(4.0 * Float64(t * a))) - Float64(k * Float64(j * 27.0)));
	else
		tmp = fma(t, t_1, fma(b, c, fma(x, Float64(i * -4.0), Float64(k * Float64(j * -27.0)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e-39], N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * t$95$1 + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-84], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * t$95$1 + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\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}
t_1 := \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right)\\
\mathbf{if}\;t \leq -4 \cdot 10^{-39}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, t_1, b \cdot c\right)\right)\right)\\

\mathbf{elif}\;t \leq 10^{-84}:\\
\;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, t_1, \mathsf{fma}\left(b, c, \mathsf{fma}\left(x, i \cdot -4, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 27 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Target

Original85.2%
Target89.3%
Herbie93.7%
\[\begin{array}{l} \mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\ \;\;\;\;\left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - \left(a \cdot t + i \cdot x\right) \cdot 4\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \mathbf{elif}\;t < 165.68027943805222:\\ \;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - \left(a \cdot t + i \cdot x\right) \cdot 4\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - \left(a \cdot t + i \cdot x\right) \cdot 4\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\ \end{array} \]

Derivation?

  1. Split input into 3 regimes
  2. if t < -3.99999999999999972e-39

    1. Initial program 91.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. Simplified94.9%

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

      [Start]91.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 \]

      sub-neg [=>]91.0%

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

      +-commutative [=>]91.0%

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

      associate-*l* [=>]90.9%

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

      distribute-rgt-neg-in [=>]90.9%

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

      fma-def [=>]90.9%

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

      *-commutative [=>]90.9%

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

      distribute-rgt-neg-in [=>]90.9%

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

      metadata-eval [=>]90.9%

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

      sub-neg [=>]90.9%

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

      +-commutative [=>]90.9%

      \[ \mathsf{fma}\left(j, k \cdot -27, \color{blue}{\left(-\left(x \cdot 4\right) \cdot i\right) + \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)}\right) \]

      associate-*l* [=>]90.9%

      \[ \mathsf{fma}\left(j, k \cdot -27, \left(-\color{blue}{x \cdot \left(4 \cdot i\right)}\right) + \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)\right) \]

      distribute-rgt-neg-in [=>]90.9%

      \[ \mathsf{fma}\left(j, k \cdot -27, \color{blue}{x \cdot \left(-4 \cdot i\right)} + \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)\right) \]

    if -3.99999999999999972e-39 < t < 1e-84

    1. Initial program 85.1%

      \[\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. Taylor expanded in x around 0 93.7%

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

    if 1e-84 < t

    1. Initial program 82.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. Simplified91.4%

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

      [Start]82.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 \]

      associate--l- [=>]82.8%

      \[ \color{blue}{\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(\left(x \cdot 4\right) \cdot i + \left(j \cdot 27\right) \cdot k\right)} \]

      associate--l+ [=>]82.8%

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

      distribute-rgt-out-- [=>]85.3%

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

      fma-def [=>]87.8%

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

      associate-*l* [=>]87.7%

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

      associate-*l* [=>]89.0%

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

      fma-neg [=>]89.0%

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

      distribute-rgt-neg-in [=>]89.0%

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

      metadata-eval [=>]89.0%

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

      fma-neg [=>]90.2%

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

      distribute-neg-in [=>]90.2%

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

      associate-*l* [=>]90.2%

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

      distribute-rgt-neg-in [=>]90.2%

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

      fma-def [=>]91.4%

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

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

Alternatives

Alternative 1
Accuracy93.7%
Cost27208
\[\begin{array}{l} t_1 := \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right)\\ \mathbf{if}\;t \leq -4 \cdot 10^{-39}:\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, t_1, b \cdot c\right)\right)\right)\\ \mathbf{elif}\;t \leq 10^{-84}:\\ \;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, t_1, \mathsf{fma}\left(b, c, \mathsf{fma}\left(x, i \cdot -4, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy94.7%
Cost27209
\[\begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-39} \lor \neg \left(t \leq 10^{+30}\right):\\ \;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 3
Accuracy92.1%
Cost4036
\[\begin{array}{l} t_1 := \left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \end{array} \]
Alternative 4
Accuracy90.8%
Cost2120
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-37}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\ \mathbf{elif}\;t \leq 8.4 \cdot 10^{+39}:\\ \;\;\;\;\left(\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - 27 \cdot \left(j \cdot k\right)\\ \end{array} \]
Alternative 5
Accuracy84.6%
Cost2116
\[\begin{array}{l} \mathbf{if}\;j \cdot 27 \leq -2 \cdot 10^{+130}:\\ \;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - \left(4 \cdot \left(t \cdot a\right) + 27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\ \end{array} \]
Alternative 6
Accuracy62.3%
Cost1756
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a\right)\\ t_2 := b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\ t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{if}\;x \leq -1.9 \cdot 10^{+117}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-291}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;x \leq 1.16 \cdot 10^{-228}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-189}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.45 \cdot 10^{+179}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 7
Accuracy74.6%
Cost1744
\[\begin{array}{l} t_1 := \left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ t_2 := 27 \cdot \left(j \cdot k\right)\\ t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right) - t_2\\ \mathbf{if}\;x \leq -2 \cdot 10^{+117}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -5.6 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-144}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - t_2\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 8
Accuracy85.6%
Cost1737
\[\begin{array}{l} \mathbf{if}\;t \leq -1.66 \cdot 10^{-74} \lor \neg \left(t \leq 9.5 \cdot 10^{-22}\right):\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 9
Accuracy82.4%
Cost1736
\[\begin{array}{l} t_1 := 27 \cdot \left(j \cdot k\right)\\ \mathbf{if}\;z \leq -8.2 \cdot 10^{-41}:\\ \;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - t_1\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+17}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\ \end{array} \]
Alternative 10
Accuracy61.4%
Cost1624
\[\begin{array}{l} t_1 := 27 \cdot \left(j \cdot k\right)\\ t_2 := b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{if}\;j \leq -4.1 \cdot 10^{+211}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) - t_1\\ \mathbf{elif}\;j \leq -1.05 \cdot 10^{-72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -8.6 \cdot 10^{-180}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + -4 \cdot a\right)\\ \mathbf{elif}\;j \leq -2.5 \cdot 10^{-248}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -1.8 \cdot 10^{-294}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{elif}\;j \leq 1.95 \cdot 10^{-22}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;b \cdot c - t_1\\ \end{array} \]
Alternative 11
Accuracy51.2%
Cost1492
\[\begin{array}{l} t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{if}\;j \leq -7.5 \cdot 10^{+52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;j \leq -3.45 \cdot 10^{-248}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + -4 \cdot a\right)\\ \mathbf{elif}\;j \leq 1.36 \cdot 10^{-216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq 5.5 \cdot 10^{-126}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;j \leq 8.6 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Accuracy71.6%
Cost1490
\[\begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{+117} \lor \neg \left(x \leq 3.2 \cdot 10^{+31}\right) \land \left(x \leq 6.5 \cdot 10^{+72} \lor \neg \left(x \leq 6.8 \cdot 10^{+140}\right)\right):\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 13
Accuracy76.3%
Cost1481
\[\begin{array}{l} \mathbf{if}\;t \leq -400000000000 \lor \neg \left(t \leq 5.5 \cdot 10^{-21}\right):\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right) - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 14
Accuracy79.7%
Cost1481
\[\begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{-40} \lor \neg \left(z \leq 7.5 \cdot 10^{+101}\right):\\ \;\;\;\;\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 15
Accuracy33.1%
Cost1368
\[\begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ t_2 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \leq -8.4 \cdot 10^{+98}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2.2 \cdot 10^{-238}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;a \leq 7.4 \cdot 10^{-219}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-144}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 250:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;a \leq 4.7 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+70}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 16
Accuracy33.0%
Cost1368
\[\begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ t_2 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \leq -1.5 \cdot 10^{+99}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -1.2 \cdot 10^{-236}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\ \mathbf{elif}\;a \leq 3.75 \cdot 10^{-221}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;a \leq 7.8 \cdot 10^{-146}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 300:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;a \leq 1.55 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+69}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 17
Accuracy33.0%
Cost1368
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \leq -1.9 \cdot 10^{+99}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.7 \cdot 10^{-242}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-222}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-145}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;a \leq 290:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+34}:\\ \;\;\;\;t \cdot \left(\left(x \cdot z\right) \cdot \left(18 \cdot y\right)\right)\\ \mathbf{elif}\;a \leq 4.1 \cdot 10^{+68}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Accuracy44.3%
Cost1368
\[\begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;j \leq -4.1 \cdot 10^{+211}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;j \leq -2.1 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -5.8 \cdot 10^{-180}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\ \mathbf{elif}\;j \leq -1.35 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;j \leq -3 \cdot 10^{-295}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 9.5 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]
Alternative 19
Accuracy72.9%
Cost1356
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{if}\;x \leq -3.2 \cdot 10^{+117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+23}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+140}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 20
Accuracy47.9%
Cost1236
\[\begin{array}{l} t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\ t_2 := k \cdot \left(j \cdot -27\right) + -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{-40}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-123}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-49}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.7 \cdot 10^{+72}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+193}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(18 \cdot \left(x \cdot \left(t \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 21
Accuracy32.4%
Cost1104
\[\begin{array}{l} \mathbf{if}\;j \leq -2.15 \cdot 10^{+157}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;j \leq -2.16 \cdot 10^{+52}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;j \leq -5.5 \cdot 10^{-79}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;j \leq 9.5 \cdot 10^{-298}:\\ \;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\ \mathbf{elif}\;j \leq 5 \cdot 10^{-23}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;j \cdot \left(k \cdot -27\right)\\ \end{array} \]
Alternative 22
Accuracy51.0%
Cost1097
\[\begin{array}{l} \mathbf{if}\;j \leq -2.4 \cdot 10^{+52} \lor \neg \left(j \leq 4 \cdot 10^{-26}\right):\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + -4 \cdot a\right)\\ \end{array} \]
Alternative 23
Accuracy47.8%
Cost972
\[\begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-41}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(t \cdot \left(x \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-123}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{+193}:\\ \;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(18 \cdot \left(x \cdot \left(t \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 24
Accuracy32.3%
Cost850
\[\begin{array}{l} \mathbf{if}\;c \leq -11000000000000 \lor \neg \left(c \leq 3 \cdot 10^{+61}\right) \land \left(c \leq 2.8 \cdot 10^{+109} \lor \neg \left(c \leq 8.5 \cdot 10^{+190}\right)\right):\\ \;\;\;\;b \cdot c\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
Alternative 25
Accuracy31.2%
Cost716
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \leq -2.8 \cdot 10^{+135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-140}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{+67}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 26
Accuracy31.7%
Cost585
\[\begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{+171} \lor \neg \left(a \leq 2.7 \cdot 10^{+69}\right):\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \end{array} \]
Alternative 27
Accuracy23.4%
Cost192
\[b \cdot c \]

Reproduce?

herbie shell --seed 2023165 
(FPCore (x y z t a b c i j k)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, E"
  :precision binary64

  :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)))