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

?

Percentage Accurate: 84.8% → 90.7%
Time: 33.7s
Precision: binary64
Cost: 27076

?

\[\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} [j, k] = \mathsf{sort}([j, k])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 10^{-111}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \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)))
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
 :precision binary64
 (if (<= t 1e-111)
   (fma
    x
    (fma 18.0 (* t (* y z)) (* i -4.0))
    (fma t (* -4.0 a) (fma b c (* k (* j -27.0)))))
   (fma
    j
    (* k -27.0)
    (fma x (* i -4.0) (fma t (fma x (* 18.0 (* y z)) (* -4.0 a)) (* b c))))))
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);
}
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
	double tmp;
	if (t <= 1e-111) {
		tmp = fma(x, fma(18.0, (t * (y * z)), (i * -4.0)), fma(t, (-4.0 * a), fma(b, c, (k * (j * -27.0)))));
	} else {
		tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (-4.0 * a)), (b * c))));
	}
	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
j, k = sort([j, k])
function code(x, y, z, t, a, b, c, i, j, k)
	tmp = 0.0
	if (t <= 1e-111)
		tmp = fma(x, fma(18.0, Float64(t * Float64(y * z)), Float64(i * -4.0)), fma(t, Float64(-4.0 * a), fma(b, c, Float64(k * Float64(j * -27.0)))));
	else
		tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(-4.0 * a)), Float64(b * c))));
	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]
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, 1e-111], N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(-4.0 * a), $MachinePrecision] + N[(b * c + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * c), $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}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-111}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\end{array}
\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 28 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

Original84.8%
Target89.1%
Herbie90.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 2 regimes
  2. if t < 1.00000000000000009e-111

    1. Initial program 83.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. Simplified92.2%

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

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

      sub-neg [=>]83.7%

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

      +-commutative [=>]83.7%

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

      sub-neg [=>]83.7%

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

      associate-+l+ [=>]83.7%

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

      associate-+r+ [=>]83.7%

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

      associate--l+ [=>]83.7%

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

      +-commutative [<=]83.7%

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

      sub-neg [<=]83.7%

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

    if 1.00000000000000009e-111 < t

    1. Initial program 85.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. Simplified95.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]85.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 \]

      sub-neg [=>]85.8%

      \[ \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 [=>]85.8%

      \[ \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* [=>]85.8%

      \[ \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 [=>]85.8%

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

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

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

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

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

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

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

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

      \[ \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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.5%

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

Alternatives

Alternative 1
Accuracy90.7%
Cost27076
\[\begin{array}{l} \mathbf{if}\;t \leq 10^{-111}:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), \mathsf{fma}\left(t, -4 \cdot a, \mathsf{fma}\left(b, c, k \cdot \left(j \cdot -27\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
Alternative 2
Accuracy89.8%
Cost27076
\[\begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{+235}:\\ \;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \]
Alternative 3
Accuracy91.2%
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
Accuracy82.5%
Cost3025
\[\begin{array}{l} t_1 := y \cdot \left(x \cdot z\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{+175}:\\ \;\;\;\;t \cdot \left(-4 \cdot a - t_1 \cdot -18\right) - t_2\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{-5} \lor \neg \left(t_2 \leq 5 \cdot 10^{+119}\right):\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\right) - t_2\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot t_1 - a \cdot 4\right)\right) - 4 \cdot \left(x \cdot i\right)\\ \end{array} \]
Alternative 5
Accuracy79.9%
Cost2128
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := -27 \cdot \left(k \cdot j\right) + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right)\\ t_3 := x \cdot i + t \cdot a\\ \mathbf{if}\;x \leq -6.4 \cdot 10^{+52}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-211}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot t_3\right) - t_1\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-29}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - 4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-12}:\\ \;\;\;\;-4 \cdot t_3 - t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Accuracy80.9%
Cost2120
\[\begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+183}:\\ \;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+26}:\\ \;\;\;\;\left(b \cdot c - t \cdot \left(a \cdot 4 - \left(y \cdot z\right) \cdot \left(x \cdot 18\right)\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\ \end{array} \]
Alternative 7
Accuracy80.5%
Cost2000
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := 4 \cdot \left(x \cdot i\right)\\ t_3 := \left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - t_2\\ \mathbf{if}\;t \leq -2.05 \cdot 10^{+123}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{-22}:\\ \;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - t_2\right) - t_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{+93}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right) + \left(-4 \cdot \left(t \cdot a\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right)\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+182}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-4 \cdot a - y \cdot \left(z \cdot \left(x \cdot -18\right)\right)\right) - t_1\\ \end{array} \]
Alternative 8
Accuracy77.7%
Cost1745
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := t \cdot \left(-4 \cdot a - \left(y \cdot \left(x \cdot z\right)\right) \cdot -18\right) - t_1\\ \mathbf{if}\;t \leq -1.7 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-49}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\right) - t_1\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+45} \lor \neg \left(t \leq 3 \cdot 10^{+111}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \end{array} \]
Alternative 9
Accuracy77.7%
Cost1745
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := t \cdot \left(-4 \cdot a - y \cdot \left(z \cdot \left(x \cdot -18\right)\right)\right) - t_1\\ \mathbf{if}\;t \leq -4.2 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{-52}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\right) - t_1\\ \mathbf{elif}\;t \leq 8.5 \cdot 10^{+42} \lor \neg \left(t \leq 1.05 \cdot 10^{+111}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \end{array} \]
Alternative 10
Accuracy77.1%
Cost1744
\[\begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ t_2 := \left(b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;x \leq -4.2 \cdot 10^{+64}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+60}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+82}:\\ \;\;\;\;x \cdot t_1\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{+155}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t_1 - i \cdot 4\right)\\ \end{array} \]
Alternative 11
Accuracy77.1%
Cost1744
\[\begin{array}{l} t_1 := 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ t_2 := b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\right)\\ \mathbf{if}\;x \leq -3.65 \cdot 10^{+68}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{elif}\;x \leq 1.48 \cdot 10^{+57}:\\ \;\;\;\;t_2 - k \cdot \left(j \cdot 27\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+82}:\\ \;\;\;\;x \cdot t_1\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{+158}:\\ \;\;\;\;t_2 - j \cdot \left(k \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t_1 - i \cdot 4\right)\\ \end{array} \]
Alternative 12
Accuracy62.7%
Cost1620
\[\begin{array}{l} t_1 := x \cdot i + t \cdot a\\ t_2 := -4 \cdot t_1 - k \cdot \left(j \cdot 27\right)\\ t_3 := b \cdot c - 4 \cdot t_1\\ t_4 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{if}\;x \leq -3.7 \cdot 10^{+56}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-224}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-47}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 2.12 \cdot 10^{+55}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 13
Accuracy45.0%
Cost1500
\[\begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right) - 27 \cdot \left(k \cdot j\right)\\ t_2 := b \cdot c - k \cdot \left(j \cdot 27\right)\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{-31}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-221}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-69}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+76}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+114}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{+146}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 14
Accuracy45.0%
Cost1500
\[\begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right)\\ t_2 := k \cdot \left(j \cdot 27\right)\\ t_3 := b \cdot c - t_2\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{-31}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-220}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-172}:\\ \;\;\;\;t_1 - 27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-70}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+76}:\\ \;\;\;\;t_1 - t_2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+116}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+145}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 15
Accuracy69.5%
Cost1488
\[\begin{array}{l} t_1 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{if}\;t \leq -3 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 6200000:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\ \mathbf{elif}\;t \leq 3.7 \cdot 10^{+130}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{+244}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Accuracy69.4%
Cost1488
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot 27\right)\\ t_2 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{+27}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7500000:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - t_1\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{+130}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\ \mathbf{elif}\;t \leq 5.1 \cdot 10^{+244}:\\ \;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 17
Accuracy45.7%
Cost1364
\[\begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\ t_2 := \left(18 \cdot y\right) \cdot \left(z \cdot \left(t \cdot x\right)\right)\\ \mathbf{if}\;t \leq -3.2 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{-60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7 \cdot 10^{+48}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+190}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right) - 27 \cdot \left(k \cdot j\right)\\ \end{array} \]
Alternative 18
Accuracy45.7%
Cost1364
\[\begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\ t_2 := \left(18 \cdot y\right) \cdot \left(z \cdot \left(t \cdot x\right)\right)\\ \mathbf{if}\;t \leq -1.3 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{-61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+48}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8.8 \cdot 10^{+189}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-4 \cdot a\right) - k \cdot \left(j \cdot 27\right)\\ \end{array} \]
Alternative 19
Accuracy62.4%
Cost1360
\[\begin{array}{l} t_1 := b \cdot c - 4 \cdot \left(x \cdot i + t \cdot a\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 -2.3 \cdot 10^{+62}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-135}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-224}:\\ \;\;\;\;t \cdot \left(-4 \cdot a\right) - k \cdot \left(j \cdot 27\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+54}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 20
Accuracy71.2%
Cost1225
\[\begin{array}{l} \mathbf{if}\;t \leq -4.6 \cdot 10^{+29} \lor \neg \left(t \leq 7200000\right):\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\ \end{array} \]
Alternative 21
Accuracy45.7%
Cost1105
\[\begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{+34}:\\ \;\;\;\;\left(18 \cdot y\right) \cdot \left(z \cdot \left(t \cdot x\right)\right)\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-63}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+168} \lor \neg \left(t \leq 3.5 \cdot 10^{+244}\right):\\ \;\;\;\;x \cdot \left(18 \cdot \left(z \cdot \left(t \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \end{array} \]
Alternative 22
Accuracy35.2%
Cost1104
\[\begin{array}{l} t_1 := 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{if}\;k \leq -2.4 \cdot 10^{+60}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;k \leq 1.8 \cdot 10^{-268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;k \leq 9.5 \cdot 10^{-139}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;k \leq 3.1 \cdot 10^{+150}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \]
Alternative 23
Accuracy35.8%
Cost1104
\[\begin{array}{l} t_1 := \left(18 \cdot y\right) \cdot \left(z \cdot \left(t \cdot x\right)\right)\\ \mathbf{if}\;k \leq -3.9 \cdot 10^{+53}:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{elif}\;k \leq 3.65 \cdot 10^{-268}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;k \leq 9.5 \cdot 10^{-139}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;k \leq 1.8 \cdot 10^{+152}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \end{array} \]
Alternative 24
Accuracy57.4%
Cost1097
\[\begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{+19} \lor \neg \left(t \leq 1.8 \cdot 10^{-66}\right):\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\ \end{array} \]
Alternative 25
Accuracy46.4%
Cost972
\[\begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+240}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;x \leq -2 \cdot 10^{+89}:\\ \;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+54}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 26
Accuracy33.5%
Cost584
\[\begin{array}{l} \mathbf{if}\;b \leq -7.8 \cdot 10^{+46}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \leq 15000000:\\ \;\;\;\;-27 \cdot \left(k \cdot j\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 27
Accuracy30.9%
Cost584
\[\begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+45}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-37}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 28
Accuracy23.6%
Cost192
\[b \cdot c \]

Reproduce?

herbie shell --seed 2023167 
(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)))