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

Percentage Accurate: 90.5% → 94.9%
Time: 12.5s
Alternatives: 14
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 90.5% 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: 94.9% accurate, 0.5× speedup?

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

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+298}:\\
\;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - t_2\right) \cdot 2\\

\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 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.99999999999999976e270

    1. Initial program 84.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in i around inf 98.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 -4.99999999999999976e270 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000003e298

    1. Initial program 99.3%

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

    if 5.0000000000000003e298 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 81.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 0 92.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -5 \cdot 10^{+270}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(-\left(a + b \cdot c\right)\right)\right)\right)\\ \mathbf{elif}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 5 \cdot 10^{+298}:\\ \;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\ \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: 96.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 96.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-*l*98.4%

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

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

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

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

    1. Initial program 0.0%

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

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

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

Alternative 3: 96.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := z \cdot t + x \cdot y\\ \mathbf{if}\;t_2 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(-t_1\right)\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 (+ (* z t) (* x y))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* c (* i (- t_1)))))))
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 = (z * t) + (x * y);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (c * (i * -t_1));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (z * t) + (x * y);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (c * (i * -t_1));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (z * t) + (x * y)
	tmp = 0
	if (t_2 - ((c * t_1) * i)) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = 2.0 * (c * (i * -t_1))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(z * t) + Float64(x * y))
	tmp = 0.0
	if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(c * Float64(i * Float64(-t_1))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (z * t) + (x * y);
	tmp = 0.0;
	if ((t_2 - ((c * t_1) * i)) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * (c * (i * -t_1));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(c * N[(i * (-t$95$1)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


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

    1. Initial program 96.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-*l*98.4%

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

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

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

        \[\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. +-commutative98.4%

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

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

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

    1. Initial program 0.0%

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

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

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

Alternative 4: 79.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -2.05 \cdot 10^{-10}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.55 \cdot 10^{-97}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3.2 \cdot 10^{-111}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{-24}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
   (if (<= c -2.05e-10)
     t_1
     (if (<= c -1.55e-97)
       (* 2.0 (- (* x y) (* a (* c i))))
       (if (<= c -3.2e-111)
         (* 2.0 (- (* z t) (* i (* a c))))
         (if (<= c 3.8e-24) (* (+ (* z t) (* x y)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	double tmp;
	if (c <= -2.05e-10) {
		tmp = t_1;
	} else if (c <= -1.55e-97) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= -3.2e-111) {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	} else if (c <= 3.8e-24) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
    if (c <= (-2.05d-10)) then
        tmp = t_1
    else if (c <= (-1.55d-97)) then
        tmp = 2.0d0 * ((x * y) - (a * (c * i)))
    else if (c <= (-3.2d-111)) then
        tmp = 2.0d0 * ((z * t) - (i * (a * c)))
    else if (c <= 3.8d-24) then
        tmp = ((z * t) + (x * y)) * 2.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	double tmp;
	if (c <= -2.05e-10) {
		tmp = t_1;
	} else if (c <= -1.55e-97) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= -3.2e-111) {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	} else if (c <= 3.8e-24) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)))
	tmp = 0
	if c <= -2.05e-10:
		tmp = t_1
	elif c <= -1.55e-97:
		tmp = 2.0 * ((x * y) - (a * (c * i)))
	elif c <= -3.2e-111:
		tmp = 2.0 * ((z * t) - (i * (a * c)))
	elif c <= 3.8e-24:
		tmp = ((z * t) + (x * y)) * 2.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))))
	tmp = 0.0
	if (c <= -2.05e-10)
		tmp = t_1;
	elseif (c <= -1.55e-97)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i))));
	elseif (c <= -3.2e-111)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c))));
	elseif (c <= 3.8e-24)
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	tmp = 0.0;
	if (c <= -2.05e-10)
		tmp = t_1;
	elseif (c <= -1.55e-97)
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	elseif (c <= -3.2e-111)
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	elseif (c <= 3.8e-24)
		tmp = ((z * t) + (x * y)) * 2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.05e-10], t$95$1, If[LessEqual[c, -1.55e-97], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -3.2e-111], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e-24], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \leq -3.2 \cdot 10^{-111}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.0499999999999999e-10 or 3.80000000000000026e-24 < c

    1. Initial program 87.6%

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

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

    if -2.0499999999999999e-10 < c < -1.55000000000000001e-97

    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 a around inf 86.5%

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

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

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

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

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

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

    if -1.55000000000000001e-97 < c < -3.1999999999999998e-111

    1. Initial program 100.0%

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

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

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

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

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

    if -3.1999999999999998e-111 < c < 3.80000000000000026e-24

    1. Initial program 99.0%

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

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

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

Alternative 5: 81.5% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -4.99999999999999962e-25 or 1e18 < (*.f64 z t)

    1. Initial program 90.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.2%

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

    if -4.99999999999999962e-25 < (*.f64 z t) < 1e18

    1. Initial program 96.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 0 87.9%

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

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

Alternative 6: 67.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{if}\;c \leq -4.2 \cdot 10^{+95}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -2.3 \cdot 10^{+33}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{+23}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1 \cdot 10^{-111}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.7 \cdot 10^{+58}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(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 (* 2.0 (* c (* i (* b (- c)))))))
   (if (<= c -4.2e+95)
     t_1
     (if (<= c -2.3e+33)
       (* 2.0 (- (* z t) (* i (* a c))))
       (if (<= c -1.05e+23)
         t_1
         (if (<= c -1e-111)
           (* 2.0 (- (* x y) (* a (* c i))))
           (if (<= c 3.7e+58)
             (* (+ (* z t) (* x y)) 2.0)
             (* 2.0 (* c (* c (- (* b i))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (c * (i * (b * -c)));
	double tmp;
	if (c <= -4.2e+95) {
		tmp = t_1;
	} else if (c <= -2.3e+33) {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	} else if (c <= -1.05e+23) {
		tmp = t_1;
	} else if (c <= -1e-111) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= 3.7e+58) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = 2.0 * (c * (c * -(b * i)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (c * (i * (b * -c)))
    if (c <= (-4.2d+95)) then
        tmp = t_1
    else if (c <= (-2.3d+33)) then
        tmp = 2.0d0 * ((z * t) - (i * (a * c)))
    else if (c <= (-1.05d+23)) then
        tmp = t_1
    else if (c <= (-1d-111)) then
        tmp = 2.0d0 * ((x * y) - (a * (c * i)))
    else if (c <= 3.7d+58) then
        tmp = ((z * t) + (x * y)) * 2.0d0
    else
        tmp = 2.0d0 * (c * (c * -(b * i)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (c * (i * (b * -c)));
	double tmp;
	if (c <= -4.2e+95) {
		tmp = t_1;
	} else if (c <= -2.3e+33) {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	} else if (c <= -1.05e+23) {
		tmp = t_1;
	} else if (c <= -1e-111) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= 3.7e+58) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = 2.0 * (c * (c * -(b * i)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (c * (i * (b * -c)))
	tmp = 0
	if c <= -4.2e+95:
		tmp = t_1
	elif c <= -2.3e+33:
		tmp = 2.0 * ((z * t) - (i * (a * c)))
	elif c <= -1.05e+23:
		tmp = t_1
	elif c <= -1e-111:
		tmp = 2.0 * ((x * y) - (a * (c * i)))
	elif c <= 3.7e+58:
		tmp = ((z * t) + (x * y)) * 2.0
	else:
		tmp = 2.0 * (c * (c * -(b * i)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(c * Float64(i * Float64(b * Float64(-c)))))
	tmp = 0.0
	if (c <= -4.2e+95)
		tmp = t_1;
	elseif (c <= -2.3e+33)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c))));
	elseif (c <= -1.05e+23)
		tmp = t_1;
	elseif (c <= -1e-111)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i))));
	elseif (c <= 3.7e+58)
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	else
		tmp = Float64(2.0 * Float64(c * Float64(c * Float64(-Float64(b * i)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (c * (i * (b * -c)));
	tmp = 0.0;
	if (c <= -4.2e+95)
		tmp = t_1;
	elseif (c <= -2.3e+33)
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	elseif (c <= -1.05e+23)
		tmp = t_1;
	elseif (c <= -1e-111)
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	elseif (c <= 3.7e+58)
		tmp = ((z * t) + (x * y)) * 2.0;
	else
		tmp = 2.0 * (c * (c * -(b * i)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(i * N[(b * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.2e+95], t$95$1, If[LessEqual[c, -2.3e+33], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.05e+23], t$95$1, If[LessEqual[c, -1e-111], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.7e+58], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(c * (-N[(b * i), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -2.3 \cdot 10^{+33}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\

\mathbf{elif}\;c \leq -1.05 \cdot 10^{+23}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -4.2e95 or -2.30000000000000011e33 < c < -1.0500000000000001e23

    1. Initial program 87.6%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate-*l*89.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. fma-def89.8%

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

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

        \[\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. +-commutative89.8%

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

      \[\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. Taylor expanded in a around 0 85.9%

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

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)} - 1\right)}\right) \]
      3. associate-*l*51.8%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{c \cdot \left(b \cdot \left(c \cdot i\right)\right)}\right)} - 1\right)\right) \]
    8. Applied egg-rr51.8%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\right)}\right) \]
      2. expm1-log1p85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e95 < c < -2.30000000000000011e33

    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 a around inf 80.5%

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

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

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

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

    if -1.0500000000000001e23 < c < -1.00000000000000009e-111

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if -1.00000000000000009e-111 < c < 3.7000000000000002e58

    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 85.5%

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

    if 3.7000000000000002e58 < c

    1. Initial program 81.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. Step-by-step derivation
      1. associate-*l*90.2%

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

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

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

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

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

      \[\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. Taylor expanded in a around 0 76.2%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)\right)}\right) \]
      2. expm1-udef43.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)} - 1\right)}\right) \]
      3. associate-*l*43.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{c \cdot \left(b \cdot \left(c \cdot i\right)\right)}\right)} - 1\right)\right) \]
    8. Applied egg-rr43.5%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\right)}\right) \]
      2. expm1-log1p78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.2 \cdot 10^{+95}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.3 \cdot 10^{+33}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{+23}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -1 \cdot 10^{-111}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.7 \cdot 10^{+58}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(-b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 7: 87.1% 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 -6.5 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\ \mathbf{elif}\;c \leq 6.1 \cdot 10^{+53}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 -6.5e+20)
     (* 2.0 (- (* z t) t_1))
     (if (<= c 6.1e+53)
       (* 2.0 (- (+ (* z t) (* x y)) (* i (* a c))))
       (* 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 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -6.5e+20) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 6.1e+53) {
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	} else {
		tmp = 2.0 * ((x * y) - 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 <= (-6.5d+20)) then
        tmp = 2.0d0 * ((z * t) - t_1)
    else if (c <= 6.1d+53) then
        tmp = 2.0d0 * (((z * t) + (x * y)) - (i * (a * c)))
    else
        tmp = 2.0d0 * ((x * y) - 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 <= -6.5e+20) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 6.1e+53) {
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	} else {
		tmp = 2.0 * ((x * y) - 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 <= -6.5e+20:
		tmp = 2.0 * ((z * t) - t_1)
	elif c <= 6.1e+53:
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)))
	else:
		tmp = 2.0 * ((x * y) - 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 <= -6.5e+20)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_1));
	elseif (c <= 6.1e+53)
		tmp = Float64(2.0 * Float64(Float64(Float64(z * t) + Float64(x * y)) - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -6.5e+20)
		tmp = 2.0 * ((z * t) - t_1);
	elseif (c <= 6.1e+53)
		tmp = 2.0 * (((z * t) + (x * y)) - (i * (a * c)));
	else
		tmp = 2.0 * ((x * y) - 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, -6.5e+20], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.1e+53], 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[(x * y), $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 -6.5 \cdot 10^{+20}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\

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

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


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

    1. Initial program 89.8%

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

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

    if -6.5e20 < c < 6.1000000000000002e53

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

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

    if 6.1000000000000002e53 < c

    1. Initial program 81.6%

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

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

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

Alternative 8: 75.2% accurate, 1.2× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.8e7 or 8.5999999999999994e38 < c

    1. Initial program 86.5%

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

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

    if -4.8e7 < c < 8.5999999999999994e38

    1. Initial program 99.2%

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

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

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

Alternative 9: 68.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.2 \cdot 10^{+101} \lor \neg \left(c \leq 1.5 \cdot 10^{+59}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(-b \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.2000000000000001e101 or 1.5e59 < c

    1. Initial program 83.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-*l*90.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. fma-def91.7%

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

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

        \[\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. +-commutative90.5%

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

      \[\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. Taylor expanded in a around 0 81.4%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)\right)}\right) \]
      2. expm1-udef46.1%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)} - 1\right)}\right) \]
      3. associate-*l*46.1%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{c \cdot \left(b \cdot \left(c \cdot i\right)\right)}\right)} - 1\right)\right) \]
    8. Applied egg-rr46.1%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\right)}\right) \]
      2. expm1-log1p82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e101 < c < 1.5e59

    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 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.3%

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

Alternative 10: 68.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.9 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\

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

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


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

    1. Initial program 86.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. Step-by-step derivation
      1. associate-*l*90.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. fma-def90.8%

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

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

        \[\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. +-commutative90.8%

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

      \[\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. Taylor expanded in a around 0 86.4%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)\right)}\right) \]
      2. expm1-udef48.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)} - 1\right)}\right) \]
      3. associate-*l*48.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{c \cdot \left(b \cdot \left(c \cdot i\right)\right)}\right)} - 1\right)\right) \]
    8. Applied egg-rr48.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8999999999999999e101 < c < 1.7e58

    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 73.6%

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

    if 1.7e58 < c

    1. Initial program 81.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. Step-by-step derivation
      1. associate-*l*90.2%

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

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

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

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

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

      \[\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. Taylor expanded in a around 0 76.2%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)\right)}\right) \]
      2. expm1-udef43.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(c \cdot b\right) \cdot \left(c \cdot i\right)\right)} - 1\right)}\right) \]
      3. associate-*l*43.5%

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{c \cdot \left(b \cdot \left(c \cdot i\right)\right)}\right)} - 1\right)\right) \]
    8. Applied egg-rr43.5%

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

        \[\leadsto 2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\right)}\right) \]
      2. expm1-log1p78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y\right)\\ t_2 := 2 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;t \leq -1.42 \cdot 10^{-192}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9.8 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-103}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+135}:\\ \;\;\;\;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 (* x y))) (t_2 (* 2.0 (* z t))))
   (if (<= t -1.42e-192)
     t_2
     (if (<= t 9.8e-129)
       t_1
       (if (<= t 2.5e-103)
         (* (* i (* a c)) -2.0)
         (if (<= t 2.6e+135) 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 * (x * y);
	double t_2 = 2.0 * (z * t);
	double tmp;
	if (t <= -1.42e-192) {
		tmp = t_2;
	} else if (t <= 9.8e-129) {
		tmp = t_1;
	} else if (t <= 2.5e-103) {
		tmp = (i * (a * c)) * -2.0;
	} else if (t <= 2.6e+135) {
		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 * (x * y)
    t_2 = 2.0d0 * (z * t)
    if (t <= (-1.42d-192)) then
        tmp = t_2
    else if (t <= 9.8d-129) then
        tmp = t_1
    else if (t <= 2.5d-103) then
        tmp = (i * (a * c)) * (-2.0d0)
    else if (t <= 2.6d+135) 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 * (x * y);
	double t_2 = 2.0 * (z * t);
	double tmp;
	if (t <= -1.42e-192) {
		tmp = t_2;
	} else if (t <= 9.8e-129) {
		tmp = t_1;
	} else if (t <= 2.5e-103) {
		tmp = (i * (a * c)) * -2.0;
	} else if (t <= 2.6e+135) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (x * y)
	t_2 = 2.0 * (z * t)
	tmp = 0
	if t <= -1.42e-192:
		tmp = t_2
	elif t <= 9.8e-129:
		tmp = t_1
	elif t <= 2.5e-103:
		tmp = (i * (a * c)) * -2.0
	elif t <= 2.6e+135:
		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(x * y))
	t_2 = Float64(2.0 * Float64(z * t))
	tmp = 0.0
	if (t <= -1.42e-192)
		tmp = t_2;
	elseif (t <= 9.8e-129)
		tmp = t_1;
	elseif (t <= 2.5e-103)
		tmp = Float64(Float64(i * Float64(a * c)) * -2.0);
	elseif (t <= 2.6e+135)
		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 * (x * y);
	t_2 = 2.0 * (z * t);
	tmp = 0.0;
	if (t <= -1.42e-192)
		tmp = t_2;
	elseif (t <= 9.8e-129)
		tmp = t_1;
	elseif (t <= 2.5e-103)
		tmp = (i * (a * c)) * -2.0;
	elseif (t <= 2.6e+135)
		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[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.42e-192], t$95$2, If[LessEqual[t, 9.8e-129], t$95$1, If[LessEqual[t, 2.5e-103], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t, 2.6e+135], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 9.8 \cdot 10^{-129}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-103}:\\
\;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\

\mathbf{elif}\;t \leq 2.6 \cdot 10^{+135}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.4200000000000001e-192 or 2.6e135 < t

    1. Initial program 90.0%

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

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

    if -1.4200000000000001e-192 < t < 9.80000000000000004e-129 or 2.49999999999999983e-103 < t < 2.6e135

    1. Initial program 97.3%

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

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

    if 9.80000000000000004e-129 < t < 2.49999999999999983e-103

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.42 \cdot 10^{-192}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 9.8 \cdot 10^{-129}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-103}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;t \leq 2.6 \cdot 10^{+135}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 12: 57.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+202}:\\ \;\;\;\;\left(a \cdot i\right) \cdot \left(c \cdot -2\right)\\ \mathbf{elif}\;c \leq 1.4 \cdot 10^{+168}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= c -1.7e+202)
   (* (* a i) (* c -2.0))
   (if (<= c 1.4e+168) (* (+ (* z t) (* x y)) 2.0) (* (* i (* a c)) -2.0))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (c <= -1.7e+202) {
		tmp = (a * i) * (c * -2.0);
	} else if (c <= 1.4e+168) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = (i * (a * c)) * -2.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (c <= (-1.7d+202)) then
        tmp = (a * i) * (c * (-2.0d0))
    else if (c <= 1.4d+168) then
        tmp = ((z * t) + (x * y)) * 2.0d0
    else
        tmp = (i * (a * c)) * (-2.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (c <= -1.7e+202) {
		tmp = (a * i) * (c * -2.0);
	} else if (c <= 1.4e+168) {
		tmp = ((z * t) + (x * y)) * 2.0;
	} else {
		tmp = (i * (a * c)) * -2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if c <= -1.7e+202:
		tmp = (a * i) * (c * -2.0)
	elif c <= 1.4e+168:
		tmp = ((z * t) + (x * y)) * 2.0
	else:
		tmp = (i * (a * c)) * -2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (c <= -1.7e+202)
		tmp = Float64(Float64(a * i) * Float64(c * -2.0));
	elseif (c <= 1.4e+168)
		tmp = Float64(Float64(Float64(z * t) + Float64(x * y)) * 2.0);
	else
		tmp = Float64(Float64(i * Float64(a * c)) * -2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (c <= -1.7e+202)
		tmp = (a * i) * (c * -2.0);
	elseif (c <= 1.4e+168)
		tmp = ((z * t) + (x * y)) * 2.0;
	else
		tmp = (i * (a * c)) * -2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, -1.7e+202], N[(N[(a * i), $MachinePrecision] * N[(c * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.4e+168], N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.7 \cdot 10^{+202}:\\
\;\;\;\;\left(a \cdot i\right) \cdot \left(c \cdot -2\right)\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e202 < c < 1.39999999999999995e168

    1. Initial program 96.1%

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

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

    if 1.39999999999999995e168 < c

    1. Initial program 82.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 inf 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-192} \lor \neg \left(t \leq 2.6 \cdot 10^{+135}\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 (<= t -1.6e-192) (not (<= t 2.6e+135)))
   (* 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 ((t <= -1.6e-192) || !(t <= 2.6e+135)) {
		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 ((t <= (-1.6d-192)) .or. (.not. (t <= 2.6d+135))) 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 ((t <= -1.6e-192) || !(t <= 2.6e+135)) {
		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 (t <= -1.6e-192) or not (t <= 2.6e+135):
		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 ((t <= -1.6e-192) || !(t <= 2.6e+135))
		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 ((t <= -1.6e-192) || ~((t <= 2.6e+135)))
		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[t, -1.6e-192], N[Not[LessEqual[t, 2.6e+135]], $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}\;t \leq -1.6 \cdot 10^{-192} \lor \neg \left(t \leq 2.6 \cdot 10^{+135}\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 t < -1.6000000000000001e-192 or 2.6e135 < t

    1. Initial program 90.0%

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

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

    if -1.6000000000000001e-192 < t < 2.6e135

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

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

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

Alternative 14: 29.7% 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.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 31.6%

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

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

Developer target: 94.4% 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 2023213 
(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))))