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

Percentage Accurate: 90.1% → 94.5%
Time: 16.0s
Alternatives: 14
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 90.1% accurate, 1.0× speedup?

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

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

Alternative 1: 94.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 91.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate--l+91.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Step-by-step derivation
      1. fma-def99.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.2% accurate, 0.2× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
  3. Simplified96.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)} \]
  4. Final simplification96.5%

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

Alternative 3: 93.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.99999999999999991e283 or 4.0000000000000002e300 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 69.6%

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

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

    if -1.99999999999999991e283 < (*.f64 (+.f64 a (*.f64 b c)) c) < 4.0000000000000002e300

    1. Initial program 97.0%

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

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

Alternative 4: 77.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5000000000000 \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+46}\right) \land x \cdot y \leq 10^{+149}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.99999999999999988e237

    1. Initial program 88.5%

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

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

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

    if -1.99999999999999988e237 < (*.f64 x y) < 5e12 or 5.0000000000000002e46 < (*.f64 x y) < 1.00000000000000005e149

    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 x around 0 84.8%

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

    if 5e12 < (*.f64 x y) < 5.0000000000000002e46 or 1.00000000000000005e149 < (*.f64 x y)

    1. Initial program 84.1%

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

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

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

Alternative 5: 79.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5000000000000 \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+46}\right) \land x \cdot y \leq 10^{+149}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.0000000000000002e-14

    1. Initial program 87.8%

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

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

    if -5.0000000000000002e-14 < (*.f64 x y) < 5e12 or 5.0000000000000002e46 < (*.f64 x y) < 1.00000000000000005e149

    1. Initial program 89.5%

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

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

    if 5e12 < (*.f64 x y) < 5.0000000000000002e46 or 1.00000000000000005e149 < (*.f64 x y)

    1. Initial program 84.1%

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

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

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

Alternative 6: 73.0% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;c \leq -1.32 \cdot 10^{+88}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1.9 \cdot 10^{-154}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 8.4 \cdot 10^{+19}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -5.9999999999999998e151 or -1.54999999999999998e119 < c < -1.3200000000000001e88 or 8.4e19 < c

    1. Initial program 80.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 81.4%

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

    if -5.9999999999999998e151 < c < -1.54999999999999998e119

    1. Initial program 59.5%

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

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

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

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

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

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

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

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

    if -1.3200000000000001e88 < c < 1.90000000000000005e-154 or 1.6200000000000001e-116 < c < 8.4e19

    1. Initial program 96.2%

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

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

    if 1.90000000000000005e-154 < c < 1.6200000000000001e-116

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6 \cdot 10^{+151}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.55 \cdot 10^{+119}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -1.32 \cdot 10^{+88}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{-154}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.62 \cdot 10^{-116}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 8.4 \cdot 10^{+19}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 7: 72.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq 1.9 \cdot 10^{-154}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 10^{+27}:\\
\;\;\;\;t_1\\

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


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

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

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

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

    if -0.69999999999999996 < c < 1.90000000000000005e-154 or 1.65e-116 < c < 1e27

    1. Initial program 97.4%

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

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

    if 1.90000000000000005e-154 < c < 1.65e-116

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

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

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

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

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

    if 1e27 < c

    1. Initial program 83.6%

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

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

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

Alternative 8: 62.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.00000000000000002e78 or 5e12 < (*.f64 x y)

    1. Initial program 86.2%

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

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

    if -2.00000000000000002e78 < (*.f64 x y) < 5e12

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

Alternative 9: 87.4% accurate, 1.0× speedup?

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

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

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

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


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

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

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

    if -2700 < c < 2.5e9

    1. Initial program 96.8%

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

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

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

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

    if 2.5e9 < c

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

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

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

Alternative 10: 38.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-109}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-32}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8e15 or 1.24999999999999994e157 < y

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

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

    if -8e15 < y < 1.90000000000000001e-109 or 2.2e-73 < y < 9.4999999999999999e-32

    1. Initial program 91.6%

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

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

    if 1.90000000000000001e-109 < y < 2.2e-73

    1. Initial program 100.0%

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

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

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

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

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

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

    if 9.4999999999999999e-32 < y < 1.24999999999999994e157

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+15}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-109}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-73}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(-a\right)\right)\right)\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-32}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+157}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 11: 36.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;t \leq 10^{-302}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.8 \cdot 10^{+56}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -9e-130 or 1.79999999999999999e56 < t

    1. Initial program 87.8%

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

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

    if -9e-130 < t < 9.9999999999999996e-303 or 2.14999999999999981e-9 < t < 1.79999999999999999e56

    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 x around inf 47.8%

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

    if 9.9999999999999996e-303 < t < 2.14999999999999981e-9

    1. Initial program 93.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9 \cdot 10^{-130}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 10^{-302}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{-9}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 12: 56.3% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -6.60000000000000003e247 or 3.35e202 < i

    1. Initial program 97.0%

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

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

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

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

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

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

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

    if -6.60000000000000003e247 < i < 3.35e202

    1. Initial program 86.6%

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

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

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

Alternative 13: 38.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-130} \lor \neg \left(t \leq 1.95 \cdot 10^{+56}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9e-130 or 1.94999999999999997e56 < t

    1. Initial program 87.8%

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

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

    if -9e-130 < t < 1.94999999999999997e56

    1. Initial program 88.3%

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

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

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

Alternative 14: 28.7% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 88.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 34.4%

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

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

Developer target: 93.8% 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 2023322 
(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))))