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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.7% 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 96.5%

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

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

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

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

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

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

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

    \[\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 3: 43.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+181}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-34}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-55}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-154}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-241}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+128}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* x y) -8.5e+181)
   (* x y)
   (if (<= (* x y) -5.6e-34)
     (* c i)
     (if (<= (* x y) -1.05e-55)
       (* z t)
       (if (<= (* x y) -2.8e-85)
         (* c i)
         (if (<= (* x y) -1.9e-154)
           (* a b)
           (if (<= (* x y) -3.5e-241)
             (* z t)
             (if (<= (* x y) 5.5e+128) (* a b) (* 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) <= -8.5e+181) {
		tmp = x * y;
	} else if ((x * y) <= -5.6e-34) {
		tmp = c * i;
	} else if ((x * y) <= -1.05e-55) {
		tmp = z * t;
	} else if ((x * y) <= -2.8e-85) {
		tmp = c * i;
	} else if ((x * y) <= -1.9e-154) {
		tmp = a * b;
	} else if ((x * y) <= -3.5e-241) {
		tmp = z * t;
	} else if ((x * y) <= 5.5e+128) {
		tmp = a * b;
	} 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) <= (-8.5d+181)) then
        tmp = x * y
    else if ((x * y) <= (-5.6d-34)) then
        tmp = c * i
    else if ((x * y) <= (-1.05d-55)) then
        tmp = z * t
    else if ((x * y) <= (-2.8d-85)) then
        tmp = c * i
    else if ((x * y) <= (-1.9d-154)) then
        tmp = a * b
    else if ((x * y) <= (-3.5d-241)) then
        tmp = z * t
    else if ((x * y) <= 5.5d+128) then
        tmp = a * b
    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) <= -8.5e+181) {
		tmp = x * y;
	} else if ((x * y) <= -5.6e-34) {
		tmp = c * i;
	} else if ((x * y) <= -1.05e-55) {
		tmp = z * t;
	} else if ((x * y) <= -2.8e-85) {
		tmp = c * i;
	} else if ((x * y) <= -1.9e-154) {
		tmp = a * b;
	} else if ((x * y) <= -3.5e-241) {
		tmp = z * t;
	} else if ((x * y) <= 5.5e+128) {
		tmp = a * b;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -8.5e+181:
		tmp = x * y
	elif (x * y) <= -5.6e-34:
		tmp = c * i
	elif (x * y) <= -1.05e-55:
		tmp = z * t
	elif (x * y) <= -2.8e-85:
		tmp = c * i
	elif (x * y) <= -1.9e-154:
		tmp = a * b
	elif (x * y) <= -3.5e-241:
		tmp = z * t
	elif (x * y) <= 5.5e+128:
		tmp = a * b
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(x * y) <= -8.5e+181)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -5.6e-34)
		tmp = Float64(c * i);
	elseif (Float64(x * y) <= -1.05e-55)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= -2.8e-85)
		tmp = Float64(c * i);
	elseif (Float64(x * y) <= -1.9e-154)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= -3.5e-241)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 5.5e+128)
		tmp = Float64(a * b);
	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) <= -8.5e+181)
		tmp = x * y;
	elseif ((x * y) <= -5.6e-34)
		tmp = c * i;
	elseif ((x * y) <= -1.05e-55)
		tmp = z * t;
	elseif ((x * y) <= -2.8e-85)
		tmp = c * i;
	elseif ((x * y) <= -1.9e-154)
		tmp = a * b;
	elseif ((x * y) <= -3.5e-241)
		tmp = z * t;
	elseif ((x * y) <= 5.5e+128)
		tmp = a * b;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+181], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5.6e-34], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-55], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.8e-85], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.9e-154], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-241], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e+128], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-34}:\\
\;\;\;\;c \cdot i\\

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

\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-85}:\\
\;\;\;\;c \cdot i\\

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

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

\mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -8.49999999999999966e181 or 5.4999999999999998e128 < (*.f64 x y)

    1. Initial program 94.3%

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

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

    if -8.49999999999999966e181 < (*.f64 x y) < -5.59999999999999994e-34 or -1.0500000000000001e-55 < (*.f64 x y) < -2.80000000000000017e-85

    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 inf 44.9%

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

    if -5.59999999999999994e-34 < (*.f64 x y) < -1.0500000000000001e-55 or -1.90000000000000005e-154 < (*.f64 x y) < -3.4999999999999999e-241

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

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

    if -2.80000000000000017e-85 < (*.f64 x y) < -1.90000000000000005e-154 or -3.4999999999999999e-241 < (*.f64 x y) < 5.4999999999999998e128

    1. Initial program 95.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+181}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-34}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-55}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-154}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-241}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+128}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 62.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-55}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-170}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-241}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+140}:\\ \;\;\;\;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.15e+182)
     (* x y)
     (if (<= (* x y) -3.5e-36)
       t_1
       (if (<= (* x y) -1.9e-55)
         (* z t)
         (if (<= (* x y) -1.05e-170)
           t_1
           (if (<= (* x y) -5e-241)
             (* z t)
             (if (<= (* x y) 6.5e+140) 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.15e+182) {
		tmp = x * y;
	} else if ((x * y) <= -3.5e-36) {
		tmp = t_1;
	} else if ((x * y) <= -1.9e-55) {
		tmp = z * t;
	} else if ((x * y) <= -1.05e-170) {
		tmp = t_1;
	} else if ((x * y) <= -5e-241) {
		tmp = z * t;
	} else if ((x * y) <= 6.5e+140) {
		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.15d+182)) then
        tmp = x * y
    else if ((x * y) <= (-3.5d-36)) then
        tmp = t_1
    else if ((x * y) <= (-1.9d-55)) then
        tmp = z * t
    else if ((x * y) <= (-1.05d-170)) then
        tmp = t_1
    else if ((x * y) <= (-5d-241)) then
        tmp = z * t
    else if ((x * y) <= 6.5d+140) 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.15e+182) {
		tmp = x * y;
	} else if ((x * y) <= -3.5e-36) {
		tmp = t_1;
	} else if ((x * y) <= -1.9e-55) {
		tmp = z * t;
	} else if ((x * y) <= -1.05e-170) {
		tmp = t_1;
	} else if ((x * y) <= -5e-241) {
		tmp = z * t;
	} else if ((x * y) <= 6.5e+140) {
		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.15e+182:
		tmp = x * y
	elif (x * y) <= -3.5e-36:
		tmp = t_1
	elif (x * y) <= -1.9e-55:
		tmp = z * t
	elif (x * y) <= -1.05e-170:
		tmp = t_1
	elif (x * y) <= -5e-241:
		tmp = z * t
	elif (x * y) <= 6.5e+140:
		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.15e+182)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -3.5e-36)
		tmp = t_1;
	elseif (Float64(x * y) <= -1.9e-55)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= -1.05e-170)
		tmp = t_1;
	elseif (Float64(x * y) <= -5e-241)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 6.5e+140)
		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.15e+182)
		tmp = x * y;
	elseif ((x * y) <= -3.5e-36)
		tmp = t_1;
	elseif ((x * y) <= -1.9e-55)
		tmp = z * t;
	elseif ((x * y) <= -1.05e-170)
		tmp = t_1;
	elseif ((x * y) <= -5e-241)
		tmp = z * t;
	elseif ((x * y) <= 6.5e+140)
		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.15e+182], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e-36], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.9e-55], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.05e-170], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-241], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+140], 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.15 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y\\

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

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

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

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

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

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


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

    1. Initial program 94.3%

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

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

    if -1.15e182 < (*.f64 x y) < -3.5e-36 or -1.8999999999999998e-55 < (*.f64 x y) < -1.05e-170 or -4.9999999999999998e-241 < (*.f64 x y) < 6.4999999999999999e140

    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 y around inf 84.6%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*81.0%

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

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

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

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

    if -3.5e-36 < (*.f64 x y) < -1.8999999999999998e-55 or -1.05e-170 < (*.f64 x y) < -4.9999999999999998e-241

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{-36}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -1.9 \cdot 10^{-55}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-170}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-241}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+140}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 65.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + x \cdot y\\ t_2 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+182}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-176}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{-114}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 200000:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* x y))) (t_2 (+ (* a b) (* z t))))
   (if (<= (* x y) -8.5e+182)
     t_1
     (if (<= (* x y) -2.45e-85)
       (+ (* c i) (* z t))
       (if (<= (* x y) 1.4e-176)
         t_2
         (if (<= (* x y) 1.7e-114)
           (+ (* a b) (* c i))
           (if (<= (* x y) 200000.0) t_2 t_1)))))))
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);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -8.5e+182) {
		tmp = t_1;
	} else if ((x * y) <= -2.45e-85) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 1.4e-176) {
		tmp = t_2;
	} else if ((x * y) <= 1.7e-114) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 200000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (x * y)
    t_2 = (a * b) + (z * t)
    if ((x * y) <= (-8.5d+182)) then
        tmp = t_1
    else if ((x * y) <= (-2.45d-85)) then
        tmp = (c * i) + (z * t)
    else if ((x * y) <= 1.4d-176) then
        tmp = t_2
    else if ((x * y) <= 1.7d-114) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 200000.0d0) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (x * y);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if ((x * y) <= -8.5e+182) {
		tmp = t_1;
	} else if ((x * y) <= -2.45e-85) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 1.4e-176) {
		tmp = t_2;
	} else if ((x * y) <= 1.7e-114) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 200000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (x * y)
	t_2 = (a * b) + (z * t)
	tmp = 0
	if (x * y) <= -8.5e+182:
		tmp = t_1
	elif (x * y) <= -2.45e-85:
		tmp = (c * i) + (z * t)
	elif (x * y) <= 1.4e-176:
		tmp = t_2
	elif (x * y) <= 1.7e-114:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 200000.0:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(x * y))
	t_2 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -8.5e+182)
		tmp = t_1;
	elseif (Float64(x * y) <= -2.45e-85)
		tmp = Float64(Float64(c * i) + Float64(z * t));
	elseif (Float64(x * y) <= 1.4e-176)
		tmp = t_2;
	elseif (Float64(x * y) <= 1.7e-114)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 200000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (x * y);
	t_2 = (a * b) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -8.5e+182)
		tmp = t_1;
	elseif ((x * y) <= -2.45e-85)
		tmp = (c * i) + (z * t);
	elseif ((x * y) <= 1.4e-176)
		tmp = t_2;
	elseif ((x * y) <= 1.7e-114)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 200000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+182], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.45e-85], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-176], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.7e-114], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200000.0], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b + x \cdot y\\
t_2 := a \cdot b + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+182}:\\
\;\;\;\;t\_1\\

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

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

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

\mathbf{elif}\;x \cdot y \leq 200000:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -8.5e182 or 2e5 < (*.f64 x y)

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

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

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

    if -8.5e182 < (*.f64 x y) < -2.45000000000000007e-85

    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 y around inf 96.6%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*96.6%

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

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

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

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

    if -2.45000000000000007e-85 < (*.f64 x y) < 1.4000000000000001e-176 or 1.69999999999999991e-114 < (*.f64 x y) < 2e5

    1. Initial program 95.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 0 92.8%

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

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

    if 1.4000000000000001e-176 < (*.f64 x y) < 1.69999999999999991e-114

    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 y around inf 89.1%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*78.0%

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

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
  3. Recombined 4 regimes into one program.
  4. Final simplification75.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+182}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-176}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{-114}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 200000:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+185}:\\ \;\;\;\;y \cdot \left(x + \frac{a \cdot b}{y}\right)\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 10^{-176}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{-115}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 200:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* z t))))
   (if (<= (* x y) -5e+185)
     (* y (+ x (/ (* a b) y)))
     (if (<= (* x y) -5e-85)
       (+ (* c i) (* z t))
       (if (<= (* x y) 1e-176)
         t_1
         (if (<= (* x y) 4e-115)
           (+ (* a b) (* c i))
           (if (<= (* x y) 200.0) t_1 (+ (* a b) (* 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) + (z * t);
	double tmp;
	if ((x * y) <= -5e+185) {
		tmp = y * (x + ((a * b) / y));
	} else if ((x * y) <= -5e-85) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 1e-176) {
		tmp = t_1;
	} else if ((x * y) <= 4e-115) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 200.0) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (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) + (z * t)
    if ((x * y) <= (-5d+185)) then
        tmp = y * (x + ((a * b) / y))
    else if ((x * y) <= (-5d-85)) then
        tmp = (c * i) + (z * t)
    else if ((x * y) <= 1d-176) then
        tmp = t_1
    else if ((x * y) <= 4d-115) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 200.0d0) then
        tmp = t_1
    else
        tmp = (a * b) + (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) + (z * t);
	double tmp;
	if ((x * y) <= -5e+185) {
		tmp = y * (x + ((a * b) / y));
	} else if ((x * y) <= -5e-85) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 1e-176) {
		tmp = t_1;
	} else if ((x * y) <= 4e-115) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 200.0) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	tmp = 0
	if (x * y) <= -5e+185:
		tmp = y * (x + ((a * b) / y))
	elif (x * y) <= -5e-85:
		tmp = (c * i) + (z * t)
	elif (x * y) <= 1e-176:
		tmp = t_1
	elif (x * y) <= 4e-115:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 200.0:
		tmp = t_1
	else:
		tmp = (a * b) + (x * y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -5e+185)
		tmp = Float64(y * Float64(x + Float64(Float64(a * b) / y)));
	elseif (Float64(x * y) <= -5e-85)
		tmp = Float64(Float64(c * i) + Float64(z * t));
	elseif (Float64(x * y) <= 1e-176)
		tmp = t_1;
	elseif (Float64(x * y) <= 4e-115)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 200.0)
		tmp = t_1;
	else
		tmp = Float64(Float64(a * b) + Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -5e+185)
		tmp = y * (x + ((a * b) / y));
	elseif ((x * y) <= -5e-85)
		tmp = (c * i) + (z * t);
	elseif ((x * y) <= 1e-176)
		tmp = t_1;
	elseif ((x * y) <= 4e-115)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 200.0)
		tmp = t_1;
	else
		tmp = (a * b) + (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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+185], N[(y * N[(x + N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e-85], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-176], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4e-115], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 200.0], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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

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

\mathbf{elif}\;x \cdot y \leq 200:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\


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

    1. Initial program 87.5%

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

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

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
    5. Taylor expanded in y around inf 84.0%

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

    if -4.9999999999999999e185 < (*.f64 x y) < -5.0000000000000002e-85

    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 y around inf 96.6%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*96.6%

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

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

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

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

    if -5.0000000000000002e-85 < (*.f64 x y) < 1e-176 or 4.0000000000000002e-115 < (*.f64 x y) < 200

    1. Initial program 95.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 0 92.8%

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

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

    if 1e-176 < (*.f64 x y) < 4.0000000000000002e-115

    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 y around inf 89.1%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*78.0%

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

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

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

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

    if 200 < (*.f64 x y)

    1. Initial program 97.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 0 89.3%

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

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

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

Alternative 7: 65.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ t_2 := a \cdot b + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+52}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{-173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-114}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2100000:\\ \;\;\;\;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 (+ (* a b) (* x y))))
   (if (<= (* x y) -9e+52)
     t_2
     (if (<= (* x y) 5.8e-173)
       t_1
       (if (<= (* x y) 2.7e-114)
         (+ (* a b) (* c i))
         (if (<= (* x y) 2100000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -9e+52) {
		tmp = t_2;
	} else if ((x * y) <= 5.8e-173) {
		tmp = t_1;
	} else if ((x * y) <= 2.7e-114) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 2100000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (a * b) + (x * y)
    if ((x * y) <= (-9d+52)) then
        tmp = t_2
    else if ((x * y) <= 5.8d-173) then
        tmp = t_1
    else if ((x * y) <= 2.7d-114) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 2100000.0d0) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -9e+52) {
		tmp = t_2;
	} else if ((x * y) <= 5.8e-173) {
		tmp = t_1;
	} else if ((x * y) <= 2.7e-114) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 2100000.0) {
		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 = (a * b) + (x * y)
	tmp = 0
	if (x * y) <= -9e+52:
		tmp = t_2
	elif (x * y) <= 5.8e-173:
		tmp = t_1
	elif (x * y) <= 2.7e-114:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 2100000.0:
		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(a * b) + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -9e+52)
		tmp = t_2;
	elseif (Float64(x * y) <= 5.8e-173)
		tmp = t_1;
	elseif (Float64(x * y) <= 2.7e-114)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 2100000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (z * t);
	t_2 = (a * b) + (x * y);
	tmp = 0.0;
	if ((x * y) <= -9e+52)
		tmp = t_2;
	elseif ((x * y) <= 5.8e-173)
		tmp = t_1;
	elseif ((x * y) <= 2.7e-114)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 2100000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9e+52], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.8e-173], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2.7e-114], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2100000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;x \cdot y \leq 2100000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -8.9999999999999999e52 or 2.1e6 < (*.f64 x y)

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

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

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

    if -8.9999999999999999e52 < (*.f64 x y) < 5.7999999999999997e-173 or 2.7e-114 < (*.f64 x y) < 2.1e6

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

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

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

    if 5.7999999999999997e-173 < (*.f64 x y) < 2.7e-114

    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 y around inf 89.1%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*78.0%

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

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+52}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 5.8 \cdot 10^{-173}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-114}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2100000:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 97.6% 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}:\\ \;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\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 (* z (+ t (/ (* a b) z))))))
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 = z * (t + ((a * b) / z));
	}
	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 = z * (t + ((a * b) / z));
	}
	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 = z * (t + ((a * b) / z))
	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(z * Float64(t + Float64(Float64(a * b) / z)));
	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 = z * (t + ((a * b) / z));
	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[(z * N[(t + N[(N[(a * b), $MachinePrecision] / z), $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}:\\
\;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\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 x around 0 33.3%

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

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

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

    \[\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}:\\ \;\;\;\;z \cdot \left(t + \frac{a \cdot b}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 42.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+152}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -5.8 \cdot 10^{+29}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-224}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+97}:\\ \;\;\;\;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) -6e+152)
   (* c i)
   (if (<= (* c i) -5.8e+29)
     (* z t)
     (if (<= (* c i) 6.6e-224)
       (* a b)
       (if (<= (* c i) 2.4e+97) (* 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) <= -6e+152) {
		tmp = c * i;
	} else if ((c * i) <= -5.8e+29) {
		tmp = z * t;
	} else if ((c * i) <= 6.6e-224) {
		tmp = a * b;
	} else if ((c * i) <= 2.4e+97) {
		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) <= (-6d+152)) then
        tmp = c * i
    else if ((c * i) <= (-5.8d+29)) then
        tmp = z * t
    else if ((c * i) <= 6.6d-224) then
        tmp = a * b
    else if ((c * i) <= 2.4d+97) 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) <= -6e+152) {
		tmp = c * i;
	} else if ((c * i) <= -5.8e+29) {
		tmp = z * t;
	} else if ((c * i) <= 6.6e-224) {
		tmp = a * b;
	} else if ((c * i) <= 2.4e+97) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -6e+152:
		tmp = c * i
	elif (c * i) <= -5.8e+29:
		tmp = z * t
	elif (c * i) <= 6.6e-224:
		tmp = a * b
	elif (c * i) <= 2.4e+97:
		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) <= -6e+152)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -5.8e+29)
		tmp = Float64(z * t);
	elseif (Float64(c * i) <= 6.6e-224)
		tmp = Float64(a * b);
	elseif (Float64(c * i) <= 2.4e+97)
		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) <= -6e+152)
		tmp = c * i;
	elseif ((c * i) <= -5.8e+29)
		tmp = z * t;
	elseif ((c * i) <= 6.6e-224)
		tmp = a * b;
	elseif ((c * i) <= 2.4e+97)
		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], -6e+152], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5.8e+29], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.6e-224], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.4e+97], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -5.8 \cdot 10^{+29}:\\
\;\;\;\;z \cdot t\\

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

\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+97}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -5.99999999999999981e152 or 2.4e97 < (*.f64 c i)

    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 c around inf 67.0%

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

    if -5.99999999999999981e152 < (*.f64 c i) < -5.7999999999999999e29 or 6.6000000000000003e-224 < (*.f64 c i) < 2.4e97

    1. Initial program 98.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 inf 39.9%

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

    if -5.7999999999999999e29 < (*.f64 c i) < 6.6000000000000003e-224

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+152}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -5.8 \cdot 10^{+29}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-224}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+97}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 87.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+62} \lor \neg \left(x \cdot y \leq 200\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -5.00000000000000029e62 or 200 < (*.f64 x y)

    1. Initial program 95.5%

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

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

    if -5.00000000000000029e62 < (*.f64 x y) < 200

    1. Initial program 97.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 94.6%

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

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

Alternative 11: 85.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+185}:\\
\;\;\;\;y \cdot \left(x + \frac{a \cdot b}{y}\right)\\

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

\mathbf{else}:\\
\;\;\;\;a \cdot b + x \cdot y\\


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

    1. Initial program 87.5%

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

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

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
    5. Taylor expanded in y around inf 84.0%

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

    if -4.9999999999999999e185 < (*.f64 x y) < 2.00000000000000007e121

    1. Initial program 97.3%

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

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

    if 2.00000000000000007e121 < (*.f64 x y)

    1. Initial program 97.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 0 93.8%

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

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.9%

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

Alternative 12: 87.7% accurate, 0.6× speedup?

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

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

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

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


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

    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 y around inf 95.1%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*95.1%

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

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

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

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

    if -5.00000000000000029e62 < (*.f64 x y) < 200

    1. Initial program 97.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 94.6%

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

    if 200 < (*.f64 x y)

    1. Initial program 97.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 0 89.3%

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

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

Alternative 13: 65.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+153} \lor \neg \left(c \cdot i \leq 1.2 \cdot 10^{+95}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -1.39999999999999993e153 or 1.2e95 < (*.f64 c i)

    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 y around inf 82.9%

      \[\leadsto \color{blue}{y \cdot \left(x + \left(\frac{a \cdot b}{y} + \frac{t \cdot z}{y}\right)\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. associate-/l*80.4%

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

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

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

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

    if -1.39999999999999993e153 < (*.f64 c i) < 1.2e95

    1. Initial program 99.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 69.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+153} \lor \neg \left(c \cdot i \leq 1.2 \cdot 10^{+95}\right):\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 42.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 1.58 \cdot 10^{+118}\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) < -9.9999999999999994e38 or 1.58000000000000002e118 < (*.f64 c i)

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

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

    if -9.9999999999999994e38 < (*.f64 c i) < 1.58000000000000002e118

    1. Initial program 99.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 39.4%

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

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

Alternative 15: 27.4% 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 96.5%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Final simplification30.6%

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

Reproduce

?
herbie shell --seed 2024078 
(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)))