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

Percentage Accurate: 89.8% → 92.4%
Time: 21.8s
Alternatives: 18
Speedup: 1.0×

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 18 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.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: 92.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000004e301

    1. Initial program 97.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) \]

    if 5.0000000000000004e301 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 74.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 x around 0 95.5%

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

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

Alternative 2: 94.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ 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) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. associate-*l*95.6%

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

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

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

    \[\leadsto 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) \]

Alternative 3: 81.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -7 \cdot 10^{+34} \lor \neg \left(a \leq 5.4 \cdot 10^{+70}\right):\\
\;\;\;\;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 - i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right) + x \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.99999999999999996e34 or 5.3999999999999999e70 < a

    1. Initial program 89.6%

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

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

    if -6.99999999999999996e34 < a < 5.3999999999999999e70

    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 a around 0 88.4%

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

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

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot \left(c \cdot b\right)\right)} \cdot i\right) \]
    5. Step-by-step derivation
      1. associate--l+92.8%

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

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

        \[\leadsto 2 \cdot \left(x \cdot y + \left(z \cdot t - i \cdot \color{blue}{\left(\left(c \cdot c\right) \cdot b\right)}\right)\right) \]
    6. Applied egg-rr88.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7 \cdot 10^{+34} \lor \neg \left(a \leq 5.4 \cdot 10^{+70}\right):\\ \;\;\;\;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 - i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right) + x \cdot y\right)\\ \end{array} \]

Alternative 4: 83.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t + x \cdot y\\ \mathbf{if}\;a \leq -4.4 \cdot 10^{+53} \lor \neg \left(a \leq 2.5 \cdot 10^{+149}\right):\\ \;\;\;\;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 (or (<= a -4.4e+53) (not (<= a 2.5e+149)))
     (* 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 ((a <= -4.4e+53) || !(a <= 2.5e+149)) {
		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 ((a <= (-4.4d+53)) .or. (.not. (a <= 2.5d+149))) 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 ((a <= -4.4e+53) || !(a <= 2.5e+149)) {
		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 (a <= -4.4e+53) or not (a <= 2.5e+149):
		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 ((a <= -4.4e+53) || !(a <= 2.5e+149))
		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 ((a <= -4.4e+53) || ~((a <= 2.5e+149)))
		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[Or[LessEqual[a, -4.4e+53], N[Not[LessEqual[a, 2.5e+149]], $MachinePrecision]], 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}\;a \leq -4.4 \cdot 10^{+53} \lor \neg \left(a \leq 2.5 \cdot 10^{+149}\right):\\
\;\;\;\;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 2 regimes
  2. if a < -4.39999999999999997e53 or 2.49999999999999995e149 < a

    1. Initial program 92.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 inf 90.4%

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

    if -4.39999999999999997e53 < a < 2.49999999999999995e149

    1. Initial program 94.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 0 82.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. unpow282.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*88.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. Simplified88.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{+53} \lor \neg \left(a \leq 2.5 \cdot 10^{+149}\right):\\ \;\;\;\;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 5: 83.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot t + x \cdot y\\ \mathbf{if}\;a \leq -2.6 \cdot 10^{+52} \lor \neg \left(a \leq 5.5 \cdot 10^{+70}\right):\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\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 (or (<= a -2.6e+52) (not (<= a 5.5e+70)))
     (* 2.0 (- t_1 (* i (* a c))))
     (* 2.0 (- t_1 (* i (* c (* b c))))))))
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 ((a <= -2.6e+52) || !(a <= 5.5e+70)) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} else {
		tmp = 2.0 * (t_1 - (i * (c * (b * 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) :: t_1
    real(8) :: tmp
    t_1 = (z * t) + (x * y)
    if ((a <= (-2.6d+52)) .or. (.not. (a <= 5.5d+70))) then
        tmp = 2.0d0 * (t_1 - (i * (a * c)))
    else
        tmp = 2.0d0 * (t_1 - (i * (c * (b * 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 t_1 = (z * t) + (x * y);
	double tmp;
	if ((a <= -2.6e+52) || !(a <= 5.5e+70)) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} else {
		tmp = 2.0 * (t_1 - (i * (c * (b * c))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (z * t) + (x * y)
	tmp = 0
	if (a <= -2.6e+52) or not (a <= 5.5e+70):
		tmp = 2.0 * (t_1 - (i * (a * c)))
	else:
		tmp = 2.0 * (t_1 - (i * (c * (b * c))))
	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 ((a <= -2.6e+52) || !(a <= 5.5e+70))
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(b * c)))));
	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 ((a <= -2.6e+52) || ~((a <= 5.5e+70)))
		tmp = 2.0 * (t_1 - (i * (a * c)));
	else
		tmp = 2.0 * (t_1 - (i * (c * (b * c))));
	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[Or[LessEqual[a, -2.6e+52], N[Not[LessEqual[a, 5.5e+70]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot t + x \cdot y\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+52} \lor \neg \left(a \leq 5.5 \cdot 10^{+70}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.6e52 or 5.49999999999999986e70 < a

    1. Initial program 89.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 a around inf 87.4%

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

    if -2.6e52 < a < 5.49999999999999986e70

    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 a around 0 87.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{+52} \lor \neg \left(a \leq 5.5 \cdot 10^{+70}\right):\\ \;\;\;\;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) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 6: 74.4% accurate, 0.9× 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 -6.2 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -0.016:\\ \;\;\;\;2 \cdot \left(z \cdot t - \left(b \cdot i\right) \cdot \left(c \cdot c\right)\right)\\ \mathbf{elif}\;c \leq -1 \cdot 10^{-47}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \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 -6.2e+105)
     t_1
     (if (<= c -0.016)
       (* 2.0 (- (* z t) (* (* b i) (* c c))))
       (if (<= c -1e-47)
         (* 2.0 (- (* x y) (* i (* a c))))
         (if (<= c 2.1e+56) (* 2.0 (+ (* z t) (* x y))) 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 <= -6.2e+105) {
		tmp = t_1;
	} else if (c <= -0.016) {
		tmp = 2.0 * ((z * t) - ((b * i) * (c * c)));
	} else if (c <= -1e-47) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 2.1e+56) {
		tmp = 2.0 * ((z * t) + (x * y));
	} 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 <= (-6.2d+105)) then
        tmp = t_1
    else if (c <= (-0.016d0)) then
        tmp = 2.0d0 * ((z * t) - ((b * i) * (c * c)))
    else if (c <= (-1d-47)) then
        tmp = 2.0d0 * ((x * y) - (i * (a * c)))
    else if (c <= 2.1d+56) then
        tmp = 2.0d0 * ((z * t) + (x * y))
    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 <= -6.2e+105) {
		tmp = t_1;
	} else if (c <= -0.016) {
		tmp = 2.0 * ((z * t) - ((b * i) * (c * c)));
	} else if (c <= -1e-47) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 2.1e+56) {
		tmp = 2.0 * ((z * t) + (x * y));
	} 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 <= -6.2e+105:
		tmp = t_1
	elif c <= -0.016:
		tmp = 2.0 * ((z * t) - ((b * i) * (c * c)))
	elif c <= -1e-47:
		tmp = 2.0 * ((x * y) - (i * (a * c)))
	elif c <= 2.1e+56:
		tmp = 2.0 * ((z * t) + (x * y))
	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 <= -6.2e+105)
		tmp = t_1;
	elseif (c <= -0.016)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(Float64(b * i) * Float64(c * c))));
	elseif (c <= -1e-47)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c))));
	elseif (c <= 2.1e+56)
		tmp = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)));
	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 <= -6.2e+105)
		tmp = t_1;
	elseif (c <= -0.016)
		tmp = 2.0 * ((z * t) - ((b * i) * (c * c)));
	elseif (c <= -1e-47)
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	elseif (c <= 2.1e+56)
		tmp = 2.0 * ((z * t) + (x * y));
	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, -6.2e+105], t$95$1, If[LessEqual[c, -0.016], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(N[(b * i), $MachinePrecision] * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1e-47], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+56], N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $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 -6.2 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -0.016:\\
\;\;\;\;2 \cdot \left(z \cdot t - \left(b \cdot i\right) \cdot \left(c \cdot c\right)\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -6.20000000000000008e105 or 2.10000000000000017e56 < c

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

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

    if -6.20000000000000008e105 < c < -0.016

    1. Initial program 92.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 a around 0 89.2%

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

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

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

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

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

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

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

    if -0.016 < c < -9.9999999999999997e-48

    1. Initial program 99.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 0 63.7%

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

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

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

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

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

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

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

    if -9.9999999999999997e-48 < c < 2.10000000000000017e56

    1. Initial program 97.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 80.2%

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

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

Alternative 7: 48.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -2.35 \cdot 10^{+40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -1.3 \cdot 10^{-130}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.52 \cdot 10^{-164}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{+62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 1.66 \cdot 10^{+107}:\\ \;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\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 (* -2.0 (* b (* c (* c i))))))
   (if (<= c -2.35e+40)
     t_2
     (if (<= c -1.3e-130)
       t_1
       (if (<= c -1.52e-164)
         (* 2.0 (* x y))
         (if (<= c 7.8e+62)
           t_1
           (if (<= c 1.66e+107) (* a (* i (* c -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 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -2.35e+40) {
		tmp = t_2;
	} else if (c <= -1.3e-130) {
		tmp = t_1;
	} else if (c <= -1.52e-164) {
		tmp = 2.0 * (x * y);
	} else if (c <= 7.8e+62) {
		tmp = t_1;
	} else if (c <= 1.66e+107) {
		tmp = a * (i * (c * -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 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-2.35d+40)) then
        tmp = t_2
    else if (c <= (-1.3d-130)) then
        tmp = t_1
    else if (c <= (-1.52d-164)) then
        tmp = 2.0d0 * (x * y)
    else if (c <= 7.8d+62) then
        tmp = t_1
    else if (c <= 1.66d+107) then
        tmp = a * (i * (c * (-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 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -2.35e+40) {
		tmp = t_2;
	} else if (c <= -1.3e-130) {
		tmp = t_1;
	} else if (c <= -1.52e-164) {
		tmp = 2.0 * (x * y);
	} else if (c <= 7.8e+62) {
		tmp = t_1;
	} else if (c <= 1.66e+107) {
		tmp = a * (i * (c * -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 = -2.0 * (b * (c * (c * i)))
	tmp = 0
	if c <= -2.35e+40:
		tmp = t_2
	elif c <= -1.3e-130:
		tmp = t_1
	elif c <= -1.52e-164:
		tmp = 2.0 * (x * y)
	elif c <= 7.8e+62:
		tmp = t_1
	elif c <= 1.66e+107:
		tmp = a * (i * (c * -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(-2.0 * Float64(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -2.35e+40)
		tmp = t_2;
	elseif (c <= -1.3e-130)
		tmp = t_1;
	elseif (c <= -1.52e-164)
		tmp = Float64(2.0 * Float64(x * y));
	elseif (c <= 7.8e+62)
		tmp = t_1;
	elseif (c <= 1.66e+107)
		tmp = Float64(a * Float64(i * Float64(c * -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 = -2.0 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -2.35e+40)
		tmp = t_2;
	elseif (c <= -1.3e-130)
		tmp = t_1;
	elseif (c <= -1.52e-164)
		tmp = 2.0 * (x * y);
	elseif (c <= 7.8e+62)
		tmp = t_1;
	elseif (c <= 1.66e+107)
		tmp = a * (i * (c * -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[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.35e+40], t$95$2, If[LessEqual[c, -1.3e-130], t$95$1, If[LessEqual[c, -1.52e-164], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7.8e+62], t$95$1, If[LessEqual[c, 1.66e+107], N[(a * N[(i * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -1.3 \cdot 10^{-130}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -1.52 \cdot 10^{-164}:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;c \leq 7.8 \cdot 10^{+62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 1.66 \cdot 10^{+107}:\\
\;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.3500000000000002e40 or 1.6599999999999999e107 < c

    1. Initial program 88.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. associate-*r*93.7%

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\left(b \cdot c + a\right)}\right) \]
      4. distribute-lft-in80.1%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(-\color{blue}{c \cdot c}\right) \cdot \left(i \cdot b\right)\right) \]
      4. distribute-lft-neg-in62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3500000000000002e40 < c < -1.3e-130 or -1.52000000000000007e-164 < c < 7.8e62

    1. Initial program 96.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. Taylor expanded in z around inf 47.2%

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

    if -1.3e-130 < c < -1.52000000000000007e-164

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

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

    if 7.8e62 < c < 1.6599999999999999e107

    1. Initial program 92.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 inf 67.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.35 \cdot 10^{+40}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.3 \cdot 10^{-130}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq -1.52 \cdot 10^{-164}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{+62}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.66 \cdot 10^{+107}:\\ \;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 8: 79.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{-14} \lor \neg \left(c \leq 2.7 \cdot 10^{-31}\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(z \cdot t + x \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.4500000000000001e-14 or 2.70000000000000014e-31 < c

    1. Initial program 89.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 x around 0 81.5%

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

    if -1.4500000000000001e-14 < c < 2.70000000000000014e-31

    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 c around 0 80.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.45 \cdot 10^{-14} \lor \neg \left(c \leq 2.7 \cdot 10^{-31}\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(z \cdot t + x \cdot y\right)\\ \end{array} \]

Alternative 9: 80.0% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.35000000000000008e-25

    1. Initial program 94.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 z around 0 84.8%

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

    if -1.35000000000000008e-25 < c < 3.8e-27

    1. Initial program 98.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 81.2%

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

    if 3.8e-27 < c

    1. Initial program 84.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 x around 0 80.8%

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

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

Alternative 10: 86.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 94.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 90.7%

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

    if -1.7e44 < c < 3.9e9

    1. Initial program 97.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 inf 90.1%

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

    if 3.9e9 < c

    1. Initial program 84.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 0 83.3%

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

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

Alternative 11: 94.0% accurate, 1.0× speedup?

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

\\
2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 93.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. Step-by-step derivation
    1. associate-*l*95.6%

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

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

    \[\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. Step-by-step derivation
    1. fma-def95.6%

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

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

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

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

Alternative 12: 68.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -8.5 \cdot 10^{+139} \lor \neg \left(c \leq -1.35 \cdot 10^{+88} \lor \neg \left(c \leq -1 \cdot 10^{+44}\right) \land c \leq 2.9 \cdot 10^{+143}\right):\\
\;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -8.5e139 or -1.35000000000000008e88 < c < -1.0000000000000001e44 or 2.8999999999999998e143 < c

    1. Initial program 88.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. Step-by-step derivation
      1. associate-*r*93.5%

        \[\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. *-commutative93.5%

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\left(b \cdot c + a\right)}\right) \]
      4. distribute-lft-in78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e139 < c < -1.35000000000000008e88 or -1.0000000000000001e44 < c < 2.8999999999999998e143

    1. Initial program 95.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 73.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+139} \lor \neg \left(c \leq -1.35 \cdot 10^{+88} \lor \neg \left(c \leq -1 \cdot 10^{+44}\right) \land c \leq 2.9 \cdot 10^{+143}\right):\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \]

Alternative 13: 68.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -8.5 \cdot 10^{+139}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -3 \cdot 10^{+87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{+44}:\\ \;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq 6 \cdot 10^{+143}:\\ \;\;\;\;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) (* x y)))) (t_2 (* -2.0 (* b (* c (* c i))))))
   (if (<= c -8.5e+139)
     t_2
     (if (<= c -3e+87)
       t_1
       (if (<= c -1.05e+44)
         (* c (* (* c (* b i)) -2.0))
         (if (<= c 6e+143) 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) + (x * y));
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -8.5e+139) {
		tmp = t_2;
	} else if (c <= -3e+87) {
		tmp = t_1;
	} else if (c <= -1.05e+44) {
		tmp = c * ((c * (b * i)) * -2.0);
	} else if (c <= 6e+143) {
		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) + (x * y))
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-8.5d+139)) then
        tmp = t_2
    else if (c <= (-3d+87)) then
        tmp = t_1
    else if (c <= (-1.05d+44)) then
        tmp = c * ((c * (b * i)) * (-2.0d0))
    else if (c <= 6d+143) 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) + (x * y));
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -8.5e+139) {
		tmp = t_2;
	} else if (c <= -3e+87) {
		tmp = t_1;
	} else if (c <= -1.05e+44) {
		tmp = c * ((c * (b * i)) * -2.0);
	} else if (c <= 6e+143) {
		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) + (x * y))
	t_2 = -2.0 * (b * (c * (c * i)))
	tmp = 0
	if c <= -8.5e+139:
		tmp = t_2
	elif c <= -3e+87:
		tmp = t_1
	elif c <= -1.05e+44:
		tmp = c * ((c * (b * i)) * -2.0)
	elif c <= 6e+143:
		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(Float64(z * t) + Float64(x * y)))
	t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -8.5e+139)
		tmp = t_2;
	elseif (c <= -3e+87)
		tmp = t_1;
	elseif (c <= -1.05e+44)
		tmp = Float64(c * Float64(Float64(c * Float64(b * i)) * -2.0));
	elseif (c <= 6e+143)
		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) + (x * y));
	t_2 = -2.0 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -8.5e+139)
		tmp = t_2;
	elseif (c <= -3e+87)
		tmp = t_1;
	elseif (c <= -1.05e+44)
		tmp = c * ((c * (b * i)) * -2.0);
	elseif (c <= 6e+143)
		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[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+139], t$95$2, If[LessEqual[c, -3e+87], t$95$1, If[LessEqual[c, -1.05e+44], N[(c * N[(N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6e+143], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -3 \cdot 10^{+87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -1.05 \cdot 10^{+44}:\\
\;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\

\mathbf{elif}\;c \leq 6 \cdot 10^{+143}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -8.5e139 or 6.0000000000000001e143 < c

    1. Initial program 86.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. Step-by-step derivation
      1. associate-*r*93.8%

        \[\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. *-commutative93.8%

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\left(b \cdot c + a\right)}\right) \]
      4. distribute-lft-in75.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(-\color{blue}{c \cdot c}\right) \cdot \left(i \cdot b\right)\right) \]
      4. distribute-lft-neg-in68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e139 < c < -2.9999999999999999e87 or -1.04999999999999993e44 < c < 6.0000000000000001e143

    1. Initial program 95.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 73.6%

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

    if -2.9999999999999999e87 < c < -1.04999999999999993e44

    1. Initial program 99.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. associate-*r*91.8%

        \[\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. *-commutative91.8%

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\left(b \cdot c + a\right)}\right) \]
      4. distribute-lft-in91.8%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(-\color{blue}{c \cdot c}\right) \cdot \left(i \cdot b\right)\right) \]
      4. distribute-lft-neg-in83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+139}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{+87}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{+44}:\\ \;\;\;\;c \cdot \left(\left(c \cdot \left(b \cdot i\right)\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq 6 \cdot 10^{+143}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 14: 68.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -8.5 \cdot 10^{+143}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.38 \cdot 10^{+48}:\\ \;\;\;\;2 \cdot \left(\left(b \cdot i\right) \cdot \left(-c \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.3 \cdot 10^{+145}:\\ \;\;\;\;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) (* x y)))) (t_2 (* -2.0 (* b (* c (* c i))))))
   (if (<= c -8.5e+143)
     t_2
     (if (<= c -1.15e+89)
       t_1
       (if (<= c -1.38e+48)
         (* 2.0 (* (* b i) (- (* c c))))
         (if (<= c 3.3e+145) 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) + (x * y));
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -8.5e+143) {
		tmp = t_2;
	} else if (c <= -1.15e+89) {
		tmp = t_1;
	} else if (c <= -1.38e+48) {
		tmp = 2.0 * ((b * i) * -(c * c));
	} else if (c <= 3.3e+145) {
		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) + (x * y))
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-8.5d+143)) then
        tmp = t_2
    else if (c <= (-1.15d+89)) then
        tmp = t_1
    else if (c <= (-1.38d+48)) then
        tmp = 2.0d0 * ((b * i) * -(c * c))
    else if (c <= 3.3d+145) 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) + (x * y));
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -8.5e+143) {
		tmp = t_2;
	} else if (c <= -1.15e+89) {
		tmp = t_1;
	} else if (c <= -1.38e+48) {
		tmp = 2.0 * ((b * i) * -(c * c));
	} else if (c <= 3.3e+145) {
		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) + (x * y))
	t_2 = -2.0 * (b * (c * (c * i)))
	tmp = 0
	if c <= -8.5e+143:
		tmp = t_2
	elif c <= -1.15e+89:
		tmp = t_1
	elif c <= -1.38e+48:
		tmp = 2.0 * ((b * i) * -(c * c))
	elif c <= 3.3e+145:
		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(Float64(z * t) + Float64(x * y)))
	t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -8.5e+143)
		tmp = t_2;
	elseif (c <= -1.15e+89)
		tmp = t_1;
	elseif (c <= -1.38e+48)
		tmp = Float64(2.0 * Float64(Float64(b * i) * Float64(-Float64(c * c))));
	elseif (c <= 3.3e+145)
		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) + (x * y));
	t_2 = -2.0 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -8.5e+143)
		tmp = t_2;
	elseif (c <= -1.15e+89)
		tmp = t_1;
	elseif (c <= -1.38e+48)
		tmp = 2.0 * ((b * i) * -(c * c));
	elseif (c <= 3.3e+145)
		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[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+143], t$95$2, If[LessEqual[c, -1.15e+89], t$95$1, If[LessEqual[c, -1.38e+48], N[(2.0 * N[(N[(b * i), $MachinePrecision] * (-N[(c * c), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.3e+145], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -1.15 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -1.38 \cdot 10^{+48}:\\
\;\;\;\;2 \cdot \left(\left(b \cdot i\right) \cdot \left(-c \cdot c\right)\right)\\

\mathbf{elif}\;c \leq 3.3 \cdot 10^{+145}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -8.4999999999999998e143 or 3.30000000000000027e145 < c

    1. Initial program 86.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. Step-by-step derivation
      1. associate-*r*93.8%

        \[\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. *-commutative93.8%

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot i\right) \cdot \color{blue}{\left(b \cdot c + a\right)}\right) \]
      4. distribute-lft-in75.7%

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(-\color{blue}{c \cdot c}\right) \cdot \left(i \cdot b\right)\right) \]
      4. distribute-lft-neg-in68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999998e143 < c < -1.1499999999999999e89 or -1.3800000000000001e48 < c < 3.30000000000000027e145

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

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

    if -1.1499999999999999e89 < c < -1.3800000000000001e48

    1. Initial program 99.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. Taylor expanded in b around inf 79.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{+143}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{+89}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq -1.38 \cdot 10^{+48}:\\ \;\;\;\;2 \cdot \left(\left(b \cdot i\right) \cdot \left(-c \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.3 \cdot 10^{+145}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 15: 74.5% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.38 \cdot 10^{+41} \lor \neg \left(c \leq 4 \cdot 10^{+54}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.3800000000000001e41 or 4.0000000000000003e54 < c

    1. Initial program 88.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. Taylor expanded in i around inf 77.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 -1.3800000000000001e41 < c < 4.0000000000000003e54

    1. Initial program 97.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 76.7%

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

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

Alternative 16: 40.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+104}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2950000000:\\
\;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\

\mathbf{elif}\;z \leq 5000000:\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.10000000000000017e104 or 5e6 < z

    1. Initial program 92.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 60.5%

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

    if -3.10000000000000017e104 < z < -2.95e9

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

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

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

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

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

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

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

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

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

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

    if -2.95e9 < z < 5e6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+104}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -2950000000:\\ \;\;\;\;a \cdot \left(i \cdot \left(c \cdot -2\right)\right)\\ \mathbf{elif}\;z \leq 5000000:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 17: 40.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+14} \lor \neg \left(z \leq 105000000\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6e14 or 1.05e8 < z

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

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

    if -3.6e14 < z < 1.05e8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+14} \lor \neg \left(z \leq 105000000\right):\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 18: 29.6% 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 93.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 z around inf 33.4%

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

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

Developer target: 94.0% 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 2023274 
(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))))