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

Percentage Accurate: 90.1% → 95.9%
Time: 12.7s
Alternatives: 14
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 90.1% accurate, 1.0× speedup?

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

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

Alternative 1: 95.9% 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}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))))
   (if (<= (- (+ (* x y) (* z t)) (* (* c t_1) i)) INFINITY)
     (* 2.0 (- (fma x y (* z t)) (* t_1 (* c i))))
     (* 2.0 (fma y x (- (* z t) (* 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 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 = 2.0 * fma(y, x, ((z * t) - (c * (b * (c * i)))));
	}
	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(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))));
	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[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\


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

    1. Initial program 96.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-def96.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*99.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. Simplified99.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. associate--l+0.0%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.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}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 2: 92.7% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\


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

    1. Initial program 96.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) \]

    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. associate--l+0.0%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.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:\\ \;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 3: 43.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ t_3 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-46}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-187}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 10^{+89}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* z t)))
        (t_2 (* (* c i) (* a -2.0)))
        (t_3 (* (* x y) 2.0)))
   (if (<= (* x y) -2e-46)
     t_3
     (if (<= (* x y) 5e-187)
       t_1
       (if (<= (* x y) 5e-109)
         t_2
         (if (<= (* x y) 5e+60)
           t_1
           (if (<= (* x y) 1e+89) t_2 (if (<= (* x y) 1e+100) 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 = 2.0 * (z * t);
	double t_2 = (c * i) * (a * -2.0);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -2e-46) {
		tmp = t_3;
	} else if ((x * y) <= 5e-187) {
		tmp = t_1;
	} else if ((x * y) <= 5e-109) {
		tmp = t_2;
	} else if ((x * y) <= 5e+60) {
		tmp = t_1;
	} else if ((x * y) <= 1e+89) {
		tmp = t_2;
	} else if ((x * y) <= 1e+100) {
		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 = 2.0d0 * (z * t)
    t_2 = (c * i) * (a * (-2.0d0))
    t_3 = (x * y) * 2.0d0
    if ((x * y) <= (-2d-46)) then
        tmp = t_3
    else if ((x * y) <= 5d-187) then
        tmp = t_1
    else if ((x * y) <= 5d-109) then
        tmp = t_2
    else if ((x * y) <= 5d+60) then
        tmp = t_1
    else if ((x * y) <= 1d+89) then
        tmp = t_2
    else if ((x * y) <= 1d+100) 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 = 2.0 * (z * t);
	double t_2 = (c * i) * (a * -2.0);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -2e-46) {
		tmp = t_3;
	} else if ((x * y) <= 5e-187) {
		tmp = t_1;
	} else if ((x * y) <= 5e-109) {
		tmp = t_2;
	} else if ((x * y) <= 5e+60) {
		tmp = t_1;
	} else if ((x * y) <= 1e+89) {
		tmp = t_2;
	} else if ((x * y) <= 1e+100) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = (c * i) * (a * -2.0)
	t_3 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -2e-46:
		tmp = t_3
	elif (x * y) <= 5e-187:
		tmp = t_1
	elif (x * y) <= 5e-109:
		tmp = t_2
	elif (x * y) <= 5e+60:
		tmp = t_1
	elif (x * y) <= 1e+89:
		tmp = t_2
	elif (x * y) <= 1e+100:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(z * t))
	t_2 = Float64(Float64(c * i) * Float64(a * -2.0))
	t_3 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -2e-46)
		tmp = t_3;
	elseif (Float64(x * y) <= 5e-187)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-109)
		tmp = t_2;
	elseif (Float64(x * y) <= 5e+60)
		tmp = t_1;
	elseif (Float64(x * y) <= 1e+89)
		tmp = t_2;
	elseif (Float64(x * y) <= 1e+100)
		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 = 2.0 * (z * t);
	t_2 = (c * i) * (a * -2.0);
	t_3 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -2e-46)
		tmp = t_3;
	elseif ((x * y) <= 5e-187)
		tmp = t_1;
	elseif ((x * y) <= 5e-109)
		tmp = t_2;
	elseif ((x * y) <= 5e+60)
		tmp = t_1;
	elseif ((x * y) <= 1e+89)
		tmp = t_2;
	elseif ((x * y) <= 1e+100)
		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[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e-46], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 5e-187], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-109], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e+60], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e+89], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e+100], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-187}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-109}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 10^{+89}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 10^{+100}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.00000000000000005e-46 or 1.00000000000000002e100 < (*.f64 x y)

    1. Initial program 93.8%

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

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

    if -2.00000000000000005e-46 < (*.f64 x y) < 4.9999999999999996e-187 or 5.0000000000000002e-109 < (*.f64 x y) < 4.99999999999999975e60 or 9.99999999999999995e88 < (*.f64 x y) < 1.00000000000000002e100

    1. Initial program 92.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 46.1%

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

    if 4.9999999999999996e-187 < (*.f64 x y) < 5.0000000000000002e-109 or 4.99999999999999975e60 < (*.f64 x y) < 9.99999999999999995e88

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-46}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-187}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-109}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+60}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+89}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+100}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 4: 92.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := c \cdot t_1\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+291}:\\ \;\;\;\;2 \cdot \left(\left(t_1 \cdot i\right) \cdot \left(-c\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 (<= t_2 -5e+291)
     (* 2.0 (* (* t_1 i) (- c)))
     (* (- (+ (* 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 <= -5e+291) {
		tmp = 2.0 * ((t_1 * i) * -c);
	} else {
		tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = c * t_1
    if (t_2 <= (-5d+291)) then
        tmp = 2.0d0 * ((t_1 * i) * -c)
    else
        tmp = (((x * y) + (z * t)) - (t_2 * i)) * 2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = c * t_1;
	double tmp;
	if (t_2 <= -5e+291) {
		tmp = 2.0 * ((t_1 * i) * -c);
	} 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 <= -5e+291:
		tmp = 2.0 * ((t_1 * i) * -c)
	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 <= -5e+291)
		tmp = Float64(2.0 * Float64(Float64(t_1 * i) * Float64(-c)));
	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 <= -5e+291)
		tmp = 2.0 * ((t_1 * i) * -c);
	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[LessEqual[t$95$2, -5e+291], N[(2.0 * N[(N[(t$95$1 * i), $MachinePrecision] * (-c)), $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 -5 \cdot 10^{+291}:\\
\;\;\;\;2 \cdot \left(\left(t_1 \cdot i\right) \cdot \left(-c\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) < -5.0000000000000001e291

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

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

    if -5.0000000000000001e291 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 96.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot \left(a + b \cdot c\right) \leq -5 \cdot 10^{+291}:\\ \;\;\;\;2 \cdot \left(\left(\left(a + b \cdot c\right) \cdot i\right) \cdot \left(-c\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 5: 86.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\ t_2 := x \cdot y + z \cdot t\\ t_3 := 2 \cdot \left(t_2 - i \cdot \left(a \cdot c\right)\right)\\ t_4 := 2 \cdot \left(z \cdot t - t_1\right)\\ \mathbf{if}\;c \leq -3.1 \cdot 10^{+63}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\ \mathbf{elif}\;c \leq -4.8 \cdot 10^{-7}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-24}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{-125}:\\ \;\;\;\;2 \cdot \left(t_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{+70}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* c (* (+ a (* b c)) i)))
        (t_2 (+ (* x y) (* z t)))
        (t_3 (* 2.0 (- t_2 (* i (* a c)))))
        (t_4 (* 2.0 (- (* z t) t_1))))
   (if (<= c -3.1e+63)
     (* 2.0 (- (* x y) t_1))
     (if (<= c -4.8e-7)
       t_4
       (if (<= c -3e-24)
         t_3
         (if (<= c -1.15e-125)
           (* 2.0 (- t_2 (* i (* c (* b c)))))
           (if (<= c 2.8e+70) t_3 t_4)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * ((a + (b * c)) * i);
	double t_2 = (x * y) + (z * t);
	double t_3 = 2.0 * (t_2 - (i * (a * c)));
	double t_4 = 2.0 * ((z * t) - t_1);
	double tmp;
	if (c <= -3.1e+63) {
		tmp = 2.0 * ((x * y) - t_1);
	} else if (c <= -4.8e-7) {
		tmp = t_4;
	} else if (c <= -3e-24) {
		tmp = t_3;
	} else if (c <= -1.15e-125) {
		tmp = 2.0 * (t_2 - (i * (c * (b * c))));
	} else if (c <= 2.8e+70) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	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) :: t_4
    real(8) :: tmp
    t_1 = c * ((a + (b * c)) * i)
    t_2 = (x * y) + (z * t)
    t_3 = 2.0d0 * (t_2 - (i * (a * c)))
    t_4 = 2.0d0 * ((z * t) - t_1)
    if (c <= (-3.1d+63)) then
        tmp = 2.0d0 * ((x * y) - t_1)
    else if (c <= (-4.8d-7)) then
        tmp = t_4
    else if (c <= (-3d-24)) then
        tmp = t_3
    else if (c <= (-1.15d-125)) then
        tmp = 2.0d0 * (t_2 - (i * (c * (b * c))))
    else if (c <= 2.8d+70) then
        tmp = t_3
    else
        tmp = t_4
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * ((a + (b * c)) * i);
	double t_2 = (x * y) + (z * t);
	double t_3 = 2.0 * (t_2 - (i * (a * c)));
	double t_4 = 2.0 * ((z * t) - t_1);
	double tmp;
	if (c <= -3.1e+63) {
		tmp = 2.0 * ((x * y) - t_1);
	} else if (c <= -4.8e-7) {
		tmp = t_4;
	} else if (c <= -3e-24) {
		tmp = t_3;
	} else if (c <= -1.15e-125) {
		tmp = 2.0 * (t_2 - (i * (c * (b * c))));
	} else if (c <= 2.8e+70) {
		tmp = t_3;
	} else {
		tmp = t_4;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = c * ((a + (b * c)) * i)
	t_2 = (x * y) + (z * t)
	t_3 = 2.0 * (t_2 - (i * (a * c)))
	t_4 = 2.0 * ((z * t) - t_1)
	tmp = 0
	if c <= -3.1e+63:
		tmp = 2.0 * ((x * y) - t_1)
	elif c <= -4.8e-7:
		tmp = t_4
	elif c <= -3e-24:
		tmp = t_3
	elif c <= -1.15e-125:
		tmp = 2.0 * (t_2 - (i * (c * (b * c))))
	elif c <= 2.8e+70:
		tmp = t_3
	else:
		tmp = t_4
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	t_3 = Float64(2.0 * Float64(t_2 - Float64(i * Float64(a * c))))
	t_4 = Float64(2.0 * Float64(Float64(z * t) - t_1))
	tmp = 0.0
	if (c <= -3.1e+63)
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_1));
	elseif (c <= -4.8e-7)
		tmp = t_4;
	elseif (c <= -3e-24)
		tmp = t_3;
	elseif (c <= -1.15e-125)
		tmp = Float64(2.0 * Float64(t_2 - Float64(i * Float64(c * Float64(b * c)))));
	elseif (c <= 2.8e+70)
		tmp = t_3;
	else
		tmp = t_4;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = c * ((a + (b * c)) * i);
	t_2 = (x * y) + (z * t);
	t_3 = 2.0 * (t_2 - (i * (a * c)));
	t_4 = 2.0 * ((z * t) - t_1);
	tmp = 0.0;
	if (c <= -3.1e+63)
		tmp = 2.0 * ((x * y) - t_1);
	elseif (c <= -4.8e-7)
		tmp = t_4;
	elseif (c <= -3e-24)
		tmp = t_3;
	elseif (c <= -1.15e-125)
		tmp = 2.0 * (t_2 - (i * (c * (b * c))));
	elseif (c <= 2.8e+70)
		tmp = t_3;
	else
		tmp = t_4;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.1e+63], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4.8e-7], t$95$4, If[LessEqual[c, -3e-24], t$95$3, If[LessEqual[c, -1.15e-125], N[(2.0 * N[(t$95$2 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.8e+70], t$95$3, t$95$4]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -4.8 \cdot 10^{-7}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c \leq -3 \cdot 10^{-24}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq -1.15 \cdot 10^{-125}:\\
\;\;\;\;2 \cdot \left(t_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{+70}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_4\\


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

    1. Initial program 85.7%

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

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

    if -3.1000000000000001e63 < c < -4.79999999999999957e-7 or 2.7999999999999999e70 < c

    1. Initial program 88.0%

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

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

    if -4.79999999999999957e-7 < c < -2.99999999999999995e-24 or -1.15e-125 < c < 2.7999999999999999e70

    1. Initial program 98.8%

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

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

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

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

    if -2.99999999999999995e-24 < c < -1.15e-125

    1. Initial program 96.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+63}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -4.8 \cdot 10^{-7}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-24}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{-125}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{+70}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 6: 76.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -3 \cdot 10^{-14}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq -3.6 \cdot 10^{-136}:\\
\;\;\;\;t_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -5.19999999999999994e64 or -2.9999999999999998e-14 < c < -3.5999999999999998e-136

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

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

    if -5.19999999999999994e64 < c < -2.9999999999999998e-14 or 5.09999999999999971e106 < c

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

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

    if -3.5999999999999998e-136 < c < 5.09999999999999971e106

    1. Initial program 97.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 c around 0 86.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.2 \cdot 10^{+64}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3.6 \cdot 10^{-136}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 5.1 \cdot 10^{+106}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 7: 86.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -2.2 \cdot 10^{-14}:\\
\;\;\;\;t_3\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.04999999999999996e65 or -2.2000000000000001e-14 < c < -6.4999999999999994e-61

    1. Initial program 86.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 88.6%

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

    if -1.04999999999999996e65 < c < -2.2000000000000001e-14 or 3.19999999999999976e76 < c

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

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

    if -6.4999999999999994e-61 < c < 3.19999999999999976e76

    1. Initial program 98.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.05 \cdot 10^{+65}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -2.2 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-61}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+76}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 8: 62.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.99999999999999991e-44 or 1.99999999999999985e-65 < (*.f64 x y)

    1. Initial program 94.1%

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

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

    if -1.99999999999999991e-44 < (*.f64 x y) < 1.99999999999999985e-65

    1. Initial program 92.0%

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

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

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

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

Alternative 9: 63.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -0.10000000000000001 or 1.99999999999999985e-65 < (*.f64 x y)

    1. Initial program 93.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 66.8%

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

    if -0.10000000000000001 < (*.f64 x y) < 1.99999999999999985e-65

    1. Initial program 92.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 0 83.8%

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. distribute-lft-in81.8%

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

        \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\frac{\left(i \cdot a\right) \cdot \left(i \cdot a\right) - \left(i \cdot \left(b \cdot c\right)\right) \cdot \left(i \cdot \left(b \cdot c\right)\right)}{i \cdot a - i \cdot \left(b \cdot c\right)}}\right) \]
      3. *-commutative37.5%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 78.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1 \cdot 10^{-33} \lor \neg \left(c \leq 1.18 \cdot 10^{+86}\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 -1e-33) (not (<= c 1.18e+86)))
   (* 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 <= -1e-33) || !(c <= 1.18e+86)) {
		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 <= (-1d-33)) .or. (.not. (c <= 1.18d+86))) 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 <= -1e-33) || !(c <= 1.18e+86)) {
		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 <= -1e-33) or not (c <= 1.18e+86):
		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 <= -1e-33) || !(c <= 1.18e+86))
		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 <= -1e-33) || ~((c <= 1.18e+86)))
		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, -1e-33], N[Not[LessEqual[c, 1.18e+86]], $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 -1 \cdot 10^{-33} \lor \neg \left(c \leq 1.18 \cdot 10^{+86}\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 < -1.0000000000000001e-33 or 1.18e86 < c

    1. Initial program 88.3%

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

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

    if -1.0000000000000001e-33 < c < 1.18e86

    1. Initial program 97.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 c around 0 82.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1 \cdot 10^{-33} \lor \neg \left(c \leq 1.18 \cdot 10^{+86}\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 11: 74.7% accurate, 1.2× speedup?

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

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

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

    if -8.5e-9 < c < 1.75000000000000009e86

    1. Initial program 97.6%

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

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

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

Alternative 12: 44.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{-46} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+76}\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) -2e-46) (not (<= (* x y) 4e+76)))
   (* (* 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) <= -2e-46) || !((x * y) <= 4e+76)) {
		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) <= (-2d-46)) .or. (.not. ((x * y) <= 4d+76))) 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) <= -2e-46) || !((x * y) <= 4e+76)) {
		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) <= -2e-46) or not ((x * y) <= 4e+76):
		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) <= -2e-46) || !(Float64(x * y) <= 4e+76))
		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) <= -2e-46) || ~(((x * y) <= 4e+76)))
		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], -2e-46], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4e+76]], $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 -2 \cdot 10^{-46} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+76}\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) < -2.00000000000000005e-46 or 4.0000000000000002e76 < (*.f64 x y)

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

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

    if -2.00000000000000005e-46 < (*.f64 x y) < 4.0000000000000002e76

    1. Initial program 92.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 inf 41.4%

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

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

Alternative 13: 56.9% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.8e168

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e168 < i

    1. Initial program 92.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 c around 0 63.7%

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

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

Alternative 14: 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 93.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 inf 27.8%

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

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

Developer target: 93.9% 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 2023314 
(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))))