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

Percentage Accurate: 90.3% → 96.1%
Time: 16.0s
Alternatives: 10
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 10 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.1% 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(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 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 = 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 * (b * (c * -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 * (b * (c * -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 * (b * (c * -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(b * Float64(c * Float64(-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 * (b * (c * -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[(b * N[(c * (-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 - \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(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\


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

    1. Initial program 94.5%

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 2: 93.0% 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 -\infty \lor \neg \left(t_2 \leq 2 \cdot 10^{+203}\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 \cdot i\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)))
   (if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+203)))
     (* -2.0 (* c (* t_1 i)))
     (* (- (+ (* x y) (* z t)) (* t_2 i)) 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;
	double tmp;
	if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+203)) {
		tmp = -2.0 * (c * (t_1 * i));
	} else {
		tmp = (((x * y) + (z * t)) - (t_2 * i)) * 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;
	double tmp;
	if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 2e+203)) {
		tmp = -2.0 * (c * (t_1 * i));
	} else {
		tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
	}
	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 <= -math.inf) or not (t_2 <= 2e+203):
		tmp = -2.0 * (c * (t_1 * i))
	else:
		tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0
	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 <= Float64(-Inf)) || !(t_2 <= 2e+203))
		tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i)));
	else
		tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(t_2 * i)) * 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;
	tmp = 0.0;
	if ((t_2 <= -Inf) || ~((t_2 <= 2e+203)))
		tmp = -2.0 * (c * (t_1 * i));
	else
		tmp = (((x * y) + (z * t)) - (t_2 * i)) * 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[(c * t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 2e+203]], $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] - N[(t$95$2 * i), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := c \cdot t_1\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 2 \cdot 10^{+203}\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 \cdot i\right) \cdot 2\\


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

    1. Initial program 74.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 94.0%

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2e203

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

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

Alternative 3: 63.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;c \leq -1.75 \cdot 10^{-105}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -2.3 \cdot 10^{-129}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq -2.6 \cdot 10^{-273}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 6.5 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;c \leq 2 \cdot 10^{+97}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.15e27 or -1.75e-105 < c < -2.3e-129 or -2.59999999999999983e-273 < c < 6.4999999999999998e-242 or 5.19999999999999998e-7 < c < 2.0000000000000001e97

    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 z around 0 83.3%

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

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

    if -1.15e27 < c < -1.75e-105 or -2.3e-129 < c < -2.59999999999999983e-273 or 6.4999999999999998e-242 < c < 5.19999999999999998e-7

    1. Initial program 97.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-def97.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*97.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. Simplified97.8%

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

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

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

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

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

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

    if 2.0000000000000001e97 < c

    1. Initial program 75.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.15 \cdot 10^{+27}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.75 \cdot 10^{-105}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -2.3 \cdot 10^{-129}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.6 \cdot 10^{-273}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 6.5 \cdot 10^{-242}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{-7}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2 \cdot 10^{+97}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 4: 62.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;c \leq -1.75 \cdot 10^{-105}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -1.1 \cdot 10^{-132}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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

\mathbf{elif}\;c \leq 1.8 \cdot 10^{-237}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;c \leq 2.5 \cdot 10^{+95}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.90000000000000011e27 or -2.99999999999999977e-274 < c < 1.79999999999999998e-237 or 7.40000000000000009e-7 < c < 2.50000000000000012e95

    1. Initial program 85.5%

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

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

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

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

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

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

    if -1.90000000000000011e27 < c < -1.75e-105 or -1.09999999999999995e-132 < c < -2.99999999999999977e-274 or 1.79999999999999998e-237 < c < 7.40000000000000009e-7

    1. Initial program 97.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-def97.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*97.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. Simplified97.8%

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

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

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

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

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

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

    if -1.75e-105 < c < -1.09999999999999995e-132

    1. Initial program 99.7%

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

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

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

    if 2.50000000000000012e95 < c

    1. Initial program 75.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.9 \cdot 10^{+27}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.75 \cdot 10^{-105}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{-132}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-274}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{-237}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 7.4 \cdot 10^{-7}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+95}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 5: 71.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{-284} \lor \neg \left(x \cdot y \leq 1.35 \cdot 10^{-39}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -6.99999999999999951e-284 or 1.35e-39 < (*.f64 x y)

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

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

    if -6.99999999999999951e-284 < (*.f64 x y) < 1.35e-39

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

        \[\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*94.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. Simplified94.4%

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

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

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

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

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

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

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

Alternative 6: 57.0% 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)\\ t_3 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -1.16 \cdot 10^{+24}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq -4.6 \cdot 10^{-271}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 7.2 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-144}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 7 \cdot 10^{-58}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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)))
        (t_3 (* -2.0 (* c (* (+ a (* b c)) i)))))
   (if (<= c -1.16e+24)
     t_3
     (if (<= c -4.6e-271)
       t_2
       (if (<= c 7.2e-180)
         t_1
         (if (<= c 1.22e-144) t_2 (if (<= c 7e-58) t_1 t_3)))))))
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 t_3 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -1.16e+24) {
		tmp = t_3;
	} else if (c <= -4.6e-271) {
		tmp = t_2;
	} else if (c <= 7.2e-180) {
		tmp = t_1;
	} else if (c <= 1.22e-144) {
		tmp = t_2;
	} else if (c <= 7e-58) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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 * (z * t)
    t_3 = (-2.0d0) * (c * ((a + (b * c)) * i))
    if (c <= (-1.16d+24)) then
        tmp = t_3
    else if (c <= (-4.6d-271)) then
        tmp = t_2
    else if (c <= 7.2d-180) then
        tmp = t_1
    else if (c <= 1.22d-144) then
        tmp = t_2
    else if (c <= 7d-58) then
        tmp = t_1
    else
        tmp = t_3
    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 t_3 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -1.16e+24) {
		tmp = t_3;
	} else if (c <= -4.6e-271) {
		tmp = t_2;
	} else if (c <= 7.2e-180) {
		tmp = t_1;
	} else if (c <= 1.22e-144) {
		tmp = t_2;
	} else if (c <= 7e-58) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) * 2.0
	t_2 = 2.0 * (z * t)
	t_3 = -2.0 * (c * ((a + (b * c)) * i))
	tmp = 0
	if c <= -1.16e+24:
		tmp = t_3
	elif c <= -4.6e-271:
		tmp = t_2
	elif c <= 7.2e-180:
		tmp = t_1
	elif c <= 1.22e-144:
		tmp = t_2
	elif c <= 7e-58:
		tmp = t_1
	else:
		tmp = t_3
	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))
	t_3 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i)))
	tmp = 0.0
	if (c <= -1.16e+24)
		tmp = t_3;
	elseif (c <= -4.6e-271)
		tmp = t_2;
	elseif (c <= 7.2e-180)
		tmp = t_1;
	elseif (c <= 1.22e-144)
		tmp = t_2;
	elseif (c <= 7e-58)
		tmp = t_1;
	else
		tmp = t_3;
	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);
	t_3 = -2.0 * (c * ((a + (b * c)) * i));
	tmp = 0.0;
	if (c <= -1.16e+24)
		tmp = t_3;
	elseif (c <= -4.6e-271)
		tmp = t_2;
	elseif (c <= 7.2e-180)
		tmp = t_1;
	elseif (c <= 1.22e-144)
		tmp = t_2;
	elseif (c <= 7e-58)
		tmp = t_1;
	else
		tmp = t_3;
	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]}, Block[{t$95$3 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.16e+24], t$95$3, If[LessEqual[c, -4.6e-271], t$95$2, If[LessEqual[c, 7.2e-180], t$95$1, If[LessEqual[c, 1.22e-144], t$95$2, If[LessEqual[c, 7e-58], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -4.6 \cdot 10^{-271}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 7.2 \cdot 10^{-180}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 1.22 \cdot 10^{-144}:\\
\;\;\;\;t_2\\

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

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.16000000000000005e24 or 6.9999999999999998e-58 < c

    1. Initial program 82.0%

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

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

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

    if -1.16000000000000005e24 < c < -4.60000000000000017e-271 or 7.1999999999999998e-180 < c < 1.22e-144

    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 z around inf 51.4%

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

    if -4.60000000000000017e-271 < c < 7.1999999999999998e-180 or 1.22e-144 < c < 6.9999999999999998e-58

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.16 \cdot 10^{+24}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -4.6 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 7.2 \cdot 10^{-180}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-144}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 7 \cdot 10^{-58}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 7: 63.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq -6 \cdot 10^{-271}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 76.5%

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

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

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

    if -1.62e102 < c < -6.00000000000000004e-271 or 2.90000000000000011e-237 < c < 2e11

    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) \]
    2. Step-by-step derivation
      1. fma-def98.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*98.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. Simplified98.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-def98.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. +-commutative98.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-rr98.2%

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

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

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

    if -6.00000000000000004e-271 < c < 2.90000000000000011e-237

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.62 \cdot 10^{+102}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6 \cdot 10^{-271}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-237}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 200000000000:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \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 8: 87.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -7.8 \cdot 10^{+59} \lor \neg \left(c \leq 7.2 \cdot 10^{-7}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 -7.8e+59) (not (<= c 7.2e-7)))
   (* 2.0 (- (* x y) (* 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 <= -7.8e+59) || !(c <= 7.2e-7)) {
		tmp = 2.0 * ((x * y) - (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 <= (-7.8d+59)) .or. (.not. (c <= 7.2d-7))) then
        tmp = 2.0d0 * ((x * y) - (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 <= -7.8e+59) || !(c <= 7.2e-7)) {
		tmp = 2.0 * ((x * y) - (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 <= -7.8e+59) or not (c <= 7.2e-7):
		tmp = 2.0 * ((x * y) - (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 <= -7.8e+59) || !(c <= 7.2e-7))
		tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -7.8e+59) || ~((c <= 7.2e-7)))
		tmp = 2.0 * ((x * y) - (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, -7.8e+59], N[Not[LessEqual[c, 7.2e-7]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $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 -7.8 \cdot 10^{+59} \lor \neg \left(c \leq 7.2 \cdot 10^{-7}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - 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 < -7.80000000000000043e59 or 7.19999999999999989e-7 < c

    1. Initial program 79.6%

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

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

    if -7.80000000000000043e59 < c < 7.19999999999999989e-7

    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) \]
    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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.8 \cdot 10^{+59} \lor \neg \left(c \leq 7.2 \cdot 10^{-7}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 9: 43.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.22 \cdot 10^{+61} \lor \neg \left(x \cdot y \leq 1.75 \cdot 10^{-26}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.22e61 or 1.74999999999999992e-26 < (*.f64 x y)

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

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

    if -1.22e61 < (*.f64 x y) < 1.74999999999999992e-26

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

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

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

Alternative 10: 29.2% accurate, 3.8× speedup?

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

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

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

    \[\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 2023301 
(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))))