?

Average Error: 9.49% → 3.08%
Time: 29.8s
Precision: binary64
Cost: 15048

?

\[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 := c \cdot \left(b \cdot i\right)\\ t_2 := a + b \cdot c\\ t_3 := \left(c \cdot t_2\right) \cdot i\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(\frac{c \cdot \left(\left(a \cdot i\right) \cdot \left(a \cdot i\right) - t_1 \cdot t_1\right)}{t_1 - a \cdot i} + t \cdot z\right)\right)\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+252}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot t_2\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 (* c (* b i))) (t_2 (+ a (* b c))) (t_3 (* (* c t_2) i)))
   (if (<= t_3 (- INFINITY))
     (*
      2.0
      (+
       (* y x)
       (+
        (/ (* c (- (* (* a i) (* a i)) (* t_1 t_1))) (- t_1 (* a i)))
        (* t z))))
     (if (<= t_3 2e+252)
       (* 2.0 (fma z t (- (* y x) (* i (* c (fma c b a))))))
       (* 2.0 (+ (* y x) (- (* t z) (* (* c i) t_2))))))))
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 = c * (b * i);
	double t_2 = a + (b * c);
	double t_3 = (c * t_2) * i;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = 2.0 * ((y * x) + (((c * (((a * i) * (a * i)) - (t_1 * t_1))) / (t_1 - (a * i))) + (t * z)));
	} else if (t_3 <= 2e+252) {
		tmp = 2.0 * fma(z, t, ((y * x) - (i * (c * fma(c, b, a)))));
	} else {
		tmp = 2.0 * ((y * x) + ((t * z) - ((c * i) * t_2)));
	}
	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(c * Float64(b * i))
	t_2 = Float64(a + Float64(b * c))
	t_3 = Float64(Float64(c * t_2) * i)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(Float64(Float64(c * Float64(Float64(Float64(a * i) * Float64(a * i)) - Float64(t_1 * t_1))) / Float64(t_1 - Float64(a * i))) + Float64(t * z))));
	elseif (t_3 <= 2e+252)
		tmp = Float64(2.0 * fma(z, t, Float64(Float64(y * x) - Float64(i * Float64(c * fma(c, b, a))))));
	else
		tmp = Float64(2.0 * Float64(Float64(y * x) + Float64(Float64(t * z) - Float64(Float64(c * i) * t_2))));
	end
	return 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[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * t$95$2), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(N[(N[(c * N[(N[(N[(a * i), $MachinePrecision] * N[(a * i), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+252], N[(2.0 * N[(z * t + N[(N[(y * x), $MachinePrecision] - N[(i * N[(c * N[(c * b + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(y * x), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] - N[(N[(c * i), $MachinePrecision] * t$95$2), $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 := c \cdot \left(b \cdot i\right)\\
t_2 := a + b \cdot c\\
t_3 := \left(c \cdot t_2\right) \cdot i\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;2 \cdot \left(y \cdot x + \left(\frac{c \cdot \left(\left(a \cdot i\right) \cdot \left(a \cdot i\right) - t_1 \cdot t_1\right)}{t_1 - a \cdot i} + t \cdot z\right)\right)\\

\mathbf{elif}\;t_3 \leq 2 \cdot 10^{+252}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot t_2\right)\right)\\


\end{array}

Error?

Target

Original9.49%
Target2.92%
Herbie3.08%
\[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) < -inf.0

    1. Initial program 100

      \[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 i around inf 18.79

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + \left(t \cdot z + -1 \cdot \left(c \cdot \left(i \cdot \left(c \cdot b + a\right)\right)\right)\right)\right)} \]
    3. Applied egg-rr39.46

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000002e252

    1. Initial program 0.42

      \[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 x around 0 6.54

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)} \]
      Proof

      [Start]6.54

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

      cancel-sign-sub-inv [=>]6.54

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

      +-commutative [=>]6.54

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

      *-commutative [<=]6.54

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

      *-commutative [=>]6.54

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

      *-commutative [=>]6.54

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

      *-commutative [<=]6.54

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

      fma-udef [<=]6.54

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

      associate-+r+ [<=]6.54

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

      cancel-sign-sub-inv [<=]6.54

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

      fma-def [=>]6.53

      \[ 2 \cdot \color{blue}{\mathsf{fma}\left(z, t, x \cdot y - c \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)} \]

      *-commutative [<=]6.53

      \[ 2 \cdot \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} - c \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right) \]

      associate-*r* [=>]0.41

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \color{blue}{\left(c \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot i}\right) \]

      *-commutative [=>]0.41

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \color{blue}{i \cdot \left(c \cdot \mathsf{fma}\left(b, c, a\right)\right)}\right) \]

      fma-udef [=>]0.41

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

      *-commutative [=>]0.41

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

      fma-def [=>]0.41

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \color{blue}{\mathsf{fma}\left(c, b, a\right)}\right)\right) \]

    if 2.0000000000000002e252 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 65.44

      \[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 x around 0 24.59

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

      \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)} \]
      Proof

      [Start]24.59

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

      cancel-sign-sub-inv [=>]24.59

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

      +-commutative [=>]24.59

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

      *-commutative [<=]24.59

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

      *-commutative [=>]24.59

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

      *-commutative [=>]24.59

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

      *-commutative [<=]24.59

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

      fma-udef [<=]24.58

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

      associate-+r+ [<=]24.58

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

      cancel-sign-sub-inv [<=]24.58

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

      fma-def [=>]24.58

      \[ 2 \cdot \color{blue}{\mathsf{fma}\left(z, t, x \cdot y - c \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right)} \]

      *-commutative [<=]24.58

      \[ 2 \cdot \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} - c \cdot \left(\mathsf{fma}\left(b, c, a\right) \cdot i\right)\right) \]

      associate-*r* [=>]65.44

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \color{blue}{\left(c \cdot \mathsf{fma}\left(b, c, a\right)\right) \cdot i}\right) \]

      *-commutative [=>]65.44

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - \color{blue}{i \cdot \left(c \cdot \mathsf{fma}\left(b, c, a\right)\right)}\right) \]

      fma-udef [=>]65.44

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

      *-commutative [=>]65.44

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

      fma-def [=>]65.44

      \[ 2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \color{blue}{\mathsf{fma}\left(c, b, a\right)}\right)\right) \]
    4. Applied egg-rr12.68

      \[\leadsto 2 \cdot \color{blue}{\left(\left(\left(y \cdot x + z \cdot t\right) - \left(i \cdot c\right) \cdot \left(c \cdot b\right)\right) - \left(i \cdot c\right) \cdot a\right)} \]
    5. Applied egg-rr12.68

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -\infty:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(\frac{c \cdot \left(\left(a \cdot i\right) \cdot \left(a \cdot i\right) - \left(c \cdot \left(b \cdot i\right)\right) \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)}{c \cdot \left(b \cdot i\right) - a \cdot i} + t \cdot z\right)\right)\\ \mathbf{elif}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 2 \cdot 10^{+252}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, y \cdot x - i \cdot \left(c \cdot \mathsf{fma}\left(c, b, a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot \left(a + b \cdot c\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error17.53%
Cost4824
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t_1\right) \cdot i\\ t_3 := 2 \cdot \left(t \cdot z - t_2\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right) + c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;t_2 \leq -2000000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{-51}:\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \mathbf{elif}\;t_2 \leq 50000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 10^{+100}:\\ \;\;\;\;2 \cdot \left(y \cdot x - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+288}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot t_1\right)\right)\\ \end{array} \]
Alternative 2
Error17.11%
Cost3536
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t_1\right) \cdot i\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right) + c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;t_2 \leq -2000000000000:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_2\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-80}:\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+288}:\\ \;\;\;\;2 \cdot \left(y \cdot x - t_2\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot t_1\right)\right)\\ \end{array} \]
Alternative 3
Error12.32%
Cost3536
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t_1\right) \cdot i\\ t_3 := 2 \cdot \left(t \cdot z - t_2\right)\\ t_4 := c \cdot \left(a \cdot i\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right) + t_4\right)\\ \mathbf{elif}\;t_2 \leq -2 \cdot 10^{+109}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+84}:\\ \;\;\;\;2 \cdot \left(\left(y \cdot x + t \cdot z\right) - t_4\right)\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+288}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot t_1\right)\right)\\ \end{array} \]
Alternative 4
Error3.09%
Cost3268
\[\begin{array}{l} t_1 := c \cdot \left(b \cdot i\right)\\ t_2 := a + b \cdot c\\ t_3 := \left(c \cdot t_2\right) \cdot i\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(\frac{c \cdot \left(\left(a \cdot i\right) \cdot \left(a \cdot i\right) - t_1 \cdot t_1\right)}{t_1 - a \cdot i} + t \cdot z\right)\right)\\ \mathbf{elif}\;t_3 \leq 2 \cdot 10^{+252}:\\ \;\;\;\;2 \cdot \left(\left(y \cdot x + t \cdot z\right) - t_3\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot t_2\right)\right)\\ \end{array} \]
Alternative 5
Error4.44%
Cost2504
\[\begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t_1\right) \cdot i\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;-2 \cdot \left(\left(c \cdot c\right) \cdot \left(b \cdot i\right) + c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+252}:\\ \;\;\;\;2 \cdot \left(\left(y \cdot x + t \cdot z\right) - t_2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot t_1\right)\right)\\ \end{array} \]
Alternative 6
Error39.26%
Cost2024
\[\begin{array}{l} t_1 := c \cdot \left(a \cdot i\right)\\ t_2 := 2 \cdot \left(y \cdot x + t \cdot z\right)\\ t_3 := -2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ t_4 := 2 \cdot \left(y \cdot x - t_1\right)\\ \mathbf{if}\;t \leq -0.435:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -3.8 \cdot 10^{-121}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq -4.5 \cdot 10^{-233}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 5.4 \cdot 10^{-173}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-108}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{-46}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 420:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.8 \cdot 10^{+68}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t \leq 2 \cdot 10^{+147}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_1\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error34.97%
Cost2004
\[\begin{array}{l} t_1 := c \cdot \left(a \cdot i\right)\\ t_2 := 2 \cdot \left(y \cdot x - t_1\right)\\ \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+28}:\\ \;\;\;\;2 \cdot \left(t \cdot z - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;t \cdot z \leq -2 \cdot 10^{-10}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \cdot z \leq -2 \cdot 10^{-94}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_1\right)\\ \mathbf{elif}\;t \cdot z \leq 3.1 \cdot 10^{-238}:\\ \;\;\;\;2 \cdot \left(y \cdot x - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;t \cdot z \leq 4 \cdot 10^{-112}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \end{array} \]
Alternative 8
Error38.09%
Cost1764
\[\begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{+125} \lor \neg \left(b \leq -4.5 \cdot 10^{+78} \lor \neg \left(b \leq -5.1 \cdot 10^{-248}\right) \land \left(b \leq -8.6 \cdot 10^{-268} \lor \neg \left(b \leq 2.5 \cdot 10^{-151}\right) \land \left(b \leq 7.8 \cdot 10^{-126} \lor \neg \left(b \leq 1.25 \cdot 10^{+141}\right) \land b \leq 2.4 \cdot 10^{+187}\right)\right)\right):\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ \end{array} \]
Alternative 9
Error39.05%
Cost1761
\[\begin{array}{l} t_1 := 2 \cdot \left(t \cdot z - c \cdot \left(a \cdot i\right)\right)\\ t_2 := -2 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\\ t_3 := 2 \cdot \left(y \cdot x + t \cdot z\right)\\ \mathbf{if}\;b \leq -2.2 \cdot 10^{+134}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -4.5 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -4 \cdot 10^{-186}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-287}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{-151}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-116}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{+140} \lor \neg \left(b \leq 2.4 \cdot 10^{+187}\right):\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error31.84%
Cost1744
\[\begin{array}{l} t_1 := c \cdot \left(a \cdot i\right)\\ t_2 := 2 \cdot \left(y \cdot x - t_1\right)\\ \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+28}:\\ \;\;\;\;2 \cdot \left(t \cdot z - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;t \cdot z \leq -2 \cdot 10^{-10}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \cdot z \leq -5 \cdot 10^{-61}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_1\right)\\ \mathbf{elif}\;t \cdot z \leq 4 \cdot 10^{-112}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \end{array} \]
Alternative 11
Error34.56%
Cost1496
\[\begin{array}{l} t_1 := c \cdot \left(a \cdot i\right)\\ t_2 := 2 \cdot \left(y \cdot x + t \cdot z\right)\\ t_3 := i \cdot \left(a \cdot c\right)\\ t_4 := 2 \cdot \left(y \cdot x - t_3\right)\\ \mathbf{if}\;a \leq -9.6 \cdot 10^{+147}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_1\right)\\ \mathbf{elif}\;a \leq -1.42 \cdot 10^{+46}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+58}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+87}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 1.95 \cdot 10^{+136}:\\ \;\;\;\;2 \cdot \left(t \cdot z - t_3\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x - t_1\right)\\ \end{array} \]
Alternative 12
Error2.92%
Cost1216
\[2 \cdot \left(y \cdot x + \left(t \cdot z - \left(c \cdot i\right) \cdot \left(a + b \cdot c\right)\right)\right) \]
Alternative 13
Error35.69%
Cost1106
\[\begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{+249} \lor \neg \left(a \leq -3.2 \cdot 10^{+165}\right) \land \left(a \leq -5.5 \cdot 10^{+98} \lor \neg \left(a \leq 1.2 \cdot 10^{+231}\right)\right):\\ \;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x + t \cdot z\right)\\ \end{array} \]
Alternative 14
Error58.34%
Cost848
\[\begin{array}{l} t_1 := 2 \cdot \left(t \cdot z\right)\\ t_2 := 2 \cdot \left(y \cdot x\right)\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{-14}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-244}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-293}:\\ \;\;\;\;a \cdot \left(\left(c \cdot i\right) \cdot -2\right)\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error57.28%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -2.75 \cdot 10^{-12} \lor \neg \left(x \leq 3.6 \cdot 10^{-170}\right):\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \end{array} \]
Alternative 16
Error66.78%
Cost320
\[2 \cdot \left(t \cdot z\right) \]
Alternative 17
Error97.31%
Cost64
\[0 \]

Error

Reproduce?

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