Average Error: 5.4 → 1.2
Time: 38.5s
Precision: binary64
Cost: 5320
\[ \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 := k \cdot \left(j \cdot -27\right)\\ t_2 := t \cdot \left(a \cdot -4\right)\\ t_3 := i \cdot \left(x \cdot -4\right)\\ t_4 := \left(\left(t_2 - t \cdot \left(z \cdot \left(y \cdot \left(x \cdot -18\right)\right)\right)\right) + b \cdot c\right) + t_3\\ \mathbf{if}\;t_4 \leq -2 \cdot 10^{+294}:\\ \;\;\;\;\left(\left(\left(\left(z \cdot \left(x \cdot t\right)\right) \cdot \left(18 \cdot y\right) + t_2\right) + b \cdot c\right) + t_3\right) + t_1\\ \mathbf{elif}\;t_4 \leq 10^{+306}:\\ \;\;\;\;t_4 + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) + b \cdot c\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\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 (* k (* j -27.0)))
        (t_2 (* t (* a -4.0)))
        (t_3 (* i (* x -4.0)))
        (t_4 (+ (+ (- t_2 (* t (* z (* y (* x -18.0))))) (* b c)) t_3)))
   (if (<= t_4 -2e+294)
     (+ (+ (+ (+ (* (* z (* x t)) (* 18.0 y)) t_2) (* b c)) t_3) t_1)
     (if (<= t_4 1e+306)
       (+ t_4 t_1)
       (+
        (+ (* x (* (* y t) (* 18.0 z))) (* b c))
        (+ (* x (* i -4.0)) (* j (* k -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 = k * (j * -27.0);
	double t_2 = t * (a * -4.0);
	double t_3 = i * (x * -4.0);
	double t_4 = ((t_2 - (t * (z * (y * (x * -18.0))))) + (b * c)) + t_3;
	double tmp;
	if (t_4 <= -2e+294) {
		tmp = (((((z * (x * t)) * (18.0 * y)) + t_2) + (b * c)) + t_3) + t_1;
	} else if (t_4 <= 1e+306) {
		tmp = t_4 + t_1;
	} else {
		tmp = ((x * ((y * t) * (18.0 * z))) + (b * c)) + ((x * (i * -4.0)) + (j * (k * -27.0)));
	}
	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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = k * (j * (-27.0d0))
    t_2 = t * (a * (-4.0d0))
    t_3 = i * (x * (-4.0d0))
    t_4 = ((t_2 - (t * (z * (y * (x * (-18.0d0)))))) + (b * c)) + t_3
    if (t_4 <= (-2d+294)) then
        tmp = (((((z * (x * t)) * (18.0d0 * y)) + t_2) + (b * c)) + t_3) + t_1
    else if (t_4 <= 1d+306) then
        tmp = t_4 + t_1
    else
        tmp = ((x * ((y * t) * (18.0d0 * z))) + (b * c)) + ((x * (i * (-4.0d0))) + (j * (k * (-27.0d0))))
    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 * (a * -4.0);
	double t_3 = i * (x * -4.0);
	double t_4 = ((t_2 - (t * (z * (y * (x * -18.0))))) + (b * c)) + t_3;
	double tmp;
	if (t_4 <= -2e+294) {
		tmp = (((((z * (x * t)) * (18.0 * y)) + t_2) + (b * c)) + t_3) + t_1;
	} else if (t_4 <= 1e+306) {
		tmp = t_4 + t_1;
	} else {
		tmp = ((x * ((y * t) * (18.0 * z))) + (b * c)) + ((x * (i * -4.0)) + (j * (k * -27.0)));
	}
	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 * (a * -4.0)
	t_3 = i * (x * -4.0)
	t_4 = ((t_2 - (t * (z * (y * (x * -18.0))))) + (b * c)) + t_3
	tmp = 0
	if t_4 <= -2e+294:
		tmp = (((((z * (x * t)) * (18.0 * y)) + t_2) + (b * c)) + t_3) + t_1
	elif t_4 <= 1e+306:
		tmp = t_4 + t_1
	else:
		tmp = ((x * ((y * t) * (18.0 * z))) + (b * c)) + ((x * (i * -4.0)) + (j * (k * -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 = Float64(k * Float64(j * -27.0))
	t_2 = Float64(t * Float64(a * -4.0))
	t_3 = Float64(i * Float64(x * -4.0))
	t_4 = Float64(Float64(Float64(t_2 - Float64(t * Float64(z * Float64(y * Float64(x * -18.0))))) + Float64(b * c)) + t_3)
	tmp = 0.0
	if (t_4 <= -2e+294)
		tmp = Float64(Float64(Float64(Float64(Float64(Float64(z * Float64(x * t)) * Float64(18.0 * y)) + t_2) + Float64(b * c)) + t_3) + t_1);
	elseif (t_4 <= 1e+306)
		tmp = Float64(t_4 + t_1);
	else
		tmp = Float64(Float64(Float64(x * Float64(Float64(y * t) * Float64(18.0 * z))) + Float64(b * c)) + Float64(Float64(x * Float64(i * -4.0)) + Float64(j * Float64(k * -27.0))));
	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 * (a * -4.0);
	t_3 = i * (x * -4.0);
	t_4 = ((t_2 - (t * (z * (y * (x * -18.0))))) + (b * c)) + t_3;
	tmp = 0.0;
	if (t_4 <= -2e+294)
		tmp = (((((z * (x * t)) * (18.0 * y)) + t_2) + (b * c)) + t_3) + t_1;
	elseif (t_4 <= 1e+306)
		tmp = t_4 + t_1;
	else
		tmp = ((x * ((y * t) * (18.0 * z))) + (b * c)) + ((x * (i * -4.0)) + (j * (k * -27.0)));
	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[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 - N[(t * N[(z * N[(y * N[(x * -18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+294], N[(N[(N[(N[(N[(N[(z * N[(x * t), $MachinePrecision]), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 1e+306], N[(t$95$4 + t$95$1), $MachinePrecision], N[(N[(N[(x * N[(N[(y * t), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * -27.0), $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 := k \cdot \left(j \cdot -27\right)\\
t_2 := t \cdot \left(a \cdot -4\right)\\
t_3 := i \cdot \left(x \cdot -4\right)\\
t_4 := \left(\left(t_2 - t \cdot \left(z \cdot \left(y \cdot \left(x \cdot -18\right)\right)\right)\right) + b \cdot c\right) + t_3\\
\mathbf{if}\;t_4 \leq -2 \cdot 10^{+294}:\\
\;\;\;\;\left(\left(\left(\left(z \cdot \left(x \cdot t\right)\right) \cdot \left(18 \cdot y\right) + t_2\right) + b \cdot c\right) + t_3\right) + t_1\\

\mathbf{elif}\;t_4 \leq 10^{+306}:\\
\;\;\;\;t_4 + t_1\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) + b \cdot c\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.4
Target1.6
Herbie1.2
\[\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 (-.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)) < -2.00000000000000013e294

    1. Initial program 40.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. Taylor expanded in x around 0 11.5

      \[\leadsto \left(\left(\left(\color{blue}{18 \cdot \left(y \cdot \left(t \cdot \left(z \cdot x\right)\right)\right)} - \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 \]
    3. Simplified7.8

      \[\leadsto \left(\left(\left(\color{blue}{\left(z \cdot \left(t \cdot x\right)\right) \cdot \left(18 \cdot y\right)} - \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 \]
      Proof
      (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 z (*.f64 t x)) (*.f64 18 y)) (*.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
      (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 z t) x)) (*.f64 18 y)) (*.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
      (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 t z)) x) (*.f64 18 y)) (*.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
      (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (Rewrite<= associate-*r*_binary64 (*.f64 t (*.f64 z x))) (*.f64 18 y)) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)): 4 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (+.f64 (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 18 y) (*.f64 t (*.f64 z x)))) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)): 2 points increase in error, 1 points decrease in error
      (-.f64 (-.f64 (+.f64 (-.f64 (Rewrite<= associate-*r*_binary64 (*.f64 18 (*.f64 y (*.f64 t (*.f64 z x))))) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)): 0 points increase in error, 6 points decrease in error

    if -2.00000000000000013e294 < (-.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)) < 1.00000000000000002e306

    1. Initial program 0.4

      \[\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 1.00000000000000002e306 < (-.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))

    1. Initial program 58.6

      \[\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \]
    2. Simplified38.0

      \[\leadsto \color{blue}{\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + b \cdot c\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)} \]
      Proof
      (-.f64 (+.f64 (*.f64 t (-.f64 (*.f64 (*.f64 x 18) (*.f64 y z)) (*.f64 a 4))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 t (-.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 x 18) y) z)) (*.f64 a 4))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 12 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 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (Rewrite=> sub-neg_binary64 (+.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (neg.f64 (*.f64 (*.f64 a 4) t)))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 16 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 (*.f64 (*.f64 a 4) t)) (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 1 points decrease in error
      (-.f64 (+.f64 (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 (*.f64 a 4) t))) (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t)) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 16 points decrease in error
      (-.f64 (+.f64 (Rewrite=> associate-+l-_binary64 (-.f64 0 (-.f64 (*.f64 (*.f64 a 4) t) (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t)))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 (*.f64 (*.f64 a 4) t)) (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (*.f64 (*.f64 a 4) t))) (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t)) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 4 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (neg.f64 (*.f64 (*.f64 a 4) t)))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 4 points decrease in error
      (-.f64 (+.f64 (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite=> associate-+l-_binary64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (-.f64 (*.f64 (*.f64 a 4) t) (*.f64 b c)))) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (-.f64 (*.f64 (*.f64 a 4) t) (*.f64 b c))) (+.f64 (*.f64 x (*.f64 4 i)) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 j 27) k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (-.f64 (*.f64 (*.f64 a 4) t) (*.f64 b c))) (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k))): 0 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c))) (+.f64 (*.f64 (*.f64 x 4) i) (*.f64 (*.f64 j 27) k))): 12 points increase in error, 0 points decrease in error
      (Rewrite<= associate--l-_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, 12 points decrease in error
    3. Taylor expanded in x around inf 14.7

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

      \[\leadsto \left(\color{blue}{\left(\left(y \cdot t\right) \cdot \left(z \cdot 18\right)\right) \cdot x} + b \cdot c\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right) \]
      Proof
      (-.f64 (+.f64 (*.f64 (*.f64 (*.f64 y t) (*.f64 z 18)) x) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (*.f64 y t) z) 18)) x) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 8 points decrease in error
      (-.f64 (+.f64 (*.f64 (*.f64 (Rewrite<= associate-*r*_binary64 (*.f64 y (*.f64 t z))) 18) x) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 18 (*.f64 y (*.f64 t z)))) x) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 7 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (*.f64 (Rewrite=> associate-*r*_binary64 (*.f64 (*.f64 18 y) (*.f64 t z))) x) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 1 points increase in error, 6 points decrease in error
      (-.f64 (+.f64 (Rewrite<= associate-*r*_binary64 (*.f64 (*.f64 18 y) (*.f64 (*.f64 t z) x))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 8 points decrease in error
      (-.f64 (+.f64 (*.f64 (*.f64 18 y) (Rewrite<= associate-*r*_binary64 (*.f64 t (*.f64 z x)))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 8 points increase in error, 0 points decrease in error
      (-.f64 (+.f64 (Rewrite<= associate-*r*_binary64 (*.f64 18 (*.f64 y (*.f64 t (*.f64 z x))))) (*.f64 b c)) (+.f64 (*.f64 x (*.f64 4 i)) (*.f64 j (*.f64 27 k)))): 0 points increase in error, 8 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification1.2

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

Alternatives

Alternative 1
Error10.7
Cost2513
\[\begin{array}{l} \mathbf{if}\;j \cdot 27 \leq -1 \cdot 10^{+203}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{elif}\;j \cdot 27 \leq -1 \cdot 10^{+128} \lor \neg \left(j \cdot 27 \leq 10^{-187}\right) \land j \cdot 27 \leq 5 \cdot 10^{-77}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + a \cdot -4\right)\right) + \left(j \cdot k\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\right) + k \cdot \left(j \cdot -27\right)\\ \end{array} \]
Alternative 2
Error9.3
Cost2260
\[\begin{array}{l} t_1 := \left(b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\right) + k \cdot \left(j \cdot -27\right)\\ t_2 := x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\\ t_3 := \left(x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) + b \cdot c\right) + t_2\\ \mathbf{if}\;y \leq -4 \cdot 10^{+244}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) + a \cdot -4\right)\right) + \left(j \cdot k\right) \cdot -27\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+196}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{+163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{+144}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-79}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(x \cdot z\right)\right) + b \cdot c\right) + t_2\\ \end{array} \]
Alternative 3
Error2.0
Cost2249
\[\begin{array}{l} \mathbf{if}\;t \leq -3.2 \cdot 10^{+36} \lor \neg \left(t \leq 3 \cdot 10^{+23}\right):\\ \;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) + a \cdot -4\right) + b \cdot c\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(z \cdot \left(x \cdot t\right)\right) \cdot \left(18 \cdot y\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} \]
Alternative 4
Error31.7
Cost2156
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ t_2 := -4 \cdot \left(x \cdot i\right) + t_1\\ t_3 := -4 \cdot \left(t \cdot a\right) + t_1\\ t_4 := b \cdot c + t_1\\ \mathbf{if}\;b \leq -5.5 \cdot 10^{+205}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -1.15 \cdot 10^{+201}:\\ \;\;\;\;t \cdot \left(a \cdot -4 - y \cdot \left(z \cdot \left(x \cdot -18\right)\right)\right)\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{+80}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -1.95 \cdot 10^{-35}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -1.8 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{-118}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -3 \cdot 10^{-210}:\\ \;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) + i \cdot -4\right)\\ \mathbf{elif}\;b \leq -1.16 \cdot 10^{-235}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 9.8 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-93}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-46}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 5
Error5.2
Cost2120
\[\begin{array}{l} t_1 := x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\\ \mathbf{if}\;z \leq -80000000000000:\\ \;\;\;\;\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(x \cdot z\right)\right) + b \cdot c\right) + t_1\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+234}:\\ \;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) + a \cdot -4\right) + b \cdot c\right) + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right) + b \cdot c\right) + t_1\\ \end{array} \]
Alternative 6
Error9.9
Cost2001
\[\begin{array}{l} t_1 := \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 -6.6 \cdot 10^{+28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.6 \cdot 10^{-144}:\\ \;\;\;\;\left(18 \cdot \left(\left(y \cdot t\right) \cdot \left(x \cdot z\right)\right) + b \cdot c\right) + \left(x \cdot \left(i \cdot -4\right) + j \cdot \left(k \cdot -27\right)\right)\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-178} \lor \neg \left(x \leq 1.24 \cdot 10^{-138}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right) + a \cdot -4\right)\right) + \left(j \cdot k\right) \cdot -27\\ \end{array} \]
Alternative 7
Error30.9
Cost1892
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ t_2 := -4 \cdot \left(x \cdot i\right) + t_1\\ t_3 := -4 \cdot \left(t \cdot a\right) + t_1\\ t_4 := b \cdot c + t_1\\ \mathbf{if}\;b \leq -4.8 \cdot 10^{+206}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -1.18 \cdot 10^{+201}:\\ \;\;\;\;t \cdot \left(a \cdot -4 - y \cdot \left(z \cdot \left(x \cdot -18\right)\right)\right)\\ \mathbf{elif}\;b \leq -1.16 \cdot 10^{+80}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;b \leq -3.7 \cdot 10^{-35}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -1.4 \cdot 10^{-51}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-111}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 6.1 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-92}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-48}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 8
Error14.6
Cost1737
\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-47} \lor \neg \left(t_1 \leq 10^{-5}\right):\\ \;\;\;\;b \cdot c + \left(-4 \cdot \left(x \cdot i\right) + \left(j \cdot k\right) \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\\ \end{array} \]
Alternative 9
Error14.3
Cost1736
\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t_1 \leq -100000000000:\\ \;\;\;\;b \cdot c - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\ \mathbf{elif}\;t_1 \leq 10^{-5}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + \left(-4 \cdot \left(x \cdot i\right) + \left(j \cdot k\right) \cdot -27\right)\\ \end{array} \]
Alternative 10
Error14.7
Cost1736
\[\begin{array}{l} t_1 := -4 \cdot \left(x \cdot i\right)\\ t_2 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{-47}:\\ \;\;\;\;\left(b \cdot c + t_1\right) + k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;t_2 \leq 10^{-5}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + \left(t_1 + \left(j \cdot k\right) \cdot -27\right)\\ \end{array} \]
Alternative 11
Error8.7
Cost1736
\[\begin{array}{l} t_1 := \left(j \cdot k\right) \cdot -27\\ \mathbf{if}\;t \leq -1.75 \cdot 10^{-83}:\\ \;\;\;\;\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\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{+151}:\\ \;\;\;\;\left(b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\right) + k \cdot \left(j \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot c + t \cdot \left(z \cdot \left(x \cdot \left(18 \cdot y\right)\right) + a \cdot -4\right)\right) + t_1\\ \end{array} \]
Alternative 12
Error17.1
Cost1609
\[\begin{array}{l} t_1 := \left(j \cdot 27\right) \cdot k\\ \mathbf{if}\;t_1 \leq -100000000000 \lor \neg \left(t_1 \leq 5 \cdot 10^{+91}\right):\\ \;\;\;\;b \cdot c + k \cdot \left(j \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\\ \end{array} \]
Alternative 13
Error31.0
Cost1364
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ t_2 := -4 \cdot \left(t \cdot a\right) + t_1\\ t_3 := b \cdot c + t_1\\ \mathbf{if}\;c \leq -2.45 \cdot 10^{-98}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{-81}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 6 \cdot 10^{-22}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 950000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 1.6 \cdot 10^{+91}:\\ \;\;\;\;-4 \cdot \left(x \cdot i\right) + t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 14
Error9.5
Cost1216
\[\left(b \cdot c + -4 \cdot \left(x \cdot i + t \cdot a\right)\right) + k \cdot \left(j \cdot -27\right) \]
Alternative 15
Error44.4
Cost1112
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ \mathbf{if}\;c \leq -5.7 \cdot 10^{-31}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq -3.3 \cdot 10^{-187}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 9 \cdot 10^{-165}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \mathbf{elif}\;c \leq 1.75 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.9 \cdot 10^{-67}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;c \leq 1.5 \cdot 10^{+92}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 16
Error30.2
Cost969
\[\begin{array}{l} t_1 := k \cdot \left(j \cdot -27\right)\\ \mathbf{if}\;c \leq -3 \cdot 10^{-95} \lor \neg \left(c \leq 3.8 \cdot 10^{-83}\right):\\ \;\;\;\;b \cdot c + t_1\\ \mathbf{else}:\\ \;\;\;\;-4 \cdot \left(t \cdot a\right) + t_1\\ \end{array} \]
Alternative 17
Error44.1
Cost849
\[\begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+199}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \leq -3.5 \cdot 10^{+171} \lor \neg \left(b \leq -4.8 \cdot 10^{+103}\right) \land b \leq 1.35 \cdot 10^{-48}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 18
Error44.1
Cost848
\[\begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+199}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \leq -4.8 \cdot 10^{+173}:\\ \;\;\;\;k \cdot \left(j \cdot -27\right)\\ \mathbf{elif}\;b \leq -5.5 \cdot 10^{+103}:\\ \;\;\;\;b \cdot c\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-48}:\\ \;\;\;\;\left(j \cdot k\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;b \cdot c\\ \end{array} \]
Alternative 19
Error35.3
Cost841
\[\begin{array}{l} \mathbf{if}\;c \leq -2.4 \cdot 10^{-215} \lor \neg \left(c \leq 2.1 \cdot 10^{-165}\right):\\ \;\;\;\;b \cdot c + k \cdot \left(j \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(a \cdot -4\right)\\ \end{array} \]
Alternative 20
Error48.3
Cost192
\[b \cdot c \]

Error

Reproduce

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