Average Error: 6.3 → 2.1
Time: 31.7s
Precision: binary64
Cost: 2504
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
\[\begin{array}{l} t_1 := z \cdot t + x \cdot y\\ t_2 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{+296}:\\ \;\;\;\;2 \cdot \left(z \cdot t - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;2 \cdot \left(t_1 - t_2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* z t) (* x y))) (t_2 (* i (* c (+ a (* b c))))))
   (if (<= t_2 -1e+296)
     (* 2.0 (- (* z t) (+ (* (* c i) (* b c)) (* a (* c i)))))
     (if (<= t_2 4e+302)
       (* 2.0 (- t_1 t_2))
       (* 2.0 (- t_1 (* c (* c (* b i)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (z * t) + (x * y);
	double t_2 = i * (c * (a + (b * c)));
	double tmp;
	if (t_2 <= -1e+296) {
		tmp = 2.0 * ((z * t) - (((c * i) * (b * c)) + (a * (c * i))));
	} else if (t_2 <= 4e+302) {
		tmp = 2.0 * (t_1 - t_2);
	} else {
		tmp = 2.0 * (t_1 - (c * (c * (b * i))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    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
    code = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
end function
real(8) function code(x, y, z, t, a, b, c, i)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (z * t) + (x * y)
    t_2 = i * (c * (a + (b * c)))
    if (t_2 <= (-1d+296)) then
        tmp = 2.0d0 * ((z * t) - (((c * i) * (b * c)) + (a * (c * i))))
    else if (t_2 <= 4d+302) then
        tmp = 2.0d0 * (t_1 - t_2)
    else
        tmp = 2.0d0 * (t_1 - (c * (c * (b * i))))
    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) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (z * t) + (x * y);
	double t_2 = i * (c * (a + (b * c)));
	double tmp;
	if (t_2 <= -1e+296) {
		tmp = 2.0 * ((z * t) - (((c * i) * (b * c)) + (a * (c * i))));
	} else if (t_2 <= 4e+302) {
		tmp = 2.0 * (t_1 - t_2);
	} else {
		tmp = 2.0 * (t_1 - (c * (c * (b * i))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
def code(x, y, z, t, a, b, c, i):
	t_1 = (z * t) + (x * y)
	t_2 = i * (c * (a + (b * c)))
	tmp = 0
	if t_2 <= -1e+296:
		tmp = 2.0 * ((z * t) - (((c * i) * (b * c)) + (a * (c * i))))
	elif t_2 <= 4e+302:
		tmp = 2.0 * (t_1 - t_2)
	else:
		tmp = 2.0 * (t_1 - (c * (c * (b * i))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
end
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(z * t) + Float64(x * y))
	t_2 = Float64(i * Float64(c * Float64(a + Float64(b * c))))
	tmp = 0.0
	if (t_2 <= -1e+296)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(Float64(Float64(c * i) * Float64(b * c)) + Float64(a * Float64(c * i)))));
	elseif (t_2 <= 4e+302)
		tmp = Float64(2.0 * Float64(t_1 - t_2));
	else
		tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i)))));
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (z * t) + (x * y);
	t_2 = i * (c * (a + (b * c)));
	tmp = 0.0;
	if (t_2 <= -1e+296)
		tmp = 2.0 * ((z * t) - (((c * i) * (b * c)) + (a * (c * i))));
	elseif (t_2 <= 4e+302)
		tmp = 2.0 * (t_1 - t_2);
	else
		tmp = 2.0 * (t_1 - (c * (c * (b * i))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+296], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(N[(N[(c * i), $MachinePrecision] * N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+302], N[(2.0 * N[(t$95$1 - t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
t_2 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+296}:\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{elif}\;t_2 \leq 4 \cdot 10^{+302}:\\
\;\;\;\;2 \cdot \left(t_1 - t_2\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.3
Target1.8
Herbie2.1
\[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]

Derivation

  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -9.99999999999999981e295

    1. Initial program 58.0

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Simplified10.2

      \[\leadsto \color{blue}{2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), i \cdot \left(-c\right), x \cdot y\right)\right)} \]
      Proof
      (*.f64 2 (fma.f64 z t (fma.f64 (fma.f64 b c a) (*.f64 i (neg.f64 c)) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (fma.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 b c) a)) (*.f64 i (neg.f64 c)) (*.f64 x y)))): 0 points increase in error, 1 points decrease in error
      (*.f64 2 (fma.f64 z t (fma.f64 (Rewrite<= +-commutative_binary64 (+.f64 a (*.f64 b c))) (*.f64 i (neg.f64 c)) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (fma.f64 (+.f64 a (*.f64 b c)) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 i c))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (fma.f64 (+.f64 a (*.f64 b c)) (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 c i))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (+.f64 a (*.f64 b c)) (neg.f64 (*.f64 c i))) (*.f64 x y))))): 1 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (+.f64 a (*.f64 b c)) (*.f64 c i)))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (+.f64 (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))) (*.f64 x y)))): 37 points increase in error, 17 points decrease in error
      (*.f64 2 (fma.f64 z t (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (Rewrite=> associate-+l-_binary64 (-.f64 0 (-.f64 (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (fma.f64 z t (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) (*.f64 x y)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 z t) (-.f64 (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) (*.f64 x y))))): 1 points increase in error, 0 points decrease in error
      (*.f64 2 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 (*.f64 z t) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) (*.f64 x y)))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 x y) (-.f64 (*.f64 z t) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))))): 0 points increase in error, 0 points decrease in error
      (*.f64 2 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)))): 0 points increase in error, 0 points decrease in error
    3. Taylor expanded in x around 0 20.0

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(c \cdot \left(i \cdot \left(c \cdot b + a\right)\right)\right)\right)} \]
    4. Simplified17.5

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - \mathsf{fma}\left(c, b, a\right) \cdot \left(c \cdot i\right)\right)} \]
      Proof
      (-.f64 (*.f64 t z) (*.f64 (fma.f64 c b a) (*.f64 c i))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (*.f64 (fma.f64 c b (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 a)))) (*.f64 c i))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (*.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 c b) (neg.f64 a))) (*.f64 c i))): 1 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 c i) (-.f64 (*.f64 c b) (neg.f64 a))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (Rewrite<= distribute-lft-out--_binary64 (-.f64 (*.f64 (*.f64 c i) (*.f64 c b)) (*.f64 (*.f64 c i) (neg.f64 a))))): 1 points increase in error, 2 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (Rewrite=> associate-*l*_binary64 (*.f64 c (*.f64 i (*.f64 c b)))) (*.f64 (*.f64 c i) (neg.f64 a)))): 10 points increase in error, 13 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 c (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 c b) i))) (*.f64 (*.f64 c i) (neg.f64 a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 c (Rewrite=> associate-*l*_binary64 (*.f64 c (*.f64 b i)))) (*.f64 (*.f64 c i) (neg.f64 a)))): 22 points increase in error, 8 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 c (*.f64 c (Rewrite<= *-commutative_binary64 (*.f64 i b)))) (*.f64 (*.f64 c i) (neg.f64 a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 c c) (*.f64 i b))) (*.f64 (*.f64 c i) (neg.f64 a)))): 38 points increase in error, 7 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 i b)) (*.f64 (*.f64 c i) (neg.f64 a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 (pow.f64 c 2) (*.f64 i b)) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (*.f64 c i) a))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (-.f64 (*.f64 (pow.f64 c 2) (*.f64 i b)) (Rewrite=> distribute-lft-neg-in_binary64 (*.f64 (neg.f64 (*.f64 c i)) a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (Rewrite=> cancel-sign-sub_binary64 (+.f64 (*.f64 (pow.f64 c 2) (*.f64 i b)) (*.f64 (*.f64 c i) a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (*.f64 (pow.f64 c 2) (*.f64 i b)) (Rewrite<= associate-*r*_binary64 (*.f64 c (*.f64 i a))))): 20 points increase in error, 16 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (*.f64 (Rewrite=> unpow2_binary64 (*.f64 c c)) (*.f64 i b)) (*.f64 c (*.f64 i a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (Rewrite=> associate-*l*_binary64 (*.f64 c (*.f64 c (*.f64 i b)))) (*.f64 c (*.f64 i a)))): 7 points increase in error, 38 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (*.f64 c (*.f64 c (Rewrite=> *-commutative_binary64 (*.f64 b i)))) (*.f64 c (*.f64 i a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (*.f64 c (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 c b) i))) (*.f64 c (*.f64 i a)))): 8 points increase in error, 19 points decrease in error
      (-.f64 (*.f64 t z) (+.f64 (*.f64 c (Rewrite<= *-commutative_binary64 (*.f64 i (*.f64 c b)))) (*.f64 c (*.f64 i a)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 t z) (Rewrite<= distribute-lft-in_binary64 (*.f64 c (+.f64 (*.f64 i (*.f64 c b)) (*.f64 i a))))): 3 points increase in error, 2 points decrease in error
      (-.f64 (*.f64 t z) (*.f64 c (Rewrite<= distribute-lft-in_binary64 (*.f64 i (+.f64 (*.f64 c b) a))))): 1 points increase in error, 0 points decrease in error
      (Rewrite<= unsub-neg_binary64 (+.f64 (*.f64 t z) (neg.f64 (*.f64 c (*.f64 i (+.f64 (*.f64 c b) a)))))): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 t z) (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 c (*.f64 i (+.f64 (*.f64 c b) a)))))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr17.5

      \[\leadsto 2 \cdot \left(t \cdot z - \color{blue}{\left(\left(c \cdot i\right) \cdot \left(c \cdot b\right) + \left(c \cdot i\right) \cdot a\right)}\right) \]

    if -9.99999999999999981e295 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 4.0000000000000003e302

    1. Initial program 0.3

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]

    if 4.0000000000000003e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 61.6

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in a around 0 42.0

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{{c}^{2} \cdot \left(i \cdot b\right)}\right) \]
    3. Simplified19.6

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{c \cdot \left(c \cdot \left(i \cdot b\right)\right)}\right) \]
      Proof
      (*.f64 c (*.f64 c (*.f64 i b))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 c c) (*.f64 i b))): 58 points increase in error, 31 points decrease in error
      (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 c 2)) (*.f64 i b)): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification2.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot \left(c \cdot \left(a + b \cdot c\right)\right) \leq -1 \cdot 10^{+296}:\\ \;\;\;\;2 \cdot \left(z \cdot t - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;i \cdot \left(c \cdot \left(a + b \cdot c\right)\right) \leq 4 \cdot 10^{+302}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.8
Cost20096
\[2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(\mathsf{fma}\left(b, c, a\right), c \cdot \left(-i\right), x \cdot y\right)\right) \]
Alternative 2
Error11.0
Cost3536
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := i \cdot \left(c \cdot t_1\right)\\ t_3 := 2 \cdot \left(x \cdot y - t_2\right)\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{+305}:\\ \;\;\;\;\left(c \cdot \left(i \cdot t_1\right)\right) \cdot -2\\ \mathbf{elif}\;t_2 \leq -50000000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+136}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]
Alternative 3
Error10.5
Cost3536
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := i \cdot \left(c \cdot t_1\right)\\ t_3 := 2 \cdot \left(z \cdot t - t_2\right)\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{+305}:\\ \;\;\;\;\left(c \cdot \left(i \cdot t_1\right)\right) \cdot -2\\ \mathbf{elif}\;t_2 \leq -1 \cdot 10^{-65}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+34}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]
Alternative 4
Error8.2
Cost3020
\[\begin{array}{l} t_1 := z \cdot t + x \cdot y\\ t_2 := a + b \cdot c\\ t_3 := i \cdot \left(c \cdot t_2\right)\\ \mathbf{if}\;t_3 \leq -4 \cdot 10^{+305}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot t_2\right)\right)\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+171}:\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{elif}\;t_3 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_3\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]
Alternative 5
Error8.8
Cost2892
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := i \cdot \left(c \cdot t_1\right)\\ \mathbf{if}\;t_2 \leq -4 \cdot 10^{+305}:\\ \;\;\;\;\left(c \cdot \left(i \cdot t_1\right)\right) \cdot -2\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+171}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{elif}\;t_2 \leq 4 \cdot 10^{+302}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]
Alternative 6
Error7.8
Cost2504
\[\begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\ t_2 := i \cdot \left(c \cdot \left(a + b \cdot c\right)\right)\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{+257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+174}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error22.6
Cost1888
\[\begin{array}{l} t_1 := i \cdot \left(c \cdot a\right)\\ t_2 := 2 \cdot \left(x \cdot y - \left(c \cdot i\right) \cdot \left(b \cdot c\right)\right)\\ t_3 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{if}\;c \leq -1 \cdot 10^{+160}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -3 \cdot 10^{+54}:\\ \;\;\;\;2 \cdot \left(z \cdot t - b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.146907162890989 \cdot 10^{-137}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\ \mathbf{elif}\;c \leq 4.239141679854647 \cdot 10^{-132}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 1.6 \cdot 10^{-19}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\ \mathbf{elif}\;c \leq 3.1 \cdot 10^{+64}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 4 \cdot 10^{+89}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq 1.75 \cdot 10^{+228}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \end{array} \]
Alternative 8
Error23.6
Cost1628
\[\begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ t_2 := i \cdot \left(c \cdot a\right)\\ t_3 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{if}\;a \leq -3.3370235403792424 \cdot 10^{+46}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\ \mathbf{elif}\;a \leq -1.414044577452071 \cdot 10^{-78}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq -5.6385654700541324 \cdot 10^{-157}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 9.662435918049527 \cdot 10^{-9}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \leq 7.893323503602226 \cdot 10^{+55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 5.6896493760706796 \cdot 10^{+76}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;a \leq 4.26560293627148 \cdot 10^{+141}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 9
Error7.5
Cost1352
\[\begin{array}{l} t_1 := z \cdot t + x \cdot y\\ t_2 := 2 \cdot \left(t_1 - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{if}\;a \leq -2.9294068545406525 \cdot 10^{-59}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 7.893323503602226 \cdot 10^{+55}:\\ \;\;\;\;2 \cdot \left(t_1 - \left(c \cdot i\right) \cdot \left(b \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error36.6
Cost1112
\[\begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;y \leq -4.507127314931744 \cdot 10^{-125}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.3546916000885313 \cdot 10^{-108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.871216995167087 \cdot 10^{-45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.172607718634638 \cdot 10^{+19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 11
Error37.1
Cost1112
\[\begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;y \leq -4.507127314931744 \cdot 10^{-125}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.0624436636956729 \cdot 10^{-128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.871216995167087 \cdot 10^{-45}:\\ \;\;\;\;c \cdot \left(b \cdot \left(\left(c \cdot i\right) \cdot -2\right)\right)\\ \mathbf{elif}\;y \leq 5.172607718634638 \cdot 10^{+19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+68}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error21.9
Cost1100
\[\begin{array}{l} t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ t_2 := 2 \cdot \left(x \cdot y - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{if}\;a \leq -3.3370235403792424 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 6.751703734497199 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 4.26560293627148 \cdot 10^{+141}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error22.4
Cost1100
\[\begin{array}{l} t_1 := i \cdot \left(c \cdot a\right)\\ t_2 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{if}\;a \leq -3.3370235403792424 \cdot 10^{+46}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\ \mathbf{elif}\;a \leq 6.751703734497199 \cdot 10^{+88}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 4.26560293627148 \cdot 10^{+141}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error24.2
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq -1.5413507924749092 \cdot 10^{+138}:\\ \;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \]
Alternative 15
Error42.2
Cost320
\[2 \cdot \left(x \cdot y\right) \]

Error

Reproduce

herbie shell --seed 2022311 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))