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

Percentage Accurate: 90.3% → 96.2%
Time: 14.3s
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.3% 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.2% 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 {c}^{2}\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 (+ 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 (pow c 2.0)) (* b -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 * pow(c, 2.0)) * (b * -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 * (c ^ 2.0)) * Float64(b * -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[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\left(i \cdot {c}^{2}\right) \cdot \left(b \cdot -2\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 94.7%

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

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

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

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

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*12.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. Simplified12.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. Taylor expanded in b around inf 62.8%

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

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

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

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

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

    \[\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 {c}^{2}\right) \cdot \left(b \cdot -2\right)\\ \end{array} \]

Alternative 2: 96.2% accurate, 0.2× 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 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot {c}^{2}\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 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* (* i (pow c 2.0)) (* b -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 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = (i * pow(c, 2.0)) * (b * -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 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = (i * Math.pow(c, 2.0)) * (b * -2.0);
	}
	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 - ((c * t_1) * i)) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = (i * math.pow(c, 2.0)) * (b * -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(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(Float64(i * (c ^ 2.0)) * Float64(b * -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 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_2 - ((c * t_1) * i)) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = (i * (c ^ 2.0)) * (b * -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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] * N[(b * -2.0), $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 - \left(c \cdot t_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(i \cdot {c}^{2}\right) \cdot \left(b \cdot -2\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 94.7%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*12.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. Simplified12.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. Taylor expanded in b around inf 62.8%

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

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

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

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

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

    \[\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(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(i \cdot {c}^{2}\right) \cdot \left(b \cdot -2\right)\\ \end{array} \]

Alternative 3: 95.2% 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 4 \cdot 10^{+290}\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 4e+290)))
     (* -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 <= 4e+290)) {
		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 <= 4e+290)) {
		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 <= 4e+290):
		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 <= 4e+290))
		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 <= 4e+290)))
		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, 4e+290]], $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 4 \cdot 10^{+290}\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 4.00000000000000025e290 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 75.5%

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

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

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

      \[\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. Taylor expanded in i around inf 93.5%

      \[\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) < 4.00000000000000025e290

    1. Initial program 98.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.3%

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \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 94.7%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*12.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. Simplified12.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. Taylor expanded in i around inf 62.7%

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

    \[\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(\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(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 5: 48.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y\right) \cdot 2\\ t_2 := -2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ t_3 := 2 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;c \leq -3.8 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -7.8 \cdot 10^{-196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -5.1 \cdot 10^{-255}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{-255}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{-203}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{-44}:\\ \;\;\;\;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) 2.0))
        (t_2 (* -2.0 (* c (* b (* c i)))))
        (t_3 (* 2.0 (* z t))))
   (if (<= c -3.8e-23)
     t_2
     (if (<= c -7.8e-196)
       t_1
       (if (<= c -5.1e-255)
         t_3
         (if (<= c 3.2e-255)
           t_1
           (if (<= c 7.8e-203) t_3 (if (<= c 2.05e-44) 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) * 2.0;
	double t_2 = -2.0 * (c * (b * (c * i)));
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (c <= -3.8e-23) {
		tmp = t_2;
	} else if (c <= -7.8e-196) {
		tmp = t_1;
	} else if (c <= -5.1e-255) {
		tmp = t_3;
	} else if (c <= 3.2e-255) {
		tmp = t_1;
	} else if (c <= 7.8e-203) {
		tmp = t_3;
	} else if (c <= 2.05e-44) {
		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) :: t_3
    real(8) :: tmp
    t_1 = (x * y) * 2.0d0
    t_2 = (-2.0d0) * (c * (b * (c * i)))
    t_3 = 2.0d0 * (z * t)
    if (c <= (-3.8d-23)) then
        tmp = t_2
    else if (c <= (-7.8d-196)) then
        tmp = t_1
    else if (c <= (-5.1d-255)) then
        tmp = t_3
    else if (c <= 3.2d-255) then
        tmp = t_1
    else if (c <= 7.8d-203) then
        tmp = t_3
    else if (c <= 2.05d-44) 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) * 2.0;
	double t_2 = -2.0 * (c * (b * (c * i)));
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (c <= -3.8e-23) {
		tmp = t_2;
	} else if (c <= -7.8e-196) {
		tmp = t_1;
	} else if (c <= -5.1e-255) {
		tmp = t_3;
	} else if (c <= 3.2e-255) {
		tmp = t_1;
	} else if (c <= 7.8e-203) {
		tmp = t_3;
	} else if (c <= 2.05e-44) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) * 2.0
	t_2 = -2.0 * (c * (b * (c * i)))
	t_3 = 2.0 * (z * t)
	tmp = 0
	if c <= -3.8e-23:
		tmp = t_2
	elif c <= -7.8e-196:
		tmp = t_1
	elif c <= -5.1e-255:
		tmp = t_3
	elif c <= 3.2e-255:
		tmp = t_1
	elif c <= 7.8e-203:
		tmp = t_3
	elif c <= 2.05e-44:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) * 2.0)
	t_2 = Float64(-2.0 * Float64(c * Float64(b * Float64(c * i))))
	t_3 = Float64(2.0 * Float64(z * t))
	tmp = 0.0
	if (c <= -3.8e-23)
		tmp = t_2;
	elseif (c <= -7.8e-196)
		tmp = t_1;
	elseif (c <= -5.1e-255)
		tmp = t_3;
	elseif (c <= 3.2e-255)
		tmp = t_1;
	elseif (c <= 7.8e-203)
		tmp = t_3;
	elseif (c <= 2.05e-44)
		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) * 2.0;
	t_2 = -2.0 * (c * (b * (c * i)));
	t_3 = 2.0 * (z * t);
	tmp = 0.0;
	if (c <= -3.8e-23)
		tmp = t_2;
	elseif (c <= -7.8e-196)
		tmp = t_1;
	elseif (c <= -5.1e-255)
		tmp = t_3;
	elseif (c <= 3.2e-255)
		tmp = t_1;
	elseif (c <= 7.8e-203)
		tmp = t_3;
	elseif (c <= 2.05e-44)
		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[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.8e-23], t$95$2, If[LessEqual[c, -7.8e-196], t$95$1, If[LessEqual[c, -5.1e-255], t$95$3, If[LessEqual[c, 3.2e-255], t$95$1, If[LessEqual[c, 7.8e-203], t$95$3, If[LessEqual[c, 2.05e-44], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -7.8 \cdot 10^{-196}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -5.1 \cdot 10^{-255}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 3.2 \cdot 10^{-255}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 7.8 \cdot 10^{-203}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2.05 \cdot 10^{-44}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.80000000000000011e-23 or 2.04999999999999996e-44 < c

    1. Initial program 82.7%

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

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

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

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

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

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

    if -3.80000000000000011e-23 < c < -7.80000000000000031e-196 or -5.1000000000000005e-255 < c < 3.19999999999999993e-255 or 7.7999999999999998e-203 < c < 2.04999999999999996e-44

    1. Initial program 97.4%

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

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

    if -7.80000000000000031e-196 < c < -5.1000000000000005e-255 or 3.19999999999999993e-255 < c < 7.7999999999999998e-203

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{-23}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.8 \cdot 10^{-196}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq -5.1 \cdot 10^{-255}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{-255}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{-203}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{-44}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 6: 48.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq -5.8 \cdot 10^{-196}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -2.45 \cdot 10^{-257}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{-255}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 2.65 \cdot 10^{-204}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 8 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 81.2%

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

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

      \[\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. Taylor expanded in i around inf 79.0%

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

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

    if -6.6999999999999998e-18 < c < -5.79999999999999974e-196 or -2.45000000000000006e-257 < c < 2.80000000000000011e-255 or 2.6499999999999999e-204 < c < 7.99999999999999987e-45

    1. Initial program 97.4%

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

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

    if -5.79999999999999974e-196 < c < -2.45000000000000006e-257 or 2.80000000000000011e-255 < c < 2.6499999999999999e-204

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

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

    if 7.99999999999999987e-45 < 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. Step-by-step derivation
      1. fma-def83.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.7 \cdot 10^{-18}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-196}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq -2.45 \cdot 10^{-257}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{-255}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.65 \cdot 10^{-204}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-45}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 7: 37.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ t_2 := 2 \cdot \left(z \cdot t\right)\\ t_3 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;z \leq -4 \cdot 10^{+81}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -69000000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-144}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-306}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-196}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-76}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* a (* c i))))
        (t_2 (* 2.0 (* z t)))
        (t_3 (* (* x y) 2.0)))
   (if (<= z -4e+81)
     t_2
     (if (<= z -69000000000000.0)
       t_1
       (if (<= z -7.5e-144)
         t_3
         (if (<= z 1.75e-306)
           t_1
           (if (<= z 9.5e-261)
             t_3
             (if (<= z 4e-196)
               (* 2.0 (* i (* a (- c))))
               (if (<= z 1.9e-76) t_3 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 * (a * (c * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if (z <= -4e+81) {
		tmp = t_2;
	} else if (z <= -69000000000000.0) {
		tmp = t_1;
	} else if (z <= -7.5e-144) {
		tmp = t_3;
	} else if (z <= 1.75e-306) {
		tmp = t_1;
	} else if (z <= 9.5e-261) {
		tmp = t_3;
	} else if (z <= 4e-196) {
		tmp = 2.0 * (i * (a * -c));
	} else if (z <= 1.9e-76) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = (-2.0d0) * (a * (c * i))
    t_2 = 2.0d0 * (z * t)
    t_3 = (x * y) * 2.0d0
    if (z <= (-4d+81)) then
        tmp = t_2
    else if (z <= (-69000000000000.0d0)) then
        tmp = t_1
    else if (z <= (-7.5d-144)) then
        tmp = t_3
    else if (z <= 1.75d-306) then
        tmp = t_1
    else if (z <= 9.5d-261) then
        tmp = t_3
    else if (z <= 4d-196) then
        tmp = 2.0d0 * (i * (a * -c))
    else if (z <= 1.9d-76) then
        tmp = t_3
    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 * (a * (c * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if (z <= -4e+81) {
		tmp = t_2;
	} else if (z <= -69000000000000.0) {
		tmp = t_1;
	} else if (z <= -7.5e-144) {
		tmp = t_3;
	} else if (z <= 1.75e-306) {
		tmp = t_1;
	} else if (z <= 9.5e-261) {
		tmp = t_3;
	} else if (z <= 4e-196) {
		tmp = 2.0 * (i * (a * -c));
	} else if (z <= 1.9e-76) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = -2.0 * (a * (c * i))
	t_2 = 2.0 * (z * t)
	t_3 = (x * y) * 2.0
	tmp = 0
	if z <= -4e+81:
		tmp = t_2
	elif z <= -69000000000000.0:
		tmp = t_1
	elif z <= -7.5e-144:
		tmp = t_3
	elif z <= 1.75e-306:
		tmp = t_1
	elif z <= 9.5e-261:
		tmp = t_3
	elif z <= 4e-196:
		tmp = 2.0 * (i * (a * -c))
	elif z <= 1.9e-76:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(a * Float64(c * i)))
	t_2 = Float64(2.0 * Float64(z * t))
	t_3 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (z <= -4e+81)
		tmp = t_2;
	elseif (z <= -69000000000000.0)
		tmp = t_1;
	elseif (z <= -7.5e-144)
		tmp = t_3;
	elseif (z <= 1.75e-306)
		tmp = t_1;
	elseif (z <= 9.5e-261)
		tmp = t_3;
	elseif (z <= 4e-196)
		tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c))));
	elseif (z <= 1.9e-76)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = -2.0 * (a * (c * i));
	t_2 = 2.0 * (z * t);
	t_3 = (x * y) * 2.0;
	tmp = 0.0;
	if (z <= -4e+81)
		tmp = t_2;
	elseif (z <= -69000000000000.0)
		tmp = t_1;
	elseif (z <= -7.5e-144)
		tmp = t_3;
	elseif (z <= 1.75e-306)
		tmp = t_1;
	elseif (z <= 9.5e-261)
		tmp = t_3;
	elseif (z <= 4e-196)
		tmp = 2.0 * (i * (a * -c));
	elseif (z <= 1.9e-76)
		tmp = t_3;
	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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -4e+81], t$95$2, If[LessEqual[z, -69000000000000.0], t$95$1, If[LessEqual[z, -7.5e-144], t$95$3, If[LessEqual[z, 1.75e-306], t$95$1, If[LessEqual[z, 9.5e-261], t$95$3, If[LessEqual[z, 4e-196], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-76], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -69000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-144}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{-306}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-76}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.99999999999999969e81 or 1.9000000000000001e-76 < z

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

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

    if -3.99999999999999969e81 < z < -6.9e13 or -7.49999999999999963e-144 < z < 1.75000000000000009e-306

    1. Initial program 87.3%

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

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

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

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

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

    if -6.9e13 < z < -7.49999999999999963e-144 or 1.75000000000000009e-306 < z < 9.5000000000000008e-261 or 4.0000000000000002e-196 < z < 1.9000000000000001e-76

    1. Initial program 86.8%

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

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

    if 9.5000000000000008e-261 < z < 4.0000000000000002e-196

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

        \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
      2. associate-*l*86.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. Simplified86.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. Step-by-step derivation
      1. fma-def86.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+81}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -69000000000000:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-144}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-306}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-261}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-196}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-76}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 8: 37.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ t_2 := 2 \cdot \left(z \cdot t\right)\\ t_3 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;z \leq -5.5 \cdot 10^{+82}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-141}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 10^{-302}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{-261}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-197}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-77}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* a (* c i))))
        (t_2 (* 2.0 (* z t)))
        (t_3 (* (* x y) 2.0)))
   (if (<= z -5.5e+82)
     t_2
     (if (<= z -1.16e+15)
       t_1
       (if (<= z -3e-141)
         t_3
         (if (<= z 1e-302)
           t_1
           (if (<= z 7.3e-261)
             t_3
             (if (<= z 4.4e-197) t_1 (if (<= z 9e-77) t_3 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 * (a * (c * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if (z <= -5.5e+82) {
		tmp = t_2;
	} else if (z <= -1.16e+15) {
		tmp = t_1;
	} else if (z <= -3e-141) {
		tmp = t_3;
	} else if (z <= 1e-302) {
		tmp = t_1;
	} else if (z <= 7.3e-261) {
		tmp = t_3;
	} else if (z <= 4.4e-197) {
		tmp = t_1;
	} else if (z <= 9e-77) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = (-2.0d0) * (a * (c * i))
    t_2 = 2.0d0 * (z * t)
    t_3 = (x * y) * 2.0d0
    if (z <= (-5.5d+82)) then
        tmp = t_2
    else if (z <= (-1.16d+15)) then
        tmp = t_1
    else if (z <= (-3d-141)) then
        tmp = t_3
    else if (z <= 1d-302) then
        tmp = t_1
    else if (z <= 7.3d-261) then
        tmp = t_3
    else if (z <= 4.4d-197) then
        tmp = t_1
    else if (z <= 9d-77) then
        tmp = t_3
    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 * (a * (c * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if (z <= -5.5e+82) {
		tmp = t_2;
	} else if (z <= -1.16e+15) {
		tmp = t_1;
	} else if (z <= -3e-141) {
		tmp = t_3;
	} else if (z <= 1e-302) {
		tmp = t_1;
	} else if (z <= 7.3e-261) {
		tmp = t_3;
	} else if (z <= 4.4e-197) {
		tmp = t_1;
	} else if (z <= 9e-77) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = -2.0 * (a * (c * i))
	t_2 = 2.0 * (z * t)
	t_3 = (x * y) * 2.0
	tmp = 0
	if z <= -5.5e+82:
		tmp = t_2
	elif z <= -1.16e+15:
		tmp = t_1
	elif z <= -3e-141:
		tmp = t_3
	elif z <= 1e-302:
		tmp = t_1
	elif z <= 7.3e-261:
		tmp = t_3
	elif z <= 4.4e-197:
		tmp = t_1
	elif z <= 9e-77:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(a * Float64(c * i)))
	t_2 = Float64(2.0 * Float64(z * t))
	t_3 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (z <= -5.5e+82)
		tmp = t_2;
	elseif (z <= -1.16e+15)
		tmp = t_1;
	elseif (z <= -3e-141)
		tmp = t_3;
	elseif (z <= 1e-302)
		tmp = t_1;
	elseif (z <= 7.3e-261)
		tmp = t_3;
	elseif (z <= 4.4e-197)
		tmp = t_1;
	elseif (z <= 9e-77)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = -2.0 * (a * (c * i));
	t_2 = 2.0 * (z * t);
	t_3 = (x * y) * 2.0;
	tmp = 0.0;
	if (z <= -5.5e+82)
		tmp = t_2;
	elseif (z <= -1.16e+15)
		tmp = t_1;
	elseif (z <= -3e-141)
		tmp = t_3;
	elseif (z <= 1e-302)
		tmp = t_1;
	elseif (z <= 7.3e-261)
		tmp = t_3;
	elseif (z <= 4.4e-197)
		tmp = t_1;
	elseif (z <= 9e-77)
		tmp = t_3;
	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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[z, -5.5e+82], t$95$2, If[LessEqual[z, -1.16e+15], t$95$1, If[LessEqual[z, -3e-141], t$95$3, If[LessEqual[z, 1e-302], t$95$1, If[LessEqual[z, 7.3e-261], t$95$3, If[LessEqual[z, 4.4e-197], t$95$1, If[LessEqual[z, 9e-77], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.16 \cdot 10^{+15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3 \cdot 10^{-141}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;z \leq 7.3 \cdot 10^{-261}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-197}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-77}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.49999999999999997e82 or 9.0000000000000001e-77 < z

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

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

    if -5.49999999999999997e82 < z < -1.16e15 or -2.99999999999999983e-141 < z < 9.9999999999999996e-303 or 7.29999999999999974e-261 < z < 4.4000000000000001e-197

    1. Initial program 87.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. Step-by-step derivation
      1. fma-def87.4%

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

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

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

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

    if -1.16e15 < z < -2.99999999999999983e-141 or 9.9999999999999996e-303 < z < 7.29999999999999974e-261 or 4.4000000000000001e-197 < z < 9.0000000000000001e-77

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+82}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -1.16 \cdot 10^{+15}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-141}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;z \leq 10^{-302}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;z \leq 7.3 \cdot 10^{-261}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-197}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-77}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 9: 80.8% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.6000000000000003e-24 or 3.49999999999999993e-53 < 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 x around 0 88.9%

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

    if -5.6000000000000003e-24 < c < 3.49999999999999993e-53

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

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

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

Alternative 10: 87.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.6499999999999999e-11 or 9.1999999999999999e-37 < c

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

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

    if -2.6499999999999999e-11 < c < 9.1999999999999999e-37

    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 a around inf 92.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. *-commutative92.3%

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

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

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

Alternative 11: 74.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -6.8 \cdot 10^{-19} \lor \neg \left(c \leq 2.6 \cdot 10^{-45}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -6.8000000000000004e-19 or 2.59999999999999987e-45 < 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. Step-by-step derivation
      1. fma-def82.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) \]
      2. associate-*l*90.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. Simplified90.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. Taylor expanded in i around inf 79.9%

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

    if -6.8000000000000004e-19 < c < 2.59999999999999987e-45

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

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

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

Alternative 12: 67.2% accurate, 1.4× speedup?

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

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

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

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


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

    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. Step-by-step derivation
      1. fma-def74.9%

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

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

      \[\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. Taylor expanded in i around inf 87.5%

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

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

    if -5.49999999999999974e40 < c < 2.0000000000000001e-33

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

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

    if 2.0000000000000001e-33 < c

    1. Initial program 83.5%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 39.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+16} \lor \neg \left(z \leq 3.7 \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 -5.6e+16) (not (<= z 3.7e-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 <= -5.6e+16) || !(z <= 3.7e-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 <= (-5.6d+16)) .or. (.not. (z <= 3.7d-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 <= -5.6e+16) || !(z <= 3.7e-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 <= -5.6e+16) or not (z <= 3.7e-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 <= -5.6e+16) || !(z <= 3.7e-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 <= -5.6e+16) || ~((z <= 3.7e-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, -5.6e+16], N[Not[LessEqual[z, 3.7e-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 -5.6 \cdot 10^{+16} \lor \neg \left(z \leq 3.7 \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 < -5.6e16 or 3.70000000000000006e-78 < z

    1. Initial program 90.4%

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

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

    if -5.6e16 < z < 3.70000000000000006e-78

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

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

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

Alternative 14: 29.5% 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.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 24.4%

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

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

Developer target: 94.3% 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 2023311 
(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))))