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

Percentage Accurate: 89.6% → 95.7%
Time: 16.1s
Alternatives: 14
Speedup: 0.4×

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 14 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: 89.6% 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: 95.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ \mathbf{if}\;\left(x \cdot y + z \cdot t\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(b \cdot \left(c \cdot \left(-i\right)\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 (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
     (* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
     (* 2.0 (* c (* b (* c (- i))))))))
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 ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (c * (b * (c * -i)));
	}
	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(x * y) + Float64(z * t)) - 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(b * Float64(c * Float64(-i)))));
	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[(x * y), $MachinePrecision] + N[(z * t), $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[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\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(b \cdot \left(c \cdot \left(-i\right)\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 92.9%

      \[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. fma-def92.9%

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

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

      \[\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)} \]
    4. Add Preprocessing

    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. Add Preprocessing
    3. Taylor expanded in i around inf 57.5%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    4. Taylor expanded in a around 0 57.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + z \cdot t\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(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 94.3% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2\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) < -4.99999999999999978e282 or 9.99999999999999986e306 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 67.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. Add Preprocessing
    3. Taylor expanded in i around inf 87.5%

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

    if -4.99999999999999978e282 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 99.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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification95.0%

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

Alternative 3: 44.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -4.15 \cdot 10^{+152}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-12}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-98}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.1500000000000001e152 or 1.5500000000000001e31 < (*.f64 x y)

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in x around inf 64.9%

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

    if -4.1500000000000001e152 < (*.f64 x y) < -6.0000000000000003e-12 or -1.50000000000000008e-47 < (*.f64 x y) < 4.8000000000000001e-98

    1. Initial program 91.9%

      \[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. Add Preprocessing
    3. Taylor expanded in z around inf 43.4%

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

    if -6.0000000000000003e-12 < (*.f64 x y) < -1.50000000000000008e-47

    1. Initial program 62.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. Add Preprocessing
    3. Taylor expanded in a around inf 52.5%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg52.5%

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(-\color{blue}{i \cdot c}\right)\right) \]
      4. distribute-rgt-neg-in52.5%

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \color{blue}{\left(a \cdot \left(c \cdot i\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative52.5%

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

        \[\leadsto -2 \cdot \color{blue}{\left(c \cdot \left(i \cdot a\right)\right)} \]
    11. Simplified52.7%

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

    if 4.8000000000000001e-98 < (*.f64 x y) < 1.5500000000000001e31

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in a around inf 43.7%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg43.7%

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(-\color{blue}{i \cdot c}\right)\right) \]
      4. distribute-rgt-neg-in43.7%

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

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

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

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

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

        \[\leadsto \left(c \cdot i\right) \cdot \color{blue}{\left(a \cdot -2\right)} \]
    8. Simplified43.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.15 \cdot 10^{+152}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -6 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-47}:\\ \;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-98}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+31}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 45.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+152}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-12}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -1.75 \cdot 10^{-43}:\\ \;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
   (if (<= (* x y) -8.5e+152)
     t_2
     (if (<= (* x y) -4.5e-12)
       t_1
       (if (<= (* x y) -1.75e-43)
         (* (* c (* a i)) -2.0)
         (if (<= (* x y) 4.5e+70) 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 = 2.0 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -8.5e+152) {
		tmp = t_2;
	} else if ((x * y) <= -4.5e-12) {
		tmp = t_1;
	} else if ((x * y) <= -1.75e-43) {
		tmp = (c * (a * i)) * -2.0;
	} else if ((x * y) <= 4.5e+70) {
		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 = 2.0d0 * (z * t)
    t_2 = (x * y) * 2.0d0
    if ((x * y) <= (-8.5d+152)) then
        tmp = t_2
    else if ((x * y) <= (-4.5d-12)) then
        tmp = t_1
    else if ((x * y) <= (-1.75d-43)) then
        tmp = (c * (a * i)) * (-2.0d0)
    else if ((x * y) <= 4.5d+70) 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 = 2.0 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -8.5e+152) {
		tmp = t_2;
	} else if ((x * y) <= -4.5e-12) {
		tmp = t_1;
	} else if ((x * y) <= -1.75e-43) {
		tmp = (c * (a * i)) * -2.0;
	} else if ((x * y) <= 4.5e+70) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -8.5e+152:
		tmp = t_2
	elif (x * y) <= -4.5e-12:
		tmp = t_1
	elif (x * y) <= -1.75e-43:
		tmp = (c * (a * i)) * -2.0
	elif (x * y) <= 4.5e+70:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(z * t))
	t_2 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -8.5e+152)
		tmp = t_2;
	elseif (Float64(x * y) <= -4.5e-12)
		tmp = t_1;
	elseif (Float64(x * y) <= -1.75e-43)
		tmp = Float64(Float64(c * Float64(a * i)) * -2.0);
	elseif (Float64(x * y) <= 4.5e+70)
		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 = 2.0 * (z * t);
	t_2 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -8.5e+152)
		tmp = t_2;
	elseif ((x * y) <= -4.5e-12)
		tmp = t_1;
	elseif ((x * y) <= -1.75e-43)
		tmp = (c * (a * i)) * -2.0;
	elseif ((x * y) <= 4.5e+70)
		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[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+152], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-12], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.75e-43], N[(N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.5e+70], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+152}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-12}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -8.4999999999999993e152 or 4.4999999999999999e70 < (*.f64 x y)

    1. Initial program 83.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. Add Preprocessing
    3. Taylor expanded in x around inf 68.2%

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

    if -8.4999999999999993e152 < (*.f64 x y) < -4.49999999999999981e-12 or -1.74999999999999999e-43 < (*.f64 x y) < 4.4999999999999999e70

    1. Initial program 91.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. Add Preprocessing
    3. Taylor expanded in z around inf 39.5%

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

    if -4.49999999999999981e-12 < (*.f64 x y) < -1.74999999999999999e-43

    1. Initial program 62.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. Add Preprocessing
    3. Taylor expanded in a around inf 52.5%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg52.5%

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

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

        \[\leadsto 2 \cdot \left(a \cdot \left(-\color{blue}{i \cdot c}\right)\right) \]
      4. distribute-rgt-neg-in52.5%

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

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

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

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

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

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

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

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

      \[\leadsto -2 \cdot \color{blue}{\left(a \cdot \left(c \cdot i\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative52.5%

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

        \[\leadsto -2 \cdot \color{blue}{\left(c \cdot \left(i \cdot a\right)\right)} \]
    11. Simplified52.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+152}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -1.75 \cdot 10^{-43}:\\ \;\;\;\;\left(c \cdot \left(a \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+70}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\

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

\mathbf{elif}\;c \leq 6.8 \cdot 10^{-17}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -7.2e109 or 6.7999999999999996e-17 < c

    1. Initial program 73.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. Add Preprocessing
    3. Taylor expanded in i around inf 79.0%

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

    if -7.2e109 < c < -1.25e14

    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. Add Preprocessing
    3. Taylor expanded in x around 0 91.5%

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    4. Taylor expanded in a around 0 81.4%

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

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

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

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

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

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

    if -1.25e14 < c < -2.99999999999999983e-18

    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. Add Preprocessing
    3. Taylor expanded in a around inf 100.0%

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

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

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

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

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

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

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

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

    if -2.99999999999999983e-18 < c < 6.7999999999999996e-17

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in c around 0 79.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.2 \cdot 10^{+109}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.25 \cdot 10^{+14}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-18}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{-17}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{-131} \lor \neg \left(c \leq 2.06 \cdot 10^{-26}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.99999999999999996e-131 or 2.0599999999999999e-26 < c

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in x around 0 82.5%

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

    if -2.99999999999999996e-131 < c < 2.0599999999999999e-26

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3 \cdot 10^{-131} \lor \neg \left(c \leq 2.06 \cdot 10^{-26}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.2 \cdot 10^{+14} \lor \neg \left(c \leq 9 \cdot 10^{-25}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.2e14 or 9.0000000000000002e-25 < c

    1. Initial program 75.9%

      \[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. Add Preprocessing
    3. Taylor expanded in x around 0 85.0%

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

    if -1.2e14 < c < 9.0000000000000002e-25

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in a around inf 93.5%

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{a \cdot \left(c \cdot i\right)}\right) \]
    4. Step-by-step derivation
      1. *-commutative93.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.2 \cdot 10^{+14} \lor \neg \left(c \leq 9 \cdot 10^{-25}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - c \cdot \left(a \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 87.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -68000000000000 \lor \neg \left(c \leq 3.2 \cdot 10^{-24}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -6.8e13 or 3.20000000000000012e-24 < c

    1. Initial program 75.9%

      \[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. Add Preprocessing
    3. Taylor expanded in x around 0 85.0%

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

    if -6.8e13 < c < 3.20000000000000012e-24

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in a around inf 94.0%

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

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

      \[\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.6%

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

Alternative 9: 74.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -54000000000000 \lor \neg \left(c \leq 1.04 \cdot 10^{-16}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.4e13 or 1.04000000000000001e-16 < c

    1. Initial program 74.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. Add Preprocessing
    3. Taylor expanded in i around inf 76.9%

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

    if -5.4e13 < c < 1.04000000000000001e-16

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in c around 0 78.7%

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

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

Alternative 10: 68.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -65000000000000 \lor \neg \left(c \leq 2.15 \cdot 10^{+155}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -6.5e13 or 2.1500000000000001e155 < c

    1. Initial program 72.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. Add Preprocessing
    3. Taylor expanded in i around inf 80.8%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    4. Taylor expanded in a around 0 69.8%

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

    if -6.5e13 < c < 2.1500000000000001e155

    1. Initial program 96.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. Add Preprocessing
    3. Taylor expanded in c around 0 72.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -65000000000000 \lor \neg \left(c \leq 2.15 \cdot 10^{+155}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -58000000000000:\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\

\mathbf{elif}\;c \leq 1.3 \cdot 10^{+38}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\

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


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

    1. Initial program 73.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. Add Preprocessing
    3. Taylor expanded in i around inf 77.1%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    4. Taylor expanded in a around 0 67.5%

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

    if -5.8e13 < c < 1.3e38

    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) \]
    2. Add Preprocessing
    3. Taylor expanded in c around 0 75.7%

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

    if 1.3e38 < c

    1. Initial program 72.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. Add Preprocessing
    3. Taylor expanded in i around inf 83.4%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    4. Taylor expanded in a around 0 58.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -58000000000000:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.3 \cdot 10^{+38}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 45.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+152} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+69}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -6.2e152 or 3.39999999999999986e69 < (*.f64 x y)

    1. Initial program 83.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. Add Preprocessing
    3. Taylor expanded in x around inf 68.2%

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

    if -6.2e152 < (*.f64 x y) < 3.39999999999999986e69

    1. Initial program 89.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. Add Preprocessing
    3. Taylor expanded in z around inf 37.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+152} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+69}\right):\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 56.6% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq 4.9 \cdot 10^{+175}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < 4.90000000000000001e175

    1. Initial program 89.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. Add Preprocessing
    3. Taylor expanded in c around 0 59.4%

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

    if 4.90000000000000001e175 < i

    1. Initial program 78.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. Add Preprocessing
    3. Taylor expanded in a around inf 55.0%

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

        \[\leadsto 2 \cdot \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)} \]
      2. distribute-rgt-neg-in55.0%

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

        \[\leadsto 2 \cdot \left(a \cdot \left(-\color{blue}{i \cdot c}\right)\right) \]
      4. distribute-rgt-neg-in55.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 4.9 \cdot 10^{+175}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 30.1% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 87.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. Add Preprocessing
  3. Taylor expanded in z around inf 31.3%

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

    \[\leadsto 2 \cdot \left(z \cdot t\right) \]
  5. Add Preprocessing

Developer target: 94.1% 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 2024019 
(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))))