Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A

Percentage Accurate: 90.8% → 96.2%
Time: 10.9s
Alternatives: 12
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\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))))
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));
}
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
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));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
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 tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
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]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\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))))
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));
}
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
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));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
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 tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
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]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}

Alternative 1: 96.2% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ \mathbf{if}\;\left(z \cdot t + x \cdot y\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))))
   (if (<= (- (+ (* z t) (* x y)) (* (* c t_1) i)) INFINITY)
     (* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
     (* 2.0 (* c (* i (- (- a) (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double tmp;
	if ((((z * t) + (x * y)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (c * (i * (-a - (b * c))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	tmp = 0.0
	if (Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(z \cdot t + x \cdot y\right) - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t_1 \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)) < +inf.0

    1. Initial program 95.4%

      \[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. Step-by-step derivation
      1. associate-*l*98.0%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
      2. fma-def98.0%

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

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

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i))

    1. Initial program 0.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. Taylor expanded in i around inf 66.8%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(c \cdot b + a\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

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

Alternative 2: 95.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\ \mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+277}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - t_1\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* c (+ a (* b c))) i)))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+277)))
     (* 2.0 (* c (* i (- (- a) (* b c)))))
     (* (- (+ (* z t) (* x y)) t_1) 2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * (a + (b * c))) * i;
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+277)) {
		tmp = 2.0 * (c * (i * (-a - (b * c))));
	} else {
		tmp = (((z * t) + (x * y)) - t_1) * 2.0;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * (a + (b * c))) * i;
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+277)) {
		tmp = 2.0 * (c * (i * (-a - (b * c))));
	} else {
		tmp = (((z * t) + (x * y)) - t_1) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * (a + (b * c))) * i
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 1e+277):
		tmp = 2.0 * (c * (i * (-a - (b * c))))
	else:
		tmp = (((z * t) + (x * y)) - t_1) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * Float64(a + Float64(b * c))) * i)
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+277))
		tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c)))));
	else
		tmp = Float64(Float64(Float64(Float64(z * t) + Float64(x * y)) - t_1) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * (a + (b * c))) * i;
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 1e+277)))
		tmp = 2.0 * (c * (i * (-a - (b * c))));
	else
		tmp = (((z * t) + (x * y)) - t_1) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+277]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 10^{+277}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -inf.0 or 1e277 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.5%

      \[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 90.8%

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e277

    1. Initial program 98.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -\infty \lor \neg \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 10^{+277}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\ \end{array} \]

Alternative 3: 85.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t + x \cdot y\\ \mathbf{if}\;c \leq -3.5 \cdot 10^{+53}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{-64}:\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* z t) (* x y))))
   (if (<= c -3.5e+53)
     (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
     (if (<= c 4.5e-64)
       (* 2.0 (- t_1 (* i (* a c))))
       (* 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) {
	double t_1 = (z * t) + (x * y);
	double tmp;
	if (c <= -3.5e+53) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else if (c <= 4.5e-64) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} 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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (z * t) + (x * y)
    if (c <= (-3.5d+53)) then
        tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
    else if (c <= 4.5d-64) then
        tmp = 2.0d0 * (t_1 - (i * (a * c)))
    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) {
	double t_1 = (z * t) + (x * y);
	double tmp;
	if (c <= -3.5e+53) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else if (c <= 4.5e-64) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} else {
		tmp = 2.0 * (t_1 - (c * (c * (b * i))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (z * t) + (x * y)
	tmp = 0
	if c <= -3.5e+53:
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)))
	elif c <= 4.5e-64:
		tmp = 2.0 * (t_1 - (i * (a * c)))
	else:
		tmp = 2.0 * (t_1 - (c * (c * (b * i))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(z * t) + Float64(x * y))
	tmp = 0.0
	if (c <= -3.5e+53)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))));
	elseif (c <= 4.5e-64)
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(t_1 - Float64(c * Float64(c * Float64(b * i)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (z * t) + (x * y);
	tmp = 0.0;
	if (c <= -3.5e+53)
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	elseif (c <= 4.5e-64)
		tmp = 2.0 * (t_1 - (i * (a * c)));
	else
		tmp = 2.0 * (t_1 - (c * (c * (b * i))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.5e+53], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.5e-64], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
\mathbf{if}\;c \leq -3.5 \cdot 10^{+53}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

\mathbf{elif}\;c \leq 4.5 \cdot 10^{-64}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.50000000000000019e53

    1. Initial program 79.1%

      \[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 z around 0 86.3%

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

    if -3.50000000000000019e53 < c < 4.5000000000000001e-64

    1. Initial program 98.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) \]
    2. Taylor expanded in a around inf 95.1%

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

    if 4.5000000000000001e-64 < c

    1. Initial program 85.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. Taylor expanded in a around 0 76.7%

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{{c}^{2} \cdot \left(i \cdot b\right)}\right) \]
    3. Step-by-step derivation
      1. unpow276.7%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right) \]
      2. associate-*r*85.4%

        \[\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) \]
    4. Simplified85.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.5 \cdot 10^{+53}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{-64}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\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} \]

Alternative 4: 74.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(z \cdot t + x \cdot y\right) \cdot 2\\ t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{if}\;c \leq -3.2 \cdot 10^{+63}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -4.1 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-34}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{+127}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ (* z t) (* x y)) 2.0))
        (t_2 (* 2.0 (* c (* i (- (- a) (* b c)))))))
   (if (<= c -3.2e+63)
     t_2
     (if (<= c -4.1e-11)
       t_1
       (if (<= c -5.8e-34)
         (* 2.0 (- (* x y) (* c (* a i))))
         (if (<= c 9.2e+127) t_1 t_2))))))
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)) * 2.0;
	double t_2 = 2.0 * (c * (i * (-a - (b * c))));
	double tmp;
	if (c <= -3.2e+63) {
		tmp = t_2;
	} else if (c <= -4.1e-11) {
		tmp = t_1;
	} else if (c <= -5.8e-34) {
		tmp = 2.0 * ((x * y) - (c * (a * i)));
	} else if (c <= 9.2e+127) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((z * t) + (x * y)) * 2.0d0
    t_2 = 2.0d0 * (c * (i * (-a - (b * c))))
    if (c <= (-3.2d+63)) then
        tmp = t_2
    else if (c <= (-4.1d-11)) then
        tmp = t_1
    else if (c <= (-5.8d-34)) then
        tmp = 2.0d0 * ((x * y) - (c * (a * i)))
    else if (c <= 9.2d+127) then
        tmp = 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 t_1 = ((z * t) + (x * y)) * 2.0;
	double t_2 = 2.0 * (c * (i * (-a - (b * c))));
	double tmp;
	if (c <= -3.2e+63) {
		tmp = t_2;
	} else if (c <= -4.1e-11) {
		tmp = t_1;
	} else if (c <= -5.8e-34) {
		tmp = 2.0 * ((x * y) - (c * (a * i)));
	} else if (c <= 9.2e+127) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((z * t) + (x * y)) * 2.0
	t_2 = 2.0 * (c * (i * (-a - (b * c))))
	tmp = 0
	if c <= -3.2e+63:
		tmp = t_2
	elif c <= -4.1e-11:
		tmp = t_1
	elif c <= -5.8e-34:
		tmp = 2.0 * ((x * y) - (c * (a * i)))
	elif c <= 9.2e+127:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0)
	t_2 = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-a) - Float64(b * c)))))
	tmp = 0.0
	if (c <= -3.2e+63)
		tmp = t_2;
	elseif (c <= -4.1e-11)
		tmp = t_1;
	elseif (c <= -5.8e-34)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i))));
	elseif (c <= 9.2e+127)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((z * t) + (x * y)) * 2.0;
	t_2 = 2.0 * (c * (i * (-a - (b * c))));
	tmp = 0.0;
	if (c <= -3.2e+63)
		tmp = t_2;
	elseif (c <= -4.1e-11)
		tmp = t_1;
	elseif (c <= -5.8e-34)
		tmp = 2.0 * ((x * y) - (c * (a * i)));
	elseif (c <= 9.2e+127)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(i * N[((-a) - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.2e+63], t$95$2, If[LessEqual[c, -4.1e-11], t$95$1, If[LessEqual[c, -5.8e-34], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.2e+127], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(z \cdot t + x \cdot y\right) \cdot 2\\
t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\
\mathbf{if}\;c \leq -3.2 \cdot 10^{+63}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq -4.1 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -5.8 \cdot 10^{-34}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\

\mathbf{elif}\;c \leq 9.2 \cdot 10^{+127}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.20000000000000011e63 or 9.2000000000000007e127 < c

    1. Initial program 79.5%

      \[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 86.0%

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

    if -3.20000000000000011e63 < c < -4.1000000000000001e-11 or -5.8000000000000004e-34 < c < 9.2000000000000007e127

    1. Initial program 96.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 c around 0 77.1%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]

    if -4.1000000000000001e-11 < c < -5.8000000000000004e-34

    1. Initial program 100.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. Taylor expanded in z around 0 100.0%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - c \cdot \left(i \cdot \left(c \cdot b + a\right)\right)\right)} \]
    3. Taylor expanded in c around 0 100.0%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + -1 \cdot \left(c \cdot \left(a \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto 2 \cdot \left(y \cdot x + \color{blue}{\left(-c \cdot \left(a \cdot i\right)\right)}\right) \]
      2. sub-neg100.0%

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - c \cdot \left(a \cdot i\right)\right)} \]
      3. *-commutative100.0%

        \[\leadsto 2 \cdot \left(y \cdot x - c \cdot \color{blue}{\left(i \cdot a\right)}\right) \]
    5. Simplified100.0%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - c \cdot \left(i \cdot a\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.2 \cdot 10^{+63}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.1 \cdot 10^{-11}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-34}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{+127}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 5: 80.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.8 \cdot 10^{-34} \lor \neg \left(c \leq 1.8 \cdot 10^{-81}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -2.8e-34) (not (<= c 1.8e-81)))
   (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
   (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -2.8e-34) || !(c <= 1.8e-81)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	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
    real(8) :: tmp
    if ((c <= (-2.8d-34)) .or. (.not. (c <= 1.8d-81))) then
        tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
    else
        tmp = ((z * t) + (x * y)) * 2.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 tmp;
	if ((c <= -2.8e-34) || !(c <= 1.8e-81)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -2.8e-34) or not (c <= 1.8e-81):
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)))
	else:
		tmp = ((z * t) + (x * y)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -2.8e-34) || !(c <= 1.8e-81))
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))));
	else
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -2.8e-34) || ~((c <= 1.8e-81)))
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	else
		tmp = ((z * t) + (x * y)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.8e-34], N[Not[LessEqual[c, 1.8e-81]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.8 \cdot 10^{-34} \lor \neg \left(c \leq 1.8 \cdot 10^{-81}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.79999999999999997e-34 or 1.7999999999999999e-81 < c

    1. Initial program 84.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) \]
    2. Taylor expanded in z around 0 82.2%

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

    if -2.79999999999999997e-34 < c < 1.7999999999999999e-81

    1. Initial program 98.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. Taylor expanded in c around 0 84.9%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.8 \cdot 10^{-34} \lor \neg \left(c \leq 1.8 \cdot 10^{-81}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 6: 86.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{+49} \lor \neg \left(c \leq 5 \cdot 10^{+93}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -3.8e+49) (not (<= c 5e+93)))
   (* 2.0 (- (* x y) (* c (* (+ a (* b c)) i))))
   (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -3.8e+49) || !(c <= 5e+93)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	}
	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
    real(8) :: tmp
    if ((c <= (-3.8d+49)) .or. (.not. (c <= 5d+93))) then
        tmp = 2.0d0 * ((x * y) - (c * ((a + (b * c)) * i)))
    else
        tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
    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 tmp;
	if ((c <= -3.8e+49) || !(c <= 5e+93)) {
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	} else {
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -3.8e+49) or not (c <= 5e+93):
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)))
	else:
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -3.8e+49) || !(c <= 5e+93))
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -3.8e+49) || ~((c <= 5e+93)))
		tmp = 2.0 * ((x * y) - (c * ((a + (b * c)) * i)));
	else
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.8e+49], N[Not[LessEqual[c, 5e+93]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.8 \cdot 10^{+49} \lor \neg \left(c \leq 5 \cdot 10^{+93}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.7999999999999999e49 or 5.0000000000000001e93 < c

    1. Initial program 79.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) \]
    2. Taylor expanded in z around 0 89.1%

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

    if -3.7999999999999999e49 < c < 5.0000000000000001e93

    1. Initial program 97.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) \]
    2. Taylor expanded in a around inf 89.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{+49} \lor \neg \left(c \leq 5 \cdot 10^{+93}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\ \end{array} \]

Alternative 7: 57.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+212} \lor \neg \left(a \leq 3.6 \cdot 10^{+100} \lor \neg \left(a \leq 2.75 \cdot 10^{+167}\right) \land a \leq 3.2 \cdot 10^{+227}\right):\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= a -2.5e+212)
         (not
          (or (<= a 3.6e+100) (and (not (<= a 2.75e+167)) (<= a 3.2e+227)))))
   (* 2.0 (* i (* a (- c))))
   (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227)))) {
		tmp = 2.0 * (i * (a * -c));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	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
    real(8) :: tmp
    if ((a <= (-2.5d+212)) .or. (.not. (a <= 3.6d+100) .or. (.not. (a <= 2.75d+167)) .and. (a <= 3.2d+227))) then
        tmp = 2.0d0 * (i * (a * -c))
    else
        tmp = ((z * t) + (x * y)) * 2.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 tmp;
	if ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227)))) {
		tmp = 2.0 * (i * (a * -c));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (a <= -2.5e+212) or not ((a <= 3.6e+100) or (not (a <= 2.75e+167) and (a <= 3.2e+227))):
		tmp = 2.0 * (i * (a * -c))
	else:
		tmp = ((z * t) + (x * y)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((a <= -2.5e+212) || !((a <= 3.6e+100) || (!(a <= 2.75e+167) && (a <= 3.2e+227))))
		tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c))));
	else
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((a <= -2.5e+212) || ~(((a <= 3.6e+100) || (~((a <= 2.75e+167)) && (a <= 3.2e+227)))))
		tmp = 2.0 * (i * (a * -c));
	else
		tmp = ((z * t) + (x * y)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[a, -2.5e+212], N[Not[Or[LessEqual[a, 3.6e+100], And[N[Not[LessEqual[a, 2.75e+167]], $MachinePrecision], LessEqual[a, 3.2e+227]]]], $MachinePrecision]], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+212} \lor \neg \left(a \leq 3.6 \cdot 10^{+100} \lor \neg \left(a \leq 2.75 \cdot 10^{+167}\right) \land a \leq 3.2 \cdot 10^{+227}\right):\\
\;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.49999999999999996e212 or 3.6e100 < a < 2.7500000000000002e167 or 3.19999999999999988e227 < a

    1. Initial program 82.8%

      \[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 z around 0 72.4%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x - c \cdot \left(i \cdot \left(c \cdot b + a\right)\right)\right)} \]
    3. Taylor expanded in a around inf 53.5%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot a\right)\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*53.5%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(-1 \cdot c\right) \cdot \left(i \cdot a\right)\right)} \]
      2. neg-mul-153.5%

        \[\leadsto 2 \cdot \left(\color{blue}{\left(-c\right)} \cdot \left(i \cdot a\right)\right) \]
      3. associate-*r*60.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(\left(-c\right) \cdot i\right) \cdot a\right)} \]
      4. *-commutative60.0%

        \[\leadsto 2 \cdot \left(\color{blue}{\left(i \cdot \left(-c\right)\right)} \cdot a\right) \]
      5. associate-*l*65.3%

        \[\leadsto 2 \cdot \color{blue}{\left(i \cdot \left(\left(-c\right) \cdot a\right)\right)} \]
    5. Simplified65.3%

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

    if -2.49999999999999996e212 < a < 3.6e100 or 2.7500000000000002e167 < a < 3.19999999999999988e227

    1. Initial program 91.7%

      \[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 c around 0 61.2%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.5 \cdot 10^{+212} \lor \neg \left(a \leq 3.6 \cdot 10^{+100} \lor \neg \left(a \leq 2.75 \cdot 10^{+167}\right) \land a \leq 3.2 \cdot 10^{+227}\right):\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 8: 69.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -9.4 \cdot 10^{+64} \lor \neg \left(c \leq 3.1 \cdot 10^{+142}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(i \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -9.4e+64) (not (<= c 3.1e+142)))
   (* 2.0 (* c (* b (* i (- c)))))
   (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -9.4e+64) || !(c <= 3.1e+142)) {
		tmp = 2.0 * (c * (b * (i * -c)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	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
    real(8) :: tmp
    if ((c <= (-9.4d+64)) .or. (.not. (c <= 3.1d+142))) then
        tmp = 2.0d0 * (c * (b * (i * -c)))
    else
        tmp = ((z * t) + (x * y)) * 2.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 tmp;
	if ((c <= -9.4e+64) || !(c <= 3.1e+142)) {
		tmp = 2.0 * (c * (b * (i * -c)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -9.4e+64) or not (c <= 3.1e+142):
		tmp = 2.0 * (c * (b * (i * -c)))
	else:
		tmp = ((z * t) + (x * y)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -9.4e+64) || !(c <= 3.1e+142))
		tmp = Float64(2.0 * Float64(c * Float64(b * Float64(i * Float64(-c)))));
	else
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -9.4e+64) || ~((c <= 3.1e+142)))
		tmp = 2.0 * (c * (b * (i * -c)));
	else
		tmp = ((z * t) + (x * y)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -9.4e+64], N[Not[LessEqual[c, 3.1e+142]], $MachinePrecision]], N[(2.0 * N[(c * N[(b * N[(i * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.4 \cdot 10^{+64} \lor \neg \left(c \leq 3.1 \cdot 10^{+142}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(i \cdot \left(-c\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -9.40000000000000058e64 or 3.0999999999999999e142 < c

    1. Initial program 79.8%

      \[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 67.8%

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{{c}^{2} \cdot \left(i \cdot b\right)}\right) \]
    3. Step-by-step derivation
      1. unpow267.8%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right) \]
      2. associate-*r*80.7%

        \[\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) \]
    4. Simplified80.7%

      \[\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) \]
    5. Taylor expanded in c around inf 71.1%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)\right)} \]
    6. Step-by-step derivation
      1. unpow271.1%

        \[\leadsto 2 \cdot \left(-1 \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right)\right) \]
      2. associate-*r*77.1%

        \[\leadsto 2 \cdot \left(-1 \cdot \color{blue}{\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right)}\right) \]
      3. *-commutative77.1%

        \[\leadsto 2 \cdot \left(-1 \cdot \color{blue}{\left(\left(c \cdot \left(i \cdot b\right)\right) \cdot c\right)}\right) \]
      4. associate-*l*77.1%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(-1 \cdot \left(c \cdot \left(i \cdot b\right)\right)\right) \cdot c\right)} \]
      5. neg-mul-177.1%

        \[\leadsto 2 \cdot \left(\color{blue}{\left(-c \cdot \left(i \cdot b\right)\right)} \cdot c\right) \]
      6. *-commutative77.1%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-c \cdot \left(i \cdot b\right)\right)\right)} \]
      7. distribute-rgt-neg-in77.1%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(c \cdot \left(-i \cdot b\right)\right)}\right) \]
      8. distribute-lft-neg-in77.1%

        \[\leadsto 2 \cdot \left(c \cdot \left(c \cdot \color{blue}{\left(\left(-i\right) \cdot b\right)}\right)\right) \]
      9. associate-*r*79.1%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(\left(c \cdot \left(-i\right)\right) \cdot b\right)}\right) \]
    7. Simplified79.1%

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

    if -9.40000000000000058e64 < c < 3.0999999999999999e142

    1. Initial program 96.2%

      \[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 c around 0 74.1%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -9.4 \cdot 10^{+64} \lor \neg \left(c \leq 3.1 \cdot 10^{+142}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(i \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 9: 39.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-57} \lor \neg \left(y \leq 2.3 \cdot 10^{+91} \lor \neg \left(y \leq 8.5 \cdot 10^{+194}\right) \land y \leq 1.95 \cdot 10^{+210}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= y -1e-57)
         (not
          (or (<= y 2.3e+91) (and (not (<= y 8.5e+194)) (<= y 1.95e+210)))))
   (* 2.0 (* x y))
   (* (* z t) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210)))) {
		tmp = 2.0 * (x * y);
	} else {
		tmp = (z * t) * 2.0;
	}
	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
    real(8) :: tmp
    if ((y <= (-1d-57)) .or. (.not. (y <= 2.3d+91) .or. (.not. (y <= 8.5d+194)) .and. (y <= 1.95d+210))) then
        tmp = 2.0d0 * (x * y)
    else
        tmp = (z * t) * 2.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 tmp;
	if ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210)))) {
		tmp = 2.0 * (x * y);
	} else {
		tmp = (z * t) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (y <= -1e-57) or not ((y <= 2.3e+91) or (not (y <= 8.5e+194) and (y <= 1.95e+210))):
		tmp = 2.0 * (x * y)
	else:
		tmp = (z * t) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((y <= -1e-57) || !((y <= 2.3e+91) || (!(y <= 8.5e+194) && (y <= 1.95e+210))))
		tmp = Float64(2.0 * Float64(x * y));
	else
		tmp = Float64(Float64(z * t) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((y <= -1e-57) || ~(((y <= 2.3e+91) || (~((y <= 8.5e+194)) && (y <= 1.95e+210)))))
		tmp = 2.0 * (x * y);
	else
		tmp = (z * t) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[y, -1e-57], N[Not[Or[LessEqual[y, 2.3e+91], And[N[Not[LessEqual[y, 8.5e+194]], $MachinePrecision], LessEqual[y, 1.95e+210]]]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-57} \lor \neg \left(y \leq 2.3 \cdot 10^{+91} \lor \neg \left(y \leq 8.5 \cdot 10^{+194}\right) \land y \leq 1.95 \cdot 10^{+210}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot t\right) \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.99999999999999955e-58 or 2.29999999999999991e91 < y < 8.50000000000000026e194 or 1.95e210 < y

    1. Initial program 87.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 x around inf 45.1%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]

    if -9.99999999999999955e-58 < y < 2.29999999999999991e91 or 8.50000000000000026e194 < y < 1.95e210

    1. Initial program 91.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 z around inf 40.3%

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-57} \lor \neg \left(y \leq 2.3 \cdot 10^{+91} \lor \neg \left(y \leq 8.5 \cdot 10^{+194}\right) \land y \leq 1.95 \cdot 10^{+210}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t\right) \cdot 2\\ \end{array} \]

Alternative 10: 69.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.25 \cdot 10^{+62} \lor \neg \left(c \leq 7 \cdot 10^{+135}\right):\\ \;\;\;\;b \cdot \left(i \cdot \left(c \cdot \left(c \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -3.25e+62) (not (<= c 7e+135)))
   (* b (* i (* c (* c -2.0))))
   (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -3.25e+62) || !(c <= 7e+135)) {
		tmp = b * (i * (c * (c * -2.0)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	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
    real(8) :: tmp
    if ((c <= (-3.25d+62)) .or. (.not. (c <= 7d+135))) then
        tmp = b * (i * (c * (c * (-2.0d0))))
    else
        tmp = ((z * t) + (x * y)) * 2.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 tmp;
	if ((c <= -3.25e+62) || !(c <= 7e+135)) {
		tmp = b * (i * (c * (c * -2.0)));
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -3.25e+62) or not (c <= 7e+135):
		tmp = b * (i * (c * (c * -2.0)))
	else:
		tmp = ((z * t) + (x * y)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -3.25e+62) || !(c <= 7e+135))
		tmp = Float64(b * Float64(i * Float64(c * Float64(c * -2.0))));
	else
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -3.25e+62) || ~((c <= 7e+135)))
		tmp = b * (i * (c * (c * -2.0)));
	else
		tmp = ((z * t) + (x * y)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.25e+62], N[Not[LessEqual[c, 7e+135]], $MachinePrecision]], N[(b * N[(i * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.25 \cdot 10^{+62} \lor \neg \left(c \leq 7 \cdot 10^{+135}\right):\\
\;\;\;\;b \cdot \left(i \cdot \left(c \cdot \left(c \cdot -2\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.2500000000000001e62 or 7.0000000000000005e135 < c

    1. Initial program 79.8%

      \[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 b around inf 71.1%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg71.1%

        \[\leadsto 2 \cdot \color{blue}{\left(-{c}^{2} \cdot \left(i \cdot b\right)\right)} \]
      2. *-commutative71.1%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(i \cdot b\right) \cdot {c}^{2}}\right) \]
      3. distribute-rgt-neg-in71.1%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(i \cdot b\right) \cdot \left(-{c}^{2}\right)\right)} \]
      4. unpow271.1%

        \[\leadsto 2 \cdot \left(\left(i \cdot b\right) \cdot \left(-\color{blue}{c \cdot c}\right)\right) \]
      5. distribute-rgt-neg-in71.1%

        \[\leadsto 2 \cdot \left(\left(i \cdot b\right) \cdot \color{blue}{\left(c \cdot \left(-c\right)\right)}\right) \]
    4. Simplified71.1%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(i \cdot b\right) \cdot \left(c \cdot \left(-c\right)\right)\right)} \]
    5. Taylor expanded in i around 0 71.1%

      \[\leadsto \color{blue}{-2 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. unpow271.1%

        \[\leadsto -2 \cdot \left(\color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right) \]
      2. associate-*r*71.1%

        \[\leadsto \color{blue}{\left(-2 \cdot \left(c \cdot c\right)\right) \cdot \left(i \cdot b\right)} \]
    7. Simplified71.1%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(c \cdot c\right)\right) \cdot \left(i \cdot b\right)} \]
    8. Taylor expanded in c around 0 71.1%

      \[\leadsto \color{blue}{-2 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*71.1%

        \[\leadsto \color{blue}{\left(-2 \cdot {c}^{2}\right) \cdot \left(i \cdot b\right)} \]
      2. unpow271.1%

        \[\leadsto \left(-2 \cdot \color{blue}{\left(c \cdot c\right)}\right) \cdot \left(i \cdot b\right) \]
      3. *-commutative71.1%

        \[\leadsto \color{blue}{\left(i \cdot b\right) \cdot \left(-2 \cdot \left(c \cdot c\right)\right)} \]
      4. *-commutative71.1%

        \[\leadsto \color{blue}{\left(b \cdot i\right)} \cdot \left(-2 \cdot \left(c \cdot c\right)\right) \]
      5. associate-*l*72.3%

        \[\leadsto \color{blue}{b \cdot \left(i \cdot \left(-2 \cdot \left(c \cdot c\right)\right)\right)} \]
      6. associate-*r*72.3%

        \[\leadsto b \cdot \left(i \cdot \color{blue}{\left(\left(-2 \cdot c\right) \cdot c\right)}\right) \]
      7. *-commutative72.3%

        \[\leadsto b \cdot \left(i \cdot \color{blue}{\left(c \cdot \left(-2 \cdot c\right)\right)}\right) \]
      8. *-commutative72.3%

        \[\leadsto b \cdot \left(i \cdot \left(c \cdot \color{blue}{\left(c \cdot -2\right)}\right)\right) \]
    10. Simplified72.3%

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

    if -3.2500000000000001e62 < c < 7.0000000000000005e135

    1. Initial program 96.2%

      \[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 c around 0 74.1%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.25 \cdot 10^{+62} \lor \neg \left(c \leq 7 \cdot 10^{+135}\right):\\ \;\;\;\;b \cdot \left(i \cdot \left(c \cdot \left(c \cdot -2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 11: 68.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.45 \cdot 10^{+52} \lor \neg \left(c \leq 8.2 \cdot 10^{+135}\right):\\ \;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -3.45e+52) (not (<= c 8.2e+135)))
   (* c (* (* c (* b i)) -2.0))
   (* (+ (* z t) (* x y)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -3.45e+52) || !(c <= 8.2e+135)) {
		tmp = c * ((c * (b * i)) * -2.0);
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	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
    real(8) :: tmp
    if ((c <= (-3.45d+52)) .or. (.not. (c <= 8.2d+135))) then
        tmp = c * ((c * (b * i)) * (-2.0d0))
    else
        tmp = ((z * t) + (x * y)) * 2.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 tmp;
	if ((c <= -3.45e+52) || !(c <= 8.2e+135)) {
		tmp = c * ((c * (b * i)) * -2.0);
	} else {
		tmp = ((z * t) + (x * y)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -3.45e+52) or not (c <= 8.2e+135):
		tmp = c * ((c * (b * i)) * -2.0)
	else:
		tmp = ((z * t) + (x * y)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -3.45e+52) || !(c <= 8.2e+135))
		tmp = Float64(c * Float64(Float64(c * Float64(b * i)) * -2.0));
	else
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -3.45e+52) || ~((c <= 8.2e+135)))
		tmp = c * ((c * (b * i)) * -2.0);
	else
		tmp = ((z * t) + (x * y)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -3.45e+52], N[Not[LessEqual[c, 8.2e+135]], $MachinePrecision]], N[(c * N[(N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.45 \cdot 10^{+52} \lor \neg \left(c \leq 8.2 \cdot 10^{+135}\right):\\
\;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.44999999999999998e52 or 8.2e135 < c

    1. Initial program 79.8%

      \[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 b around inf 71.1%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg71.1%

        \[\leadsto 2 \cdot \color{blue}{\left(-{c}^{2} \cdot \left(i \cdot b\right)\right)} \]
      2. *-commutative71.1%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(i \cdot b\right) \cdot {c}^{2}}\right) \]
      3. distribute-rgt-neg-in71.1%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(i \cdot b\right) \cdot \left(-{c}^{2}\right)\right)} \]
      4. unpow271.1%

        \[\leadsto 2 \cdot \left(\left(i \cdot b\right) \cdot \left(-\color{blue}{c \cdot c}\right)\right) \]
      5. distribute-rgt-neg-in71.1%

        \[\leadsto 2 \cdot \left(\left(i \cdot b\right) \cdot \color{blue}{\left(c \cdot \left(-c\right)\right)}\right) \]
    4. Simplified71.1%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(i \cdot b\right) \cdot \left(c \cdot \left(-c\right)\right)\right)} \]
    5. Taylor expanded in i around 0 71.1%

      \[\leadsto \color{blue}{-2 \cdot \left({c}^{2} \cdot \left(i \cdot b\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative71.1%

        \[\leadsto \color{blue}{\left({c}^{2} \cdot \left(i \cdot b\right)\right) \cdot -2} \]
      2. unpow271.1%

        \[\leadsto \left(\color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right) \cdot -2 \]
      3. associate-*r*77.1%

        \[\leadsto \color{blue}{\left(c \cdot \left(c \cdot \left(i \cdot b\right)\right)\right)} \cdot -2 \]
      4. *-commutative77.1%

        \[\leadsto \left(c \cdot \left(c \cdot \color{blue}{\left(b \cdot i\right)}\right)\right) \cdot -2 \]
      5. associate-*r*77.3%

        \[\leadsto \left(c \cdot \color{blue}{\left(\left(c \cdot b\right) \cdot i\right)}\right) \cdot -2 \]
      6. associate-*l*77.3%

        \[\leadsto \color{blue}{c \cdot \left(\left(\left(c \cdot b\right) \cdot i\right) \cdot -2\right)} \]
      7. associate-*r*77.1%

        \[\leadsto c \cdot \left(\color{blue}{\left(c \cdot \left(b \cdot i\right)\right)} \cdot -2\right) \]
      8. *-commutative77.1%

        \[\leadsto c \cdot \left(\left(c \cdot \color{blue}{\left(i \cdot b\right)}\right) \cdot -2\right) \]
    7. Simplified77.1%

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

    if -3.44999999999999998e52 < c < 8.2e135

    1. Initial program 96.2%

      \[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 c around 0 74.1%

      \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x + t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.45 \cdot 10^{+52} \lor \neg \left(c \leq 8.2 \cdot 10^{+135}\right):\\ \;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 12: 29.6% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \left(z \cdot t\right) \cdot 2 \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* (* z t) 2.0))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (z * t) * 2.0;
}
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 = (z * t) * 2.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (z * t) * 2.0;
}
def code(x, y, z, t, a, b, c, i):
	return (z * t) * 2.0
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(z * t) * 2.0)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (z * t) * 2.0;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(z * t), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}

\\
\left(z \cdot t\right) \cdot 2
\end{array}
Derivation
  1. Initial program 89.8%

    \[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 z around inf 31.1%

    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  3. Final simplification31.1%

    \[\leadsto \left(z \cdot t\right) \cdot 2 \]

Developer target: 94.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\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)))))
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)));
}
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
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)));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
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
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[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}

Reproduce

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