Average Error: 6.1 → 2.0
Time: 28.0s
Precision: binary64
Cost: 2248
\[ \begin{array}{c}[y, z] = \mathsf{sort}([y, z])\\ \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 := k \cdot \left(j \cdot -27\right)\\ t_2 := \left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) + t \cdot \left(a \cdot -4\right)\right) + b \cdot c\right) + i \cdot \left(x \cdot -4\right)\right) + t_1\\ \mathbf{if}\;t \leq -4 \cdot 10^{+83}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 10^{-40}:\\ \;\;\;\;\left(b \cdot c + \left(x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right) + -4 \cdot \left(t \cdot a\right)\right)\right) + t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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 (* k (* j -27.0)))
        (t_2
         (+
          (+
           (+ (+ (* t (* (* (* x 18.0) y) z)) (* t (* a -4.0))) (* b c))
           (* i (* x -4.0)))
          t_1)))
   (if (<= t -4e+83)
     t_2
     (if (<= t 1e-40)
       (+
        (+
         (* b c)
         (+ (* x (+ (* 18.0 (* y (* t z))) (* i -4.0))) (* -4.0 (* t a))))
        t_1)
       t_2))))
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 = k * (j * -27.0);
	double t_2 = ((((t * (((x * 18.0) * y) * z)) + (t * (a * -4.0))) + (b * c)) + (i * (x * -4.0))) + t_1;
	double tmp;
	if (t <= -4e+83) {
		tmp = t_2;
	} else if (t <= 1e-40) {
		tmp = ((b * c) + ((x * ((18.0 * (y * (t * z))) + (i * -4.0))) + (-4.0 * (t * a)))) + t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
real(8) function code(x, y, z, t, a, b, c, i, j, k)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8), intent (in) :: j
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = k * (j * (-27.0d0))
    t_2 = ((((t * (((x * 18.0d0) * y) * z)) + (t * (a * (-4.0d0)))) + (b * c)) + (i * (x * (-4.0d0)))) + t_1
    if (t <= (-4d+83)) then
        tmp = t_2
    else if (t <= 1d-40) then
        tmp = ((b * c) + ((x * ((18.0d0 * (y * (t * z))) + (i * (-4.0d0)))) + ((-4.0d0) * (t * a)))) + t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static 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);
}
public static 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 = k * (j * -27.0);
	double t_2 = ((((t * (((x * 18.0) * y) * z)) + (t * (a * -4.0))) + (b * c)) + (i * (x * -4.0))) + t_1;
	double tmp;
	if (t <= -4e+83) {
		tmp = t_2;
	} else if (t <= 1e-40) {
		tmp = ((b * c) + ((x * ((18.0 * (y * (t * z))) + (i * -4.0))) + (-4.0 * (t * a)))) + t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k):
	return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
def code(x, y, z, t, a, b, c, i, j, k):
	t_1 = k * (j * -27.0)
	t_2 = ((((t * (((x * 18.0) * y) * z)) + (t * (a * -4.0))) + (b * c)) + (i * (x * -4.0))) + t_1
	tmp = 0
	if t <= -4e+83:
		tmp = t_2
	elif t <= 1e-40:
		tmp = ((b * c) + ((x * ((18.0 * (y * (t * z))) + (i * -4.0))) + (-4.0 * (t * a)))) + t_1
	else:
		tmp = t_2
	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 = Float64(k * Float64(j * -27.0))
	t_2 = Float64(Float64(Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * y) * z)) + Float64(t * Float64(a * -4.0))) + Float64(b * c)) + Float64(i * Float64(x * -4.0))) + t_1)
	tmp = 0.0
	if (t <= -4e+83)
		tmp = t_2;
	elseif (t <= 1e-40)
		tmp = Float64(Float64(Float64(b * c) + Float64(Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) + Float64(i * -4.0))) + Float64(-4.0 * Float64(t * a)))) + t_1);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b, c, i, j, k)
	tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
	t_1 = k * (j * -27.0);
	t_2 = ((((t * (((x * 18.0) * y) * z)) + (t * (a * -4.0))) + (b * c)) + (i * (x * -4.0))) + t_1;
	tmp = 0.0;
	if (t <= -4e+83)
		tmp = t_2;
	elseif (t <= 1e-40)
		tmp = ((b * c) + ((x * ((18.0 * (y * (t * z))) + (i * -4.0))) + (-4.0 * (t * a)))) + t_1;
	else
		tmp = t_2;
	end
	tmp_2 = 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[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, -4e+83], t$95$2, If[LessEqual[t, 1e-40], N[(N[(N[(b * c), $MachinePrecision] + N[(N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]
\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 := k \cdot \left(j \cdot -27\right)\\
t_2 := \left(\left(\left(t \cdot \left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) + t \cdot \left(a \cdot -4\right)\right) + b \cdot c\right) + i \cdot \left(x \cdot -4\right)\right) + t_1\\
\mathbf{if}\;t \leq -4 \cdot 10^{+83}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.1
Target1.6
Herbie2.0
\[\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 < -4.00000000000000012e83 or 9.9999999999999993e-41 < t

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

    if -4.00000000000000012e83 < t < 9.9999999999999993e-41

    1. Initial program 8.2

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, \mathsf{fma}\left(x \cdot 18, y \cdot z, a \cdot -4\right), \mathsf{fma}\left(b, c, i \cdot \left(x \cdot -4\right)\right)\right) + k \cdot \left(j \cdot -27\right)} \]
      Proof
      (+.f64 (fma.f64 t (fma.f64 (*.f64 x 18) (*.f64 y z) (*.f64 a -4)) (fma.f64 b c (*.f64 i (*.f64 x -4)))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (fma.f64 (*.f64 x 18) (*.f64 y z) (*.f64 a (Rewrite<= metadata-eval (neg.f64 4)))) (fma.f64 b c (*.f64 i (*.f64 x -4)))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (fma.f64 (*.f64 x 18) (*.f64 y z) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a 4)))) (fma.f64 b c (*.f64 i (*.f64 x -4)))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (*.f64 x 18) (*.f64 y z)) (*.f64 a 4))) (fma.f64 b c (*.f64 i (*.f64 x -4)))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 x 18) y) z)) (*.f64 a 4)) (fma.f64 b c (*.f64 i (*.f64 x -4)))) (*.f64 k (*.f64 j -27))): 14 points increase in error, 9 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4)) (fma.f64 b c (*.f64 i (*.f64 x (Rewrite<= metadata-eval (neg.f64 4)))))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4)) (fma.f64 b c (*.f64 i (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 x 4)))))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4)) (fma.f64 b c (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 (*.f64 x 4)) i)))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4)) (fma.f64 b c (Rewrite=> distribute-lft-neg-out_binary64 (neg.f64 (*.f64 (*.f64 x 4) i))))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4)) (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 b c) (*.f64 (*.f64 x 4) i)))) (*.f64 k (*.f64 j -27))): 1 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 t (-.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) (*.f64 a 4))) (-.f64 (*.f64 b c) (*.f64 (*.f64 x 4) i)))) (*.f64 k (*.f64 j -27))): 2 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t))) (-.f64 (*.f64 b c) (*.f64 (*.f64 x 4) i))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i))) (*.f64 k (*.f64 j -27))): 0 points increase in error, 1 points decrease in error
      (+.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 k (*.f64 j (Rewrite<= metadata-eval (neg.f64 27))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 k (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 j 27))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (Rewrite<= *-commutative_binary64 (*.f64 (neg.f64 (*.f64 j 27)) k))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (Rewrite=> distribute-lft-neg-out_binary64 (neg.f64 (*.f64 (*.f64 j 27) k)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= sub-neg_binary64 (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in x around 0 1.9

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

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

Alternatives

Alternative 1
Error31.9
Cost2812
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := b \cdot c + t_1\\ t_3 := t_1 + -27 \cdot \left(j \cdot k\right)\\ t_4 := b \cdot c + -4 \cdot \left(x \cdot i\right)\\ t_5 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\ t_6 := k \cdot \left(j \cdot -27\right)\\ t_7 := t_6 + x \cdot \left(i \cdot -4\right)\\ t_8 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\\ \mathbf{if}\;b \leq -8 \cdot 10^{+120}:\\ \;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;b \leq -1.02 \cdot 10^{+87}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b \leq -3100:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -5.1 \cdot 10^{-95}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{-123}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -2.35 \cdot 10^{-139}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -2.7 \cdot 10^{-174}:\\ \;\;\;\;t_1 + t_6\\ \mathbf{elif}\;b \leq -7.5 \cdot 10^{-253}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-281}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -5.2 \cdot 10^{-297}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-306}:\\ \;\;\;\;t_8\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{-142}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-102}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq 1.08 \cdot 10^{-52}:\\ \;\;\;\;t_8\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + t_6\\ \end{array} \]
Alternative 2
Error31.9
Cost2812
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := b \cdot c + t_1\\ t_3 := t_1 + -27 \cdot \left(j \cdot k\right)\\ t_4 := b \cdot c + -4 \cdot \left(x \cdot i\right)\\ t_5 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\ t_6 := k \cdot \left(j \cdot -27\right)\\ t_7 := t_6 + x \cdot \left(i \cdot -4\right)\\ \mathbf{if}\;b \leq -2.6 \cdot 10^{+121}:\\ \;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{+87}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b \leq -3400:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-94}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-123}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -2.35 \cdot 10^{-139}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-173}:\\ \;\;\;\;t_1 + t_6\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-253}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b \leq -6 \cdot 10^{-281}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -2.25 \cdot 10^{-297}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;b \leq -2 \cdot 10^{-309}:\\ \;\;\;\;t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + a \cdot -4\right)\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-144}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.32 \cdot 10^{-93}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq 3.45 \cdot 10^{-56}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + t_6\\ \end{array} \]
Alternative 3
Error4.1
Cost2120
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := k \cdot \left(j \cdot -27\right)\\ t_3 := \left(b \cdot c + \left(x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right) + t_1\right)\right) + t_2\\ \mathbf{if}\;x \leq -2 \cdot 10^{-106}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 10^{-111}:\\ \;\;\;\;t_2 + \left(b \cdot c + \left(t_1 + -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error3.8
Cost2120
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := k \cdot \left(j \cdot -27\right)\\ \mathbf{if}\;t \leq -3.8 \cdot 10^{+83}:\\ \;\;\;\;t_2 + \left(b \cdot c + \left(t_1 + -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{elif}\;t \leq 10^{-73}:\\ \;\;\;\;\left(b \cdot c + \left(x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right) + t_1\right)\right) + t_2\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\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 5
Error31.5
Cost2024
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := b \cdot c + t_1\\ t_3 := b \cdot c + j \cdot \left(k \cdot -27\right)\\ t_4 := b \cdot c + -4 \cdot \left(x \cdot i\right)\\ t_5 := k \cdot \left(j \cdot -27\right) + x \cdot \left(i \cdot -4\right)\\ \mathbf{if}\;x \leq -7.2 \cdot 10^{+116}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq -8 \cdot 10^{+34}:\\ \;\;\;\;t_1 + -27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-42}:\\ \;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-92}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-196}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -1.38 \cdot 10^{-306}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-252}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+46}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+102}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_5\\ \end{array} \]
Alternative 6
Error32.0
Cost1892
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := t_1 + -27 \cdot \left(j \cdot k\right)\\ t_3 := b \cdot c + t_1\\ t_4 := b \cdot c + -4 \cdot \left(x \cdot i\right)\\ t_5 := b \cdot c + j \cdot \left(k \cdot -27\right)\\ \mathbf{if}\;x \leq -7.6 \cdot 10^{+116}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{+35}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-40}:\\ \;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{-92}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-196}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x \leq -3.6 \cdot 10^{-307}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-254}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x \leq 8.6 \cdot 10^{-69}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 1.35 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 7
Error20.8
Cost1884
\[\begin{array}{l} t_1 := b \cdot c + \left(-4 \cdot \left(t \cdot a\right) + -27 \cdot \left(j \cdot k\right)\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^{+176}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{+87}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{+32}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-36}:\\ \;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+25}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{+149}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error19.0
Cost1884
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := -4 \cdot \left(x \cdot i\right)\\ t_3 := k \cdot \left(j \cdot -27\right)\\ t_4 := t_3 + \left(b \cdot c + t_2\right)\\ t_5 := t_3 + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ t_6 := b \cdot c + \left(t_1 + t_2\right)\\ \mathbf{if}\;i \leq -2.4 \cdot 10^{+88}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;i \leq -5.5 \cdot 10^{-129}:\\ \;\;\;\;t_6\\ \mathbf{elif}\;i \leq -8.5 \cdot 10^{-147}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;i \leq 1.45 \cdot 10^{-49}:\\ \;\;\;\;b \cdot c + \left(t_1 + -27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{elif}\;i \leq 0.049:\\ \;\;\;\;t_6\\ \mathbf{elif}\;i \leq 140000000:\\ \;\;\;\;t_5\\ \mathbf{elif}\;i \leq 3.7 \cdot 10^{+166}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_6\\ \end{array} \]
Alternative 9
Error11.1
Cost1864
\[\begin{array}{l} \mathbf{if}\;b \cdot c \leq -1 \cdot 10^{-54}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right) + \left(b \cdot c + \left(-4 \cdot \left(t \cdot a\right) + -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{elif}\;b \cdot c \leq -8 \cdot 10^{-113}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + a \cdot \left(t \cdot -4\right)\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \end{array} \]
Alternative 10
Error9.6
Cost1864
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ \mathbf{if}\;y \leq 1.6 \cdot 10^{-38}:\\ \;\;\;\;t_1 + \left(b \cdot c + \left(-4 \cdot \left(t \cdot a\right) + -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+160}:\\ \;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\ \end{array} \]
Alternative 11
Error31.6
Cost1764
\[\begin{array}{l} t_1 := b \cdot c + k \cdot \left(j \cdot -27\right)\\ t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{if}\;i \leq -3.1 \cdot 10^{-82}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;i \leq -4.8 \cdot 10^{-130}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq -1.85 \cdot 10^{-184}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq -6 \cdot 10^{-273}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;i \leq 2.5 \cdot 10^{-48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq 5.6 \cdot 10^{-8}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq 1.4 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq 5.5 \cdot 10^{+113}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq 2.9 \cdot 10^{+167}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error31.6
Cost1764
\[\begin{array}{l} t_1 := b \cdot c + k \cdot \left(j \cdot -27\right)\\ t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{if}\;i \leq -2.6 \cdot 10^{-82}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i\right)\\ \mathbf{elif}\;i \leq -2.5 \cdot 10^{-130}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq -6 \cdot 10^{-185}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq -3.5 \cdot 10^{-273}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;i \leq 1.25 \cdot 10^{-48}:\\ \;\;\;\;b \cdot c + j \cdot \left(k \cdot -27\right)\\ \mathbf{elif}\;i \leq 1.9 \cdot 10^{-10}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq 5.5 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq 5 \cdot 10^{+113}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;i \leq 7 \cdot 10^{+166}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error9.4
Cost1732
\[\begin{array}{l} \mathbf{if}\;y \leq 5.6 \cdot 10^{-37}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right) + \left(b \cdot c + \left(-4 \cdot \left(t \cdot a\right) + -4 \cdot \left(x \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + 18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \end{array} \]
Alternative 14
Error19.7
Cost1488
\[\begin{array}{l} t_1 := -4 \cdot \left(t \cdot a\right)\\ t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\\ t_3 := b \cdot c + \left(t_1 + -27 \cdot \left(j \cdot k\right)\right)\\ \mathbf{if}\;x \leq -2.25 \cdot 10^{-122}:\\ \;\;\;\;b \cdot c + \left(t_1 + -4 \cdot \left(x \cdot i\right)\right)\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-14}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{+175}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error9.7
Cost1344
\[k \cdot \left(j \cdot -27\right) + \left(b \cdot c + \left(-4 \cdot \left(t \cdot a\right) + -4 \cdot \left(x \cdot i\right)\right)\right) \]
Alternative 16
Error44.8
Cost1244
\[\begin{array}{l} t_1 := x \cdot \left(i \cdot -4\right)\\ t_2 := -27 \cdot \left(j \cdot k\right)\\ \mathbf{if}\;c \leq -1.62 \cdot 10^{-78}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -5.6 \cdot 10^{-229}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -5.5 \cdot 10^{-271}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 9.5 \cdot 10^{-307}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 10^{-129}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right)\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+80}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 17
Error31.9
Cost1236
\[\begin{array}{l} t_1 := b \cdot c + -4 \cdot \left(t \cdot a\right)\\ t_2 := b \cdot c + -4 \cdot \left(x \cdot i\right)\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{+141}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -8.6 \cdot 10^{-22}:\\ \;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-150}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{-82}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 18
Error33.0
Cost1104
\[\begin{array}{l} t_1 := b \cdot c + -4 \cdot \left(t \cdot a\right)\\ t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{if}\;x \leq -1.12 \cdot 10^{-36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-122}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-149}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+93}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 19
Error45.3
Cost980
\[\begin{array}{l} t_1 := -27 \cdot \left(j \cdot k\right)\\ t_2 := -4 \cdot \left(t \cdot a\right)\\ \mathbf{if}\;a \leq -9 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-202}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-112}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{-43}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;a \leq 2.25 \cdot 10^{+228}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 20
Error37.5
Cost840
\[\begin{array}{l} \mathbf{if}\;c \leq -1.9 \cdot 10^{-78}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+115}:\\ \;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 21
Error45.3
Cost584
\[\begin{array}{l} \mathbf{if}\;c \leq -2.6 \cdot 10^{-238}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq 1.05 \cdot 10^{+81}:\\ \;\;\;\;-27 \cdot \left(j \cdot k\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 22
Error48.6
Cost192
\[b \cdot c \]

Error

Reproduce

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