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

Percentage Accurate: 95.7% → 98.3%
Time: 10.9s
Alternatives: 16
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 16 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: 98.3% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \left(a \cdot \frac{b}{x} + c \cdot \frac{i}{x}\right)\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 inf 18.2%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.0% 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 95.7%

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

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

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

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

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

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

    \[\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. Add Preprocessing

Alternative 3: 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 95.7%

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

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

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

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

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

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

    \[\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. Add Preprocessing

Alternative 4: 64.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+206}:\\ \;\;\;\;i \cdot \left(c + \frac{a \cdot b}{i}\right)\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{+70}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-309}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 400000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq 10^{+30}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* x y) (* z t))))
   (if (<= (* c i) -1e+206)
     (* i (+ c (/ (* a b) i)))
     (if (<= (* c i) -2e+70)
       t_2
       (if (<= (* c i) -5e-25)
         t_1
         (if (<= (* c i) -1e-309)
           (+ (* a b) (* z t))
           (if (<= (* c i) 400000000.0)
             t_2
             (if (<= (* c i) 1e+30) t_1 (+ (* c i) (* z t))))))))))
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 = (x * y) + (z * t);
	double tmp;
	if ((c * i) <= -1e+206) {
		tmp = i * (c + ((a * b) / i));
	} else if ((c * i) <= -2e+70) {
		tmp = t_2;
	} else if ((c * i) <= -5e-25) {
		tmp = t_1;
	} else if ((c * i) <= -1e-309) {
		tmp = (a * b) + (z * t);
	} else if ((c * i) <= 400000000.0) {
		tmp = t_2;
	} else if ((c * i) <= 1e+30) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    t_2 = (x * y) + (z * t)
    if ((c * i) <= (-1d+206)) then
        tmp = i * (c + ((a * b) / i))
    else if ((c * i) <= (-2d+70)) then
        tmp = t_2
    else if ((c * i) <= (-5d-25)) then
        tmp = t_1
    else if ((c * i) <= (-1d-309)) then
        tmp = (a * b) + (z * t)
    else if ((c * i) <= 400000000.0d0) then
        tmp = t_2
    else if ((c * i) <= 1d+30) then
        tmp = t_1
    else
        tmp = (c * i) + (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 t_1 = (a * b) + (c * i);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((c * i) <= -1e+206) {
		tmp = i * (c + ((a * b) / i));
	} else if ((c * i) <= -2e+70) {
		tmp = t_2;
	} else if ((c * i) <= -5e-25) {
		tmp = t_1;
	} else if ((c * i) <= -1e-309) {
		tmp = (a * b) + (z * t);
	} else if ((c * i) <= 400000000.0) {
		tmp = t_2;
	} else if ((c * i) <= 1e+30) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	t_2 = (x * y) + (z * t)
	tmp = 0
	if (c * i) <= -1e+206:
		tmp = i * (c + ((a * b) / i))
	elif (c * i) <= -2e+70:
		tmp = t_2
	elif (c * i) <= -5e-25:
		tmp = t_1
	elif (c * i) <= -1e-309:
		tmp = (a * b) + (z * t)
	elif (c * i) <= 400000000.0:
		tmp = t_2
	elif (c * i) <= 1e+30:
		tmp = t_1
	else:
		tmp = (c * i) + (z * t)
	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(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= -1e+206)
		tmp = Float64(i * Float64(c + Float64(Float64(a * b) / i)));
	elseif (Float64(c * i) <= -2e+70)
		tmp = t_2;
	elseif (Float64(c * i) <= -5e-25)
		tmp = t_1;
	elseif (Float64(c * i) <= -1e-309)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif (Float64(c * i) <= 400000000.0)
		tmp = t_2;
	elseif (Float64(c * i) <= 1e+30)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (c * i);
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -1e+206)
		tmp = i * (c + ((a * b) / i));
	elseif ((c * i) <= -2e+70)
		tmp = t_2;
	elseif ((c * i) <= -5e-25)
		tmp = t_1;
	elseif ((c * i) <= -1e-309)
		tmp = (a * b) + (z * t);
	elseif ((c * i) <= 400000000.0)
		tmp = t_2;
	elseif ((c * i) <= 1e+30)
		tmp = t_1;
	else
		tmp = (c * i) + (z * t);
	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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1e+206], N[(i * N[(c + N[(N[(a * b), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e+70], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -5e-25], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1e-309], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 400000000.0], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1e+30], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{+70}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-309}:\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 400000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq 10^{+30}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


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

    1. Initial program 89.9%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
    5. Taylor expanded in i around inf 96.7%

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

    if -1e206 < (*.f64 c i) < -2.00000000000000015e70 or -1.000000000000002e-309 < (*.f64 c i) < 4e8

    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 0 83.9%

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

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

    if -2.00000000000000015e70 < (*.f64 c i) < -4.99999999999999962e-25 or 4e8 < (*.f64 c i) < 1e30

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

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

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

    if -4.99999999999999962e-25 < (*.f64 c i) < -1.000000000000002e-309

    1. Initial program 95.9%

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

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

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

    if 1e30 < (*.f64 c i)

    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 a around 0 88.3%

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

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

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

Alternative 5: 64.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq -1.22 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq -5.5 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-309}:\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 340000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq 1.25 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -5.1999999999999998e205 or -1.22e70 < (*.f64 c i) < -5.50000000000000004e-25 or 3.4e8 < (*.f64 c i) < 1.25e30

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

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

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

    if -5.1999999999999998e205 < (*.f64 c i) < -1.22e70 or -1.000000000000002e-309 < (*.f64 c i) < 3.4e8

    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 0 83.9%

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

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

    if -5.50000000000000004e-25 < (*.f64 c i) < -1.000000000000002e-309

    1. Initial program 95.9%

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

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

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

    if 1.25e30 < (*.f64 c i)

    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 a around 0 88.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5.2 \cdot 10^{+205}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.22 \cdot 10^{+70}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -5.5 \cdot 10^{-25}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-309}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 340000000:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.25 \cdot 10^{+30}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 43.6% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;c \cdot i \leq -0.56:\\
\;\;\;\;a \cdot b\\

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

\mathbf{elif}\;c \cdot i \leq 340000000:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{+38}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -4.20000000000000019e135 or 8.2000000000000007e38 < (*.f64 c i)

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

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

    if -4.20000000000000019e135 < (*.f64 c i) < -2.00000000000000015e70 or -0.56000000000000005 < (*.f64 c i) < 7.00000000000000031e-265

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

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

    if -2.00000000000000015e70 < (*.f64 c i) < -0.56000000000000005 or 3.4e8 < (*.f64 c i) < 8.2000000000000007e38

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

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

    if 7.00000000000000031e-265 < (*.f64 c i) < 3.4e8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4.2 \cdot 10^{+135}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{+70}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -0.56:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 7 \cdot 10^{-265}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 340000000:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{+38}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+123}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq 1.02 \cdot 10^{-197}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 4.8 \cdot 10^{+35}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* z t))))
   (if (<= (* c i) -8.5e+123)
     (+ (* x y) (* c i))
     (if (<= (* c i) 6.2e-263)
       t_1
       (if (<= (* c i) 1.02e-197)
         (* x y)
         (if (<= (* c i) 4.8e+35) t_1 (+ (* c i) (* z t))))))))
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 ((c * i) <= -8.5e+123) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= 6.2e-263) {
		tmp = t_1;
	} else if ((c * i) <= 1.02e-197) {
		tmp = x * y;
	} else if ((c * i) <= 4.8e+35) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    if ((c * i) <= (-8.5d+123)) then
        tmp = (x * y) + (c * i)
    else if ((c * i) <= 6.2d-263) then
        tmp = t_1
    else if ((c * i) <= 1.02d-197) then
        tmp = x * y
    else if ((c * i) <= 4.8d+35) then
        tmp = t_1
    else
        tmp = (c * i) + (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 t_1 = (a * b) + (z * t);
	double tmp;
	if ((c * i) <= -8.5e+123) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= 6.2e-263) {
		tmp = t_1;
	} else if ((c * i) <= 1.02e-197) {
		tmp = x * y;
	} else if ((c * i) <= 4.8e+35) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	tmp = 0
	if (c * i) <= -8.5e+123:
		tmp = (x * y) + (c * i)
	elif (c * i) <= 6.2e-263:
		tmp = t_1
	elif (c * i) <= 1.02e-197:
		tmp = x * y
	elif (c * i) <= 4.8e+35:
		tmp = t_1
	else:
		tmp = (c * i) + (z * t)
	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(c * i) <= -8.5e+123)
		tmp = Float64(Float64(x * y) + Float64(c * i));
	elseif (Float64(c * i) <= 6.2e-263)
		tmp = t_1;
	elseif (Float64(c * i) <= 1.02e-197)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 4.8e+35)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(z * t));
	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 ((c * i) <= -8.5e+123)
		tmp = (x * y) + (c * i);
	elseif ((c * i) <= 6.2e-263)
		tmp = t_1;
	elseif ((c * i) <= 1.02e-197)
		tmp = x * y;
	elseif ((c * i) <= 4.8e+35)
		tmp = t_1;
	else
		tmp = (c * i) + (z * t);
	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[(c * i), $MachinePrecision], -8.5e+123], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.2e-263], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.02e-197], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.8e+35], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;c \cdot i \leq 4.8 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -8.5e123

    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 a around 0 85.8%

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

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

    if -8.5e123 < (*.f64 c i) < 6.20000000000000008e-263 or 1.0199999999999999e-197 < (*.f64 c i) < 4.80000000000000029e35

    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 c around 0 88.7%

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

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

    if 6.20000000000000008e-263 < (*.f64 c i) < 1.0199999999999999e-197

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

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

    if 4.80000000000000029e35 < (*.f64 c i)

    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 0 90.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+123}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.02 \cdot 10^{-197}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 4.8 \cdot 10^{+35}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+134}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{-201}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* z t))))
   (if (<= (* c i) -5e+134)
     (+ (* a b) (* c i))
     (if (<= (* c i) 6.2e-263)
       t_1
       (if (<= (* c i) 3.6e-201)
         (* x y)
         (if (<= (* c i) 1.9e+39) t_1 (+ (* c i) (* z t))))))))
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 ((c * i) <= -5e+134) {
		tmp = (a * b) + (c * i);
	} else if ((c * i) <= 6.2e-263) {
		tmp = t_1;
	} else if ((c * i) <= 3.6e-201) {
		tmp = x * y;
	} else if ((c * i) <= 1.9e+39) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    if ((c * i) <= (-5d+134)) then
        tmp = (a * b) + (c * i)
    else if ((c * i) <= 6.2d-263) then
        tmp = t_1
    else if ((c * i) <= 3.6d-201) then
        tmp = x * y
    else if ((c * i) <= 1.9d+39) then
        tmp = t_1
    else
        tmp = (c * i) + (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 t_1 = (a * b) + (z * t);
	double tmp;
	if ((c * i) <= -5e+134) {
		tmp = (a * b) + (c * i);
	} else if ((c * i) <= 6.2e-263) {
		tmp = t_1;
	} else if ((c * i) <= 3.6e-201) {
		tmp = x * y;
	} else if ((c * i) <= 1.9e+39) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	tmp = 0
	if (c * i) <= -5e+134:
		tmp = (a * b) + (c * i)
	elif (c * i) <= 6.2e-263:
		tmp = t_1
	elif (c * i) <= 3.6e-201:
		tmp = x * y
	elif (c * i) <= 1.9e+39:
		tmp = t_1
	else:
		tmp = (c * i) + (z * t)
	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(c * i) <= -5e+134)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(c * i) <= 6.2e-263)
		tmp = t_1;
	elseif (Float64(c * i) <= 3.6e-201)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 1.9e+39)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(z * t));
	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 ((c * i) <= -5e+134)
		tmp = (a * b) + (c * i);
	elseif ((c * i) <= 6.2e-263)
		tmp = t_1;
	elseif ((c * i) <= 3.6e-201)
		tmp = x * y;
	elseif ((c * i) <= 1.9e+39)
		tmp = t_1;
	else
		tmp = (c * i) + (z * t);
	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[(c * i), $MachinePrecision], -5e+134], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.2e-263], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 3.6e-201], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.9e+39], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+134}:\\
\;\;\;\;a \cdot b + c \cdot i\\

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

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

\mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -4.99999999999999981e134

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

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

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

    if -4.99999999999999981e134 < (*.f64 c i) < 6.20000000000000008e-263 or 3.60000000000000031e-201 < (*.f64 c i) < 1.8999999999999999e39

    1. Initial program 95.9%

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

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

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

    if 6.20000000000000008e-263 < (*.f64 c i) < 3.60000000000000031e-201

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

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

    if 1.8999999999999999e39 < (*.f64 c i)

    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 0 90.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+134}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{-201}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 1.9 \cdot 10^{+39}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 64.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ t_2 := a \cdot b + c \cdot i\\ \mathbf{if}\;c \cdot i \leq -3.3 \cdot 10^{+136}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{-265}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{-201}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 380000000:\\ \;\;\;\;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) (* c i))))
   (if (<= (* c i) -3.3e+136)
     t_2
     (if (<= (* c i) 1.5e-265)
       t_1
       (if (<= (* c i) 3.6e-201)
         (* x y)
         (if (<= (* c i) 380000000.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) + (c * i);
	double tmp;
	if ((c * i) <= -3.3e+136) {
		tmp = t_2;
	} else if ((c * i) <= 1.5e-265) {
		tmp = t_1;
	} else if ((c * i) <= 3.6e-201) {
		tmp = x * y;
	} else if ((c * i) <= 380000000.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) + (c * i)
    if ((c * i) <= (-3.3d+136)) then
        tmp = t_2
    else if ((c * i) <= 1.5d-265) then
        tmp = t_1
    else if ((c * i) <= 3.6d-201) then
        tmp = x * y
    else if ((c * i) <= 380000000.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) + (c * i);
	double tmp;
	if ((c * i) <= -3.3e+136) {
		tmp = t_2;
	} else if ((c * i) <= 1.5e-265) {
		tmp = t_1;
	} else if ((c * i) <= 3.6e-201) {
		tmp = x * y;
	} else if ((c * i) <= 380000000.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) + (c * i)
	tmp = 0
	if (c * i) <= -3.3e+136:
		tmp = t_2
	elif (c * i) <= 1.5e-265:
		tmp = t_1
	elif (c * i) <= 3.6e-201:
		tmp = x * y
	elif (c * i) <= 380000000.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(c * i))
	tmp = 0.0
	if (Float64(c * i) <= -3.3e+136)
		tmp = t_2;
	elseif (Float64(c * i) <= 1.5e-265)
		tmp = t_1;
	elseif (Float64(c * i) <= 3.6e-201)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 380000000.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) + (c * i);
	tmp = 0.0;
	if ((c * i) <= -3.3e+136)
		tmp = t_2;
	elseif ((c * i) <= 1.5e-265)
		tmp = t_1;
	elseif ((c * i) <= 3.6e-201)
		tmp = x * y;
	elseif ((c * i) <= 380000000.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[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -3.3e+136], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 1.5e-265], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 3.6e-201], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 380000000.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 + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -3.3 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;c \cdot i \leq 380000000:\\
\;\;\;\;t\_1\\

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


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

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

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

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

    if -3.29999999999999992e136 < (*.f64 c i) < 1.4999999999999999e-265 or 3.60000000000000031e-201 < (*.f64 c i) < 3.8e8

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

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

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

    if 1.4999999999999999e-265 < (*.f64 c i) < 3.60000000000000031e-201

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.3 \cdot 10^{+136}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{-265}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 3.6 \cdot 10^{-201}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 380000000:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 54.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+46}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+84}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+176}:\\ \;\;\;\;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 (<= y -1.7e+46)
     (* x y)
     (if (<= y 4.5e+50)
       t_1
       (if (<= y 9.6e+84) (* z t) (if (<= y 2.4e+176) 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 (y <= -1.7e+46) {
		tmp = x * y;
	} else if (y <= 4.5e+50) {
		tmp = t_1;
	} else if (y <= 9.6e+84) {
		tmp = z * t;
	} else if (y <= 2.4e+176) {
		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 (y <= (-1.7d+46)) then
        tmp = x * y
    else if (y <= 4.5d+50) then
        tmp = t_1
    else if (y <= 9.6d+84) then
        tmp = z * t
    else if (y <= 2.4d+176) 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 (y <= -1.7e+46) {
		tmp = x * y;
	} else if (y <= 4.5e+50) {
		tmp = t_1;
	} else if (y <= 9.6e+84) {
		tmp = z * t;
	} else if (y <= 2.4e+176) {
		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 y <= -1.7e+46:
		tmp = x * y
	elif y <= 4.5e+50:
		tmp = t_1
	elif y <= 9.6e+84:
		tmp = z * t
	elif y <= 2.4e+176:
		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 (y <= -1.7e+46)
		tmp = Float64(x * y);
	elseif (y <= 4.5e+50)
		tmp = t_1;
	elseif (y <= 9.6e+84)
		tmp = Float64(z * t);
	elseif (y <= 2.4e+176)
		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 (y <= -1.7e+46)
		tmp = x * y;
	elseif (y <= 4.5e+50)
		tmp = t_1;
	elseif (y <= 9.6e+84)
		tmp = z * t;
	elseif (y <= 2.4e+176)
		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[y, -1.7e+46], N[(x * y), $MachinePrecision], If[LessEqual[y, 4.5e+50], t$95$1, If[LessEqual[y, 9.6e+84], N[(z * t), $MachinePrecision], If[LessEqual[y, 2.4e+176], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9.6 \cdot 10^{+84}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6999999999999999e46 or 2.4000000000000001e176 < y

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

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

    if -1.6999999999999999e46 < y < 4.50000000000000014e50 or 9.5999999999999999e84 < y < 2.4000000000000001e176

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

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

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

    if 4.50000000000000014e50 < y < 9.5999999999999999e84

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+46}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+50}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{+84}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+176}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 87.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+47} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-29}\right):\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\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+47) (not (<= (* x y) 5e-29)))
   (+ (* c i) (+ (* x y) (* z t)))
   (+ (* 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+47) || !((x * y) <= 5e-29)) {
		tmp = (c * i) + ((x * y) + (z * t));
	} 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+47)) .or. (.not. ((x * y) <= 5d-29))) then
        tmp = (c * i) + ((x * y) + (z * t))
    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+47) || !((x * y) <= 5e-29)) {
		tmp = (c * i) + ((x * y) + (z * t));
	} 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+47) or not ((x * y) <= 5e-29):
		tmp = (c * i) + ((x * y) + (z * t))
	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+47) || !(Float64(x * y) <= 5e-29))
		tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t)));
	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+47) || ~(((x * y) <= 5e-29)))
		tmp = (c * i) + ((x * y) + (z * t));
	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+47], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-29]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $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^{+47} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-29}\right):\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\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.00000000000000022e47 or 4.99999999999999986e-29 < (*.f64 x y)

    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 0 86.0%

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

    if -5.00000000000000022e47 < (*.f64 x y) < 4.99999999999999986e-29

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

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

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

Alternative 12: 88.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+65} \lor \neg \left(c \cdot i \leq 400000000\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

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


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

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

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

    if -4e65 < (*.f64 c i) < 4e8

    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 c around 0 93.2%

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

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

Alternative 13: 85.0% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


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

    1. Initial program 89.9%

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

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
    5. Taylor expanded in i around inf 96.7%

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

    if -1e206 < (*.f64 c i) < 1.9999999999999999e61

    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 c around 0 87.8%

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

    if 1.9999999999999999e61 < (*.f64 c i)

    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 0 89.7%

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

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

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

Alternative 14: 36.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.55 \cdot 10^{-86}:\\
\;\;\;\;c \cdot i\\

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

\mathbf{elif}\;i \leq 1.6 \cdot 10^{+121}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -1.54999999999999994e-86 or 1.6e121 < i

    1. Initial program 95.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 inf 50.3%

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

    if -1.54999999999999994e-86 < i < 4.79999999999999998e-161

    1. Initial program 95.2%

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

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

    if 4.79999999999999998e-161 < i < 1.6e121

    1. Initial program 96.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.55 \cdot 10^{-86}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;i \leq 4.8 \cdot 10^{-161}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;i \leq 1.6 \cdot 10^{+121}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 41.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.35 \cdot 10^{-21} \lor \neg \left(a \cdot b \leq 4.5 \cdot 10^{+93}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.3500000000000001e-21 or 4.49999999999999991e93 < (*.f64 a b)

    1. Initial program 93.4%

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

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

    if -1.3500000000000001e-21 < (*.f64 a b) < 4.49999999999999991e93

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

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

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

Alternative 16: 27.0% 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 95.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 25.5%

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Add Preprocessing

Reproduce

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