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

Percentage Accurate: 90.0% → 96.0%
Time: 12.2s
Alternatives: 15
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 15 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 96.0% accurate, 0.1× speedup?

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

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

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


\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 93.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*99.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-def99.5%

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999997e307

    1. Initial program 99.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.4%

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

Alternative 3: 73.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 2.4 \cdot 10^{-7}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.10000000000000015e59 or 2.39999999999999979e-7 < c

    1. Initial program 80.9%

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

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

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

    if -3.10000000000000015e59 < c < 1.25000000000000006e-102 or 1.5500000000000001e-90 < c < 2.39999999999999979e-7

    1. Initial program 96.9%

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

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

    if 1.25000000000000006e-102 < c < 1.5500000000000001e-90

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+59}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-90}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;c \leq 2.4 \cdot 10^{-7}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 4: 74.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq 6.8 \cdot 10^{-104}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 5.4 \cdot 10^{-16}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.60000000000000015e57 or 5.39999999999999999e-16 < c

    1. Initial program 80.9%

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

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

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

    if -1.60000000000000015e57 < c < 6.80000000000000031e-104 or 1.85000000000000009e-90 < c < 5.39999999999999999e-16

    1. Initial program 96.9%

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

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

    if 6.80000000000000031e-104 < c < 1.85000000000000009e-90

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.6 \cdot 10^{+57}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{-104}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-90}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{-16}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 5: 73.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq 1.35 \cdot 10^{-110}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 2.2 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.69999999999999996e57 or 2.19999999999999997e-13 < c

    1. Initial program 80.9%

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

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

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

    if -1.69999999999999996e57 < c < 1.3499999999999999e-110 or 3.0999999999999999e-62 < c < 2.19999999999999997e-13

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

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

    if 1.3499999999999999e-110 < c < 3.0999999999999999e-62

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

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

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

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

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

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

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

Alternative 6: 80.1% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.59999999999999999e63 or 6.7e11 < c

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

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

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

    if -3.59999999999999999e63 < c < 6.7e11

    1. Initial program 97.2%

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

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

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

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

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

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

Alternative 7: 83.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.49999999999999999e62 or 7.2e11 < c

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

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

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

    if -4.49999999999999999e62 < c < 7.2e11

    1. Initial program 97.2%

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

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

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

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

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

Alternative 8: 56.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.5 \cdot 10^{+104} \lor \neg \left(c \leq 1.25 \cdot 10^{-102}\right) \land \left(c \leq 1.55 \cdot 10^{-90} \lor \neg \left(c \leq 4.9 \cdot 10^{+163}\right)\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.4999999999999998e104 or 1.25000000000000006e-102 < c < 1.5500000000000001e-90 or 4.9e163 < c

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999998e104 < c < 1.25000000000000006e-102 or 1.5500000000000001e-90 < c < 4.9e163

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.5 \cdot 10^{+104} \lor \neg \left(c \leq 1.25 \cdot 10^{-102}\right) \land \left(c \leq 1.55 \cdot 10^{-90} \lor \neg \left(c \leq 4.9 \cdot 10^{+163}\right)\right):\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]

Alternative 9: 67.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 760000000000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -7.7000000000000003e62 or 7.6e11 < c

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(c \cdot \left(-2 \cdot b\right)\right)} \cdot \log \left({\left(e^{c}\right)}^{i}\right) \]
      9. associate-*l*61.0%

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

        \[\leadsto c \cdot \left(\color{blue}{\left(b \cdot -2\right)} \cdot \log \left({\left(e^{c}\right)}^{i}\right)\right) \]
      11. log-pow61.0%

        \[\leadsto c \cdot \left(\left(b \cdot -2\right) \cdot \color{blue}{\left(i \cdot \log \left(e^{c}\right)\right)}\right) \]
      12. rem-log-exp66.6%

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

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

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

    if -7.7000000000000003e62 < c < 1.25000000000000006e-102 or 1.5500000000000001e-90 < c < 7.6e11

    1. Initial program 97.1%

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

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

    if 1.25000000000000006e-102 < c < 1.5500000000000001e-90

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.7 \cdot 10^{+62}:\\ \;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-90}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;c \leq 760000000000:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\ \end{array} \]

Alternative 10: 67.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 760000000000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -5.19999999999999945e61 or 7.6e11 < c

    1. Initial program 79.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 b around inf 63.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999945e61 < c < 1.25000000000000006e-102 or 1.5500000000000001e-90 < c < 7.6e11

    1. Initial program 97.1%

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

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

    if 1.25000000000000006e-102 < c < 1.5500000000000001e-90

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.2 \cdot 10^{+61}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(\left(b \cdot c\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-90}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;c \leq 760000000000:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(\left(b \cdot c\right) \cdot -2\right)\\ \end{array} \]

Alternative 11: 67.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 760000000000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -4.7000000000000003e63

    1. Initial program 76.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 b around inf 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.7000000000000003e63 < c < 1.25000000000000006e-102 or 1.5500000000000001e-90 < c < 7.6e11

    1. Initial program 97.1%

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

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

    if 1.25000000000000006e-102 < c < 1.5500000000000001e-90

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

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

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

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

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

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

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

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

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

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

    if 7.6e11 < c

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.7 \cdot 10^{+63}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(\left(b \cdot c\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq 1.25 \cdot 10^{-102}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-90}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;c \leq 760000000000:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(c \cdot i\right)\right) \cdot \left(b \cdot -2\right)\\ \end{array} \]

Alternative 12: 38.3% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -9.2:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.05 \cdot 10^{+40}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.1999999999999993 or 1.05000000000000005e40 < t

    1. Initial program 88.8%

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

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

    if -9.1999999999999993 < t < 1.4499999999999999e-306

    1. Initial program 89.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 50.7%

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

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

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

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

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

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

    if 1.4499999999999999e-306 < t < 1.05000000000000005e40

    1. Initial program 91.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.2:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{-306}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+40}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 13: 39.2% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;t \leq -9.2:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+46}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9.1999999999999993 or 1.3500000000000001e46 < t

    1. Initial program 88.8%

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

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

    if -9.1999999999999993 < t < 1.42000000000000005e-306

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

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

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

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

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

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

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

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

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

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

    if 1.42000000000000005e-306 < t < 1.3500000000000001e46

    1. Initial program 91.7%

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

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

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

Alternative 14: 40.0% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+117} \lor \neg \left(z \leq 3.3 \cdot 10^{-78}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.09999999999999975e117 or 3.29999999999999982e-78 < z

    1. Initial program 89.0%

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

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

    if -3.09999999999999975e117 < z < 3.29999999999999982e-78

    1. Initial program 90.5%

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

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

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

Alternative 15: 29.0% 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 89.8%

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

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

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

Developer target: 94.0% accurate, 1.0× speedup?

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

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

Reproduce

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