Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 95.7% → 97.9%
Time: 12.0s
Alternatives: 15
Speedup: 0.4×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * y) + (z * t)) + (a * b)) + (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 = (((x * y) + (z * t)) + (a * b)) + (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 (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((x * y) + (z * t)) + (a * b)) + (c * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 95.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * y) + (z * t)) + (a * b)) + (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 = (((x * y) + (z * t)) + (a * b)) + (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 (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((x * y) + (z * t)) + (a * b)) + (c * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.9% accurate, 0.0× speedup?

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

\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Derivation
  1. Initial program 93.3%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
  4. Add Preprocessing
  5. Final simplification97.2%

    \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right) \]
  6. Add Preprocessing

Alternative 2: 65.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := x \cdot y + z \cdot t\\ t_3 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+51}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -4.1 \cdot 10^{-193}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-306}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-141}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-37}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 8.4 \cdot 10^{+15} \lor \neg \left(x \cdot y \leq 2.1 \cdot 10^{+94}\right) \land x \cdot y \leq 3.3 \cdot 10^{+138}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (* z t)))
        (t_2 (+ (* x y) (* z t)))
        (t_3 (+ (* a b) (* z t))))
   (if (<= (* x y) -1.8e+51)
     t_2
     (if (<= (* x y) -4.1e-193)
       (+ (* a b) (* c i))
       (if (<= (* x y) 4.1e-306)
         t_3
         (if (<= (* x y) 3.5e-141)
           t_1
           (if (<= (* x y) 5.6e-37)
             t_3
             (if (or (<= (* x y) 8.4e+15)
                     (and (not (<= (* x y) 2.1e+94)) (<= (* x y) 3.3e+138)))
               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 = (c * i) + (z * t);
	double t_2 = (x * y) + (z * t);
	double t_3 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -1.8e+51) {
		tmp = t_2;
	} else if ((x * y) <= -4.1e-193) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 4.1e-306) {
		tmp = t_3;
	} else if ((x * y) <= 3.5e-141) {
		tmp = t_1;
	} else if ((x * y) <= 5.6e-37) {
		tmp = t_3;
	} else if (((x * y) <= 8.4e+15) || (!((x * y) <= 2.1e+94) && ((x * y) <= 3.3e+138))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (c * i) + (z * t)
    t_2 = (x * y) + (z * t)
    t_3 = (a * b) + (z * t)
    if ((x * y) <= (-1.8d+51)) then
        tmp = t_2
    else if ((x * y) <= (-4.1d-193)) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 4.1d-306) then
        tmp = t_3
    else if ((x * y) <= 3.5d-141) then
        tmp = t_1
    else if ((x * y) <= 5.6d-37) then
        tmp = t_3
    else if (((x * y) <= 8.4d+15) .or. (.not. ((x * y) <= 2.1d+94)) .and. ((x * y) <= 3.3d+138)) 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 = (c * i) + (z * t);
	double t_2 = (x * y) + (z * t);
	double t_3 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -1.8e+51) {
		tmp = t_2;
	} else if ((x * y) <= -4.1e-193) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 4.1e-306) {
		tmp = t_3;
	} else if ((x * y) <= 3.5e-141) {
		tmp = t_1;
	} else if ((x * y) <= 5.6e-37) {
		tmp = t_3;
	} else if (((x * y) <= 8.4e+15) || (!((x * y) <= 2.1e+94) && ((x * y) <= 3.3e+138))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (x * y) + (z * t)
	t_3 = (a * b) + (z * t)
	tmp = 0
	if (x * y) <= -1.8e+51:
		tmp = t_2
	elif (x * y) <= -4.1e-193:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 4.1e-306:
		tmp = t_3
	elif (x * y) <= 3.5e-141:
		tmp = t_1
	elif (x * y) <= 5.6e-37:
		tmp = t_3
	elif ((x * y) <= 8.4e+15) or (not ((x * y) <= 2.1e+94) and ((x * y) <= 3.3e+138)):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(z * t))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	t_3 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -1.8e+51)
		tmp = t_2;
	elseif (Float64(x * y) <= -4.1e-193)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 4.1e-306)
		tmp = t_3;
	elseif (Float64(x * y) <= 3.5e-141)
		tmp = t_1;
	elseif (Float64(x * y) <= 5.6e-37)
		tmp = t_3;
	elseif ((Float64(x * y) <= 8.4e+15) || (!(Float64(x * y) <= 2.1e+94) && (Float64(x * y) <= 3.3e+138)))
		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 = (c * i) + (z * t);
	t_2 = (x * y) + (z * t);
	t_3 = (a * b) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -1.8e+51)
		tmp = t_2;
	elseif ((x * y) <= -4.1e-193)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 4.1e-306)
		tmp = t_3;
	elseif ((x * y) <= 3.5e-141)
		tmp = t_1;
	elseif ((x * y) <= 5.6e-37)
		tmp = t_3;
	elseif (((x * y) <= 8.4e+15) || (~(((x * y) <= 2.1e+94)) && ((x * y) <= 3.3e+138)))
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+51], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -4.1e-193], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.1e-306], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 3.5e-141], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.6e-37], t$95$3, If[Or[LessEqual[N[(x * y), $MachinePrecision], 8.4e+15], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.1e+94]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 3.3e+138]]], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := x \cdot y + z \cdot t\\
t_3 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq -4.1 \cdot 10^{-193}:\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-37}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq 8.4 \cdot 10^{+15} \lor \neg \left(x \cdot y \leq 2.1 \cdot 10^{+94}\right) \land x \cdot y \leq 3.3 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.80000000000000005e51 or 8.4e15 < (*.f64 x y) < 2.09999999999999989e94 or 3.29999999999999978e138 < (*.f64 x y)

    1. Initial program 93.2%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around 0 80.5%

      \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]

    if -1.80000000000000005e51 < (*.f64 x y) < -4.10000000000000003e-193

    1. Initial program 92.6%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]

    if -4.10000000000000003e-193 < (*.f64 x y) < 4.09999999999999985e-306 or 3.5000000000000003e-141 < (*.f64 x y) < 5.6000000000000002e-37

    1. Initial program 98.5%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if 4.09999999999999985e-306 < (*.f64 x y) < 3.5000000000000003e-141 or 5.6000000000000002e-37 < (*.f64 x y) < 8.4e15 or 2.09999999999999989e94 < (*.f64 x y) < 3.29999999999999978e138

    1. Initial program 86.0%

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

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
  3. Recombined 4 regimes into one program.
  4. Final simplification79.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+51}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -4.1 \cdot 10^{-193}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 4.1 \cdot 10^{-306}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 3.5 \cdot 10^{-141}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-37}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.4 \cdot 10^{+15} \lor \neg \left(x \cdot y \leq 2.1 \cdot 10^{+94}\right) \land x \cdot y \leq 3.3 \cdot 10^{+138}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-10}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-309}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 10^{-30}:\\
\;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y + c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -4.0000000000000001e108

    1. Initial program 93.3%

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

      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
    4. Taylor expanded in y around inf 87.0%

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

      \[\leadsto \color{blue}{y \cdot \left(x + \frac{c \cdot i}{y}\right)} \]

    if -4.0000000000000001e108 < (*.f64 x y) < -1.00000000000000004e-10 or -9.99999999999999927e-77 < (*.f64 x y) < 1.9999999999999988e-309

    1. Initial program 96.1%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if -1.00000000000000004e-10 < (*.f64 x y) < -9.99999999999999927e-77 or 1.9999999999999988e-309 < (*.f64 x y) < 3.99999999999999992e-149

    1. Initial program 94.2%

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

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]

    if 3.99999999999999992e-149 < (*.f64 x y) < 1e-30

    1. Initial program 92.8%

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

      \[\leadsto \color{blue}{z \cdot \left(t + \left(\frac{a \cdot b}{z} + \frac{x \cdot y}{z}\right)\right)} + c \cdot i \]
    4. Taylor expanded in x around 0 89.9%

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

      \[\leadsto \color{blue}{z \cdot \left(t + \frac{a \cdot b}{z}\right)} \]

    if 1e-30 < (*.f64 x y)

    1. Initial program 90.0%

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

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
  3. Recombined 5 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+108}:\\ \;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-10}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-76}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-309}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-149}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 10^{-30}:\\ \;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 63.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+122}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-192}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-293}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{-142}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 4.3 \cdot 10^{-36}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+141}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* a b) (* z t))))
   (if (<= (* x y) -2.3e+122)
     (+ (* x y) (* a b))
     (if (<= (* x y) -3.8e-192)
       (+ (* a b) (* c i))
       (if (<= (* x y) 2.2e-293)
         t_2
         (if (<= (* x y) 8.6e-142)
           t_1
           (if (<= (* x y) 4.3e-36)
             t_2
             (if (<= (* x y) 1.2e+141) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + (z * t);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -2.3e+122) {
		tmp = (x * y) + (a * b);
	} else if ((x * y) <= -3.8e-192) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 2.2e-293) {
		tmp = t_2;
	} else if ((x * y) <= 8.6e-142) {
		tmp = t_1;
	} else if ((x * y) <= 4.3e-36) {
		tmp = t_2;
	} else if ((x * y) <= 1.2e+141) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (c * i) + (z * t)
    t_2 = (a * b) + (z * t)
    if ((x * y) <= (-2.3d+122)) then
        tmp = (x * y) + (a * b)
    else if ((x * y) <= (-3.8d-192)) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 2.2d-293) then
        tmp = t_2
    else if ((x * y) <= 8.6d-142) then
        tmp = t_1
    else if ((x * y) <= 4.3d-36) then
        tmp = t_2
    else if ((x * y) <= 1.2d+141) then
        tmp = t_1
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + (z * t);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -2.3e+122) {
		tmp = (x * y) + (a * b);
	} else if ((x * y) <= -3.8e-192) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 2.2e-293) {
		tmp = t_2;
	} else if ((x * y) <= 8.6e-142) {
		tmp = t_1;
	} else if ((x * y) <= 4.3e-36) {
		tmp = t_2;
	} else if ((x * y) <= 1.2e+141) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (a * b) + (z * t)
	tmp = 0
	if (x * y) <= -2.3e+122:
		tmp = (x * y) + (a * b)
	elif (x * y) <= -3.8e-192:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 2.2e-293:
		tmp = t_2
	elif (x * y) <= 8.6e-142:
		tmp = t_1
	elif (x * y) <= 4.3e-36:
		tmp = t_2
	elif (x * y) <= 1.2e+141:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(z * t))
	t_2 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -2.3e+122)
		tmp = Float64(Float64(x * y) + Float64(a * b));
	elseif (Float64(x * y) <= -3.8e-192)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 2.2e-293)
		tmp = t_2;
	elseif (Float64(x * y) <= 8.6e-142)
		tmp = t_1;
	elseif (Float64(x * y) <= 4.3e-36)
		tmp = t_2;
	elseif (Float64(x * y) <= 1.2e+141)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * i) + (z * t);
	t_2 = (a * b) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -2.3e+122)
		tmp = (x * y) + (a * b);
	elseif ((x * y) <= -3.8e-192)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 2.2e-293)
		tmp = t_2;
	elseif ((x * y) <= 8.6e-142)
		tmp = t_1;
	elseif ((x * y) <= 4.3e-36)
		tmp = t_2;
	elseif ((x * y) <= 1.2e+141)
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e+122], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.8e-192], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-293], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8.6e-142], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.3e-36], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e+141], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+122}:\\
\;\;\;\;x \cdot y + a \cdot b\\

\mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-192}:\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-293}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 4.3 \cdot 10^{-36}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -2.3000000000000001e122

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in t around 0 77.5%

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]

    if -2.3000000000000001e122 < (*.f64 x y) < -3.8000000000000001e-192

    1. Initial program 94.4%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]

    if -3.8000000000000001e-192 < (*.f64 x y) < 2.2e-293 or 8.5999999999999995e-142 < (*.f64 x y) < 4.3000000000000002e-36

    1. Initial program 98.5%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if 2.2e-293 < (*.f64 x y) < 8.5999999999999995e-142 or 4.3000000000000002e-36 < (*.f64 x y) < 1.19999999999999999e141

    1. Initial program 89.1%

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

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]

    if 1.19999999999999999e141 < (*.f64 x y)

    1. Initial program 89.7%

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification75.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.3 \cdot 10^{+122}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-192}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-293}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{-142}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 4.3 \cdot 10^{-36}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+141}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2.55 \cdot 10^{-194}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 2.65 \cdot 10^{-48}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.90000000000000001e125 or 7.99999999999999957e183 < (*.f64 x y)

    1. Initial program 90.8%

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

      \[\leadsto \color{blue}{x \cdot y} \]

    if -1.90000000000000001e125 < (*.f64 x y) < -2.5499999999999999e-194 or 2.65e-48 < (*.f64 x y) < 2.1e15

    1. Initial program 91.0%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]

    if -2.5499999999999999e-194 < (*.f64 x y) < 2.65e-48 or 2.1e15 < (*.f64 x y) < 7.99999999999999957e183

    1. Initial program 96.4%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+125}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.55 \cdot 10^{-194}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2.65 \cdot 10^{-48}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+15}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+183}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ t_2 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -1.26 \cdot 10^{+122}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-197}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-49}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+184}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* a b) (* z t))))
   (if (<= (* x y) -1.26e+122)
     (+ (* x y) (* a b))
     (if (<= (* x y) -4.8e-197)
       t_1
       (if (<= (* x y) 3.2e-49)
         t_2
         (if (<= (* x y) 9.5e+14)
           t_1
           (if (<= (* x y) 1.55e+184) t_2 (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (c * i);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -1.26e+122) {
		tmp = (x * y) + (a * b);
	} else if ((x * y) <= -4.8e-197) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-49) {
		tmp = t_2;
	} else if ((x * y) <= 9.5e+14) {
		tmp = t_1;
	} else if ((x * y) <= 1.55e+184) {
		tmp = t_2;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    t_2 = (a * b) + (z * t)
    if ((x * y) <= (-1.26d+122)) then
        tmp = (x * y) + (a * b)
    else if ((x * y) <= (-4.8d-197)) then
        tmp = t_1
    else if ((x * y) <= 3.2d-49) then
        tmp = t_2
    else if ((x * y) <= 9.5d+14) then
        tmp = t_1
    else if ((x * y) <= 1.55d+184) then
        tmp = t_2
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (c * i);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -1.26e+122) {
		tmp = (x * y) + (a * b);
	} else if ((x * y) <= -4.8e-197) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-49) {
		tmp = t_2;
	} else if ((x * y) <= 9.5e+14) {
		tmp = t_1;
	} else if ((x * y) <= 1.55e+184) {
		tmp = t_2;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	t_2 = (a * b) + (z * t)
	tmp = 0
	if (x * y) <= -1.26e+122:
		tmp = (x * y) + (a * b)
	elif (x * y) <= -4.8e-197:
		tmp = t_1
	elif (x * y) <= 3.2e-49:
		tmp = t_2
	elif (x * y) <= 9.5e+14:
		tmp = t_1
	elif (x * y) <= 1.55e+184:
		tmp = t_2
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(c * i))
	t_2 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -1.26e+122)
		tmp = Float64(Float64(x * y) + Float64(a * b));
	elseif (Float64(x * y) <= -4.8e-197)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e-49)
		tmp = t_2;
	elseif (Float64(x * y) <= 9.5e+14)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.55e+184)
		tmp = t_2;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (c * i);
	t_2 = (a * b) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -1.26e+122)
		tmp = (x * y) + (a * b);
	elseif ((x * y) <= -4.8e-197)
		tmp = t_1;
	elseif ((x * y) <= 3.2e-49)
		tmp = t_2;
	elseif ((x * y) <= 9.5e+14)
		tmp = t_1;
	elseif ((x * y) <= 1.55e+184)
		tmp = t_2;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.26e+122], N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.8e-197], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-49], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 9.5e+14], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.55e+184], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -1.26 \cdot 10^{+122}:\\
\;\;\;\;x \cdot y + a \cdot b\\

\mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-49}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+184}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.25999999999999991e122

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in t around 0 77.5%

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]

    if -1.25999999999999991e122 < (*.f64 x y) < -4.8000000000000002e-197 or 3.20000000000000002e-49 < (*.f64 x y) < 9.5e14

    1. Initial program 91.0%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]

    if -4.8000000000000002e-197 < (*.f64 x y) < 3.20000000000000002e-49 or 9.5e14 < (*.f64 x y) < 1.5499999999999999e184

    1. Initial program 96.4%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if 1.5499999999999999e184 < (*.f64 x y)

    1. Initial program 89.2%

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.26 \cdot 10^{+122}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{-197}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-49}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+14}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+184}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 42.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+87}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-220}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-106}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{-80}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+19}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* x y) -6.5e+87)
   (* x y)
   (if (<= (* x y) -1.95e-220)
     (* a b)
     (if (<= (* x y) 6.6e-106)
       (* z t)
       (if (<= (* x y) 2.95e-80)
         (* a b)
         (if (<= (* x y) 1.42e+19) (* c i) (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -6.5e+87) {
		tmp = x * y;
	} else if ((x * y) <= -1.95e-220) {
		tmp = a * b;
	} else if ((x * y) <= 6.6e-106) {
		tmp = z * t;
	} else if ((x * y) <= 2.95e-80) {
		tmp = a * b;
	} else if ((x * y) <= 1.42e+19) {
		tmp = c * i;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x * y) <= (-6.5d+87)) then
        tmp = x * y
    else if ((x * y) <= (-1.95d-220)) then
        tmp = a * b
    else if ((x * y) <= 6.6d-106) then
        tmp = z * t
    else if ((x * y) <= 2.95d-80) then
        tmp = a * b
    else if ((x * y) <= 1.42d+19) then
        tmp = c * i
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -6.5e+87) {
		tmp = x * y;
	} else if ((x * y) <= -1.95e-220) {
		tmp = a * b;
	} else if ((x * y) <= 6.6e-106) {
		tmp = z * t;
	} else if ((x * y) <= 2.95e-80) {
		tmp = a * b;
	} else if ((x * y) <= 1.42e+19) {
		tmp = c * i;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -6.5e+87:
		tmp = x * y
	elif (x * y) <= -1.95e-220:
		tmp = a * b
	elif (x * y) <= 6.6e-106:
		tmp = z * t
	elif (x * y) <= 2.95e-80:
		tmp = a * b
	elif (x * y) <= 1.42e+19:
		tmp = c * i
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(x * y) <= -6.5e+87)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.95e-220)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= 6.6e-106)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 2.95e-80)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= 1.42e+19)
		tmp = Float64(c * i);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x * y) <= -6.5e+87)
		tmp = x * y;
	elseif ((x * y) <= -1.95e-220)
		tmp = a * b;
	elseif ((x * y) <= 6.6e-106)
		tmp = z * t;
	elseif ((x * y) <= 2.95e-80)
		tmp = a * b;
	elseif ((x * y) <= 1.42e+19)
		tmp = c * i;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -6.5e+87], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.95e-220], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-106], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.95e-80], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.42e+19], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+87}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-220}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-106}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{-80}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+19}:\\
\;\;\;\;c \cdot i\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -6.5000000000000002e87 or 1.42e19 < (*.f64 x y)

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{x \cdot y} \]

    if -6.5000000000000002e87 < (*.f64 x y) < -1.95000000000000001e-220 or 6.60000000000000031e-106 < (*.f64 x y) < 2.95e-80

    1. Initial program 94.9%

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

      \[\leadsto \color{blue}{a \cdot b} \]

    if -1.95000000000000001e-220 < (*.f64 x y) < 6.60000000000000031e-106

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{t \cdot z} \]

    if 2.95e-80 < (*.f64 x y) < 1.42e19

    1. Initial program 81.0%

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

      \[\leadsto \color{blue}{c \cdot i} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification53.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+87}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.95 \cdot 10^{-220}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-106}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{-80}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 1.42 \cdot 10^{+19}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 61.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.46 \cdot 10^{+125}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-220}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-305}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.45999999999999999e125 or 2.0999999999999999e182 < (*.f64 x y)

    1. Initial program 90.8%

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

      \[\leadsto \color{blue}{x \cdot y} \]

    if -1.45999999999999999e125 < (*.f64 x y) < -1.90000000000000004e-220 or -5.5e-305 < (*.f64 x y) < 2.0999999999999999e182

    1. Initial program 94.1%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]

    if -1.90000000000000004e-220 < (*.f64 x y) < -5.5e-305

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{t \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.46 \cdot 10^{+125}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-220}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-305}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+182}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 65.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := x \cdot y + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+179}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-247}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.99999999999999996e179 or 4e-31 < (*.f64 c i)

    1. Initial program 89.3%

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

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]

    if -1.99999999999999996e179 < (*.f64 c i) < -5.00000000000000024e-182 or -2e-247 < (*.f64 c i) < 4e-31

    1. Initial program 96.2%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if -5.00000000000000024e-182 < (*.f64 c i) < -2e-247

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around 0 96.1%

      \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+179}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-182}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-247}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 4 \cdot 10^{-31}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 97.7% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + \frac{c \cdot i}{y}\right)\\


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

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
    4. Taylor expanded in y around inf 29.4%

      \[\leadsto a \cdot b + \color{blue}{y \cdot \left(x + \frac{c \cdot i}{y}\right)} \]
    5. Taylor expanded in a around 0 47.8%

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

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

Alternative 11: 73.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+237}:\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{+79} \lor \neg \left(z \leq -1.45 \cdot 10^{-46}\right) \land z \leq 8.6 \cdot 10^{-13}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.5e237

    1. Initial program 90.0%

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

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]

    if -7.5e237 < z < -1.85000000000000005e79 or -1.45000000000000002e-46 < z < 8.5999999999999997e-13

    1. Initial program 93.7%

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

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

    if -1.85000000000000005e79 < z < -1.45000000000000002e-46 or 8.5999999999999997e-13 < z

    1. Initial program 93.2%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+237}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{+79} \lor \neg \left(z \leq -1.45 \cdot 10^{-46}\right) \land z \leq 8.6 \cdot 10^{-13}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 41.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.5 \cdot 10^{+216}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{-308}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{-161}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \cdot i \leq 600000000:\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.4999999999999999e216 or 6e8 < (*.f64 c i)

    1. Initial program 87.6%

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

      \[\leadsto \color{blue}{c \cdot i} \]

    if -1.4999999999999999e216 < (*.f64 c i) < 2.70000000000000015e-308 or 2.6999999999999999e-161 < (*.f64 c i) < 6e8

    1. Initial program 97.0%

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

      \[\leadsto \color{blue}{t \cdot z} \]

    if 2.70000000000000015e-308 < (*.f64 c i) < 2.6999999999999999e-161

    1. Initial program 95.6%

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

      \[\leadsto \color{blue}{a \cdot b} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.5 \cdot 10^{+216}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{-308}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{-161}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 600000000:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 86.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+217}:\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 10^{+56}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -3.99999999999999984e217

    1. Initial program 81.0%

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

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]

    if -3.99999999999999984e217 < (*.f64 c i) < 1.00000000000000009e56

    1. Initial program 97.1%

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

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

    if 1.00000000000000009e56 < (*.f64 c i)

    1. Initial program 87.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+217}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 10^{+56}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 41.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7.5 \cdot 10^{+214} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{-29}\right):\\
\;\;\;\;c \cdot i\\

\mathbf{else}:\\
\;\;\;\;a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -7.4999999999999998e214 or 5.80000000000000048e-29 < (*.f64 c i)

    1. Initial program 88.4%

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

      \[\leadsto \color{blue}{c \cdot i} \]

    if -7.4999999999999998e214 < (*.f64 c i) < 5.80000000000000048e-29

    1. Initial program 96.7%

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

      \[\leadsto \color{blue}{a \cdot b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -7.5 \cdot 10^{+214} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{-29}\right):\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 27.8% accurate, 5.0× speedup?

\[\begin{array}{l} \\ a \cdot b \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a * b;
}
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 = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return a * b;
}
def code(x, y, z, t, a, b, c, i):
	return a * b
function code(x, y, z, t, a, b, c, i)
	return Float64(a * b)
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = a * b;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}

\\
a \cdot b
\end{array}
Derivation
  1. Initial program 93.3%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Final simplification25.9%

    \[\leadsto a \cdot b \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024077 
(FPCore (x y z t a b c i)
  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
  :precision binary64
  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))