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

Percentage Accurate: 95.5% → 98.0%
Time: 10.4s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 95.5% 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.0% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) + c \cdot i \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t + c \cdot \frac{i}{z}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (+ (+ (* a b) (+ (* x y) (* z t))) (* c i)) INFINITY)
   (fma c i (fma a b (fma x y (* z t))))
   (* z (+ t (* c (/ i z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((((a * b) + ((x * y) + (z * t))) + (c * i)) <= ((double) INFINITY)) {
		tmp = fma(c, i, fma(a, b, fma(x, y, (z * t))));
	} else {
		tmp = z * (t + (c * (i / z)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))) + Float64(c * i)) <= Inf)
		tmp = fma(c, i, fma(a, b, fma(x, y, Float64(z * t))));
	else
		tmp = Float64(z * Float64(t + Float64(c * Float64(i / z))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t + N[(c * N[(i / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t + c \cdot \frac{i}{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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
    4. Taylor expanded in z around inf 61.6%

      \[\leadsto \color{blue}{z \cdot \left(t + \frac{c \cdot i}{z}\right)} \]
    5. Step-by-step derivation
      1. associate-/l*77.0%

        \[\leadsto z \cdot \left(t + \color{blue}{c \cdot \frac{i}{z}}\right) \]
    6. Simplified77.0%

      \[\leadsto \color{blue}{z \cdot \left(t + c \cdot \frac{i}{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:\\ \;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t + c \cdot \frac{i}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 63.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -4.9999999999999999e23

    1. Initial program 90.6%

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

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

    if -4.9999999999999999e23 < (*.f64 a b) < -1.0000000000000001e-33 or 9.99999999999999943e-158 < (*.f64 a b) < 4.99999999999999999e-15

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

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

    if -1.0000000000000001e-33 < (*.f64 a b) < 9.99999999999999943e-158

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

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

    if 4.99999999999999999e-15 < (*.f64 a b)

    1. Initial program 94.1%

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

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

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

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

Alternative 3: 64.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ t_2 := x \cdot \left(y + \frac{a \cdot b}{x}\right)\\ \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-23}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-294}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-297}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+112}:\\ \;\;\;\;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) (* c i))) (t_2 (* x (+ y (/ (* a b) x)))))
   (if (<= (* x y) -4e-23)
     t_2
     (if (<= (* x y) -1e-294)
       t_1
       (if (<= (* x y) 5e-297)
         (+ (* c i) (* z t))
         (if (<= (* x y) 2e+112) 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) + (c * i);
	double t_2 = x * (y + ((a * b) / x));
	double tmp;
	if ((x * y) <= -4e-23) {
		tmp = t_2;
	} else if ((x * y) <= -1e-294) {
		tmp = t_1;
	} else if ((x * y) <= 5e-297) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 2e+112) {
		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) + (c * i)
    t_2 = x * (y + ((a * b) / x))
    if ((x * y) <= (-4d-23)) then
        tmp = t_2
    else if ((x * y) <= (-1d-294)) then
        tmp = t_1
    else if ((x * y) <= 5d-297) then
        tmp = (c * i) + (z * t)
    else if ((x * y) <= 2d+112) 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) + (c * i);
	double t_2 = x * (y + ((a * b) / x));
	double tmp;
	if ((x * y) <= -4e-23) {
		tmp = t_2;
	} else if ((x * y) <= -1e-294) {
		tmp = t_1;
	} else if ((x * y) <= 5e-297) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 2e+112) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	t_2 = x * (y + ((a * b) / x))
	tmp = 0
	if (x * y) <= -4e-23:
		tmp = t_2
	elif (x * y) <= -1e-294:
		tmp = t_1
	elif (x * y) <= 5e-297:
		tmp = (c * i) + (z * t)
	elif (x * y) <= 2e+112:
		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(c * i))
	t_2 = Float64(x * Float64(y + Float64(Float64(a * b) / x)))
	tmp = 0.0
	if (Float64(x * y) <= -4e-23)
		tmp = t_2;
	elseif (Float64(x * y) <= -1e-294)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-297)
		tmp = Float64(Float64(c * i) + Float64(z * t));
	elseif (Float64(x * y) <= 2e+112)
		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) + (c * i);
	t_2 = x * (y + ((a * b) / x));
	tmp = 0.0;
	if ((x * y) <= -4e-23)
		tmp = t_2;
	elseif ((x * y) <= -1e-294)
		tmp = t_1;
	elseif ((x * y) <= 5e-297)
		tmp = (c * i) + (z * t);
	elseif ((x * y) <= 2e+112)
		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[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4e-23], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1e-294], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-297], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+112], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -3.99999999999999984e-23 or 1.9999999999999999e112 < (*.f64 x y)

    1. Initial program 94.2%

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

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

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

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

    if -3.99999999999999984e-23 < (*.f64 x y) < -1.00000000000000002e-294 or 5e-297 < (*.f64 x y) < 1.9999999999999999e112

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

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

    if -1.00000000000000002e-294 < (*.f64 x y) < 5e-297

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

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

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

Alternative 4: 63.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -4 \cdot 10^{-23}:\\ \;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-294}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-297}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t + \frac{x \cdot y}{z}\right)\\ \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) -4e-23)
     (* x (+ y (/ (* a b) x)))
     (if (<= (* x y) -1e-294)
       t_1
       (if (<= (* x y) 5e-297)
         (+ (* c i) (* z t))
         (if (<= (* x y) 5e+108) t_1 (* z (+ t (/ (* x y) z)))))))))
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) <= -4e-23) {
		tmp = x * (y + ((a * b) / x));
	} else if ((x * y) <= -1e-294) {
		tmp = t_1;
	} else if ((x * y) <= 5e-297) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 5e+108) {
		tmp = t_1;
	} else {
		tmp = z * (t + ((x * y) / z));
	}
	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) <= (-4d-23)) then
        tmp = x * (y + ((a * b) / x))
    else if ((x * y) <= (-1d-294)) then
        tmp = t_1
    else if ((x * y) <= 5d-297) then
        tmp = (c * i) + (z * t)
    else if ((x * y) <= 5d+108) then
        tmp = t_1
    else
        tmp = z * (t + ((x * y) / z))
    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) <= -4e-23) {
		tmp = x * (y + ((a * b) / x));
	} else if ((x * y) <= -1e-294) {
		tmp = t_1;
	} else if ((x * y) <= 5e-297) {
		tmp = (c * i) + (z * t);
	} else if ((x * y) <= 5e+108) {
		tmp = t_1;
	} else {
		tmp = z * (t + ((x * y) / z));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -4e-23:
		tmp = x * (y + ((a * b) / x))
	elif (x * y) <= -1e-294:
		tmp = t_1
	elif (x * y) <= 5e-297:
		tmp = (c * i) + (z * t)
	elif (x * y) <= 5e+108:
		tmp = t_1
	else:
		tmp = z * (t + ((x * y) / z))
	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) <= -4e-23)
		tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x)));
	elseif (Float64(x * y) <= -1e-294)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-297)
		tmp = Float64(Float64(c * i) + Float64(z * t));
	elseif (Float64(x * y) <= 5e+108)
		tmp = t_1;
	else
		tmp = Float64(z * Float64(t + Float64(Float64(x * y) / z)));
	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) <= -4e-23)
		tmp = x * (y + ((a * b) / x));
	elseif ((x * y) <= -1e-294)
		tmp = t_1;
	elseif ((x * y) <= 5e-297)
		tmp = (c * i) + (z * t);
	elseif ((x * y) <= 5e+108)
		tmp = t_1;
	else
		tmp = z * (t + ((x * y) / z));
	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], -4e-23], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-294], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-297], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+108], t$95$1, N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

    if -3.99999999999999984e-23 < (*.f64 x y) < -1.00000000000000002e-294 or 5e-297 < (*.f64 x y) < 4.99999999999999991e108

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

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

    if -1.00000000000000002e-294 < (*.f64 x y) < 5e-297

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

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

    if 4.99999999999999991e108 < (*.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 inf 85.0%

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

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

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

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

Alternative 5: 65.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -4.9999999999999999e23 or 4.99999999999999999e-15 < (*.f64 a b)

    1. Initial program 92.4%

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

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

    if -4.9999999999999999e23 < (*.f64 a b) < -1.0000000000000001e-33 or 9.99999999999999943e-158 < (*.f64 a b) < 4.99999999999999999e-15

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

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

    if -1.0000000000000001e-33 < (*.f64 a b) < 9.99999999999999943e-158

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+23}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-33}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 10^{-157}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-15}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 98.0% 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 + c \cdot \frac{i}{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 (* c (/ i 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 + (c * (i / 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 + (c * (i / 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 + (c * (i / 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(c * Float64(i / 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 + (c * (i / 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[(c * N[(i / z), $MachinePrecision]), $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 + c \cdot \frac{i}{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 z around inf 61.6%

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
    4. Taylor expanded in z around inf 61.6%

      \[\leadsto \color{blue}{z \cdot \left(t + \frac{c \cdot i}{z}\right)} \]
    5. Step-by-step derivation
      1. associate-/l*77.0%

        \[\leadsto z \cdot \left(t + \color{blue}{c \cdot \frac{i}{z}}\right) \]
    6. Simplified77.0%

      \[\leadsto \color{blue}{z \cdot \left(t + c \cdot \frac{i}{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 + c \cdot \frac{i}{z}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 85.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+119} \lor \neg \left(x \cdot y \leq 10^{+173}\right):\\ \;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\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+119) (not (<= (* x y) 1e+173)))
   (* x (+ y (/ (* a b) x)))
   (+ (* 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+119) || !((x * y) <= 1e+173)) {
		tmp = x * (y + ((a * b) / x));
	} 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+119)) .or. (.not. ((x * y) <= 1d+173))) then
        tmp = x * (y + ((a * b) / x))
    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+119) || !((x * y) <= 1e+173)) {
		tmp = x * (y + ((a * b) / x));
	} 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+119) or not ((x * y) <= 1e+173):
		tmp = x * (y + ((a * b) / x))
	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+119) || !(Float64(x * y) <= 1e+173))
		tmp = Float64(x * Float64(y + Float64(Float64(a * b) / x)));
	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+119) || ~(((x * y) <= 1e+173)))
		tmp = x * (y + ((a * b) / x));
	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+119], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+173]], $MachinePrecision]], N[(x * N[(y + N[(N[(a * b), $MachinePrecision] / x), $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^{+119} \lor \neg \left(x \cdot y \leq 10^{+173}\right):\\
\;\;\;\;x \cdot \left(y + \frac{a \cdot b}{x}\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) < -4.9999999999999999e119 or 1e173 < (*.f64 x y)

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

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

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

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

    if -4.9999999999999999e119 < (*.f64 x y) < 1e173

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

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

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

Alternative 8: 86.3% accurate, 0.6× speedup?

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

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

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

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


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

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

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

    if -4.9999999999999999e119 < (*.f64 x y) < 1e173

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

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

    if 1e173 < (*.f64 x y)

    1. Initial program 94.4%

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

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

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

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

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

Alternative 9: 87.7% accurate, 0.6× speedup?

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

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

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

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


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

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

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

    if -4.9999999999999999e119 < (*.f64 x y) < 4.99999999999999991e108

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

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

    if 4.99999999999999991e108 < (*.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 a around 0 88.9%

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

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

Alternative 10: 87.8% accurate, 0.6× speedup?

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

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

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

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


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

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

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

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

    if -4.9999999999999999e119 < (*.f64 x y) < 4.99999999999999991e108

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

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

    if 4.99999999999999991e108 < (*.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 a around 0 88.9%

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

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

Alternative 11: 66.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -36000000 \lor \neg \left(a \cdot b \leq 5.6 \cdot 10^{+36}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -3.6e7 or 5.6000000000000001e36 < (*.f64 a b)

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

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

    if -3.6e7 < (*.f64 a b) < 5.6000000000000001e36

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

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

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

Alternative 12: 41.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+248} \lor \neg \left(c \cdot i \leq 1.76 \cdot 10^{+146}\right):\\
\;\;\;\;c \cdot i\\

\mathbf{else}:\\
\;\;\;\;z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.8999999999999999e248 or 1.76000000000000007e146 < (*.f64 c i)

    1. Initial program 87.1%

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

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

    if -3.8999999999999999e248 < (*.f64 c i) < 1.76000000000000007e146

    1. Initial program 97.4%

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
    4. Taylor expanded in z around inf 35.9%

      \[\leadsto \color{blue}{z \cdot \left(t + \frac{c \cdot i}{z}\right)} \]
    5. Step-by-step derivation
      1. associate-/l*36.4%

        \[\leadsto z \cdot \left(t + \color{blue}{c \cdot \frac{i}{z}}\right) \]
    6. Simplified36.4%

      \[\leadsto \color{blue}{z \cdot \left(t + c \cdot \frac{i}{z}\right)} \]
    7. Step-by-step derivation
      1. clear-num36.3%

        \[\leadsto z \cdot \left(t + c \cdot \color{blue}{\frac{1}{\frac{z}{i}}}\right) \]
      2. un-div-inv35.8%

        \[\leadsto z \cdot \left(t + \color{blue}{\frac{c}{\frac{z}{i}}}\right) \]
    8. Applied egg-rr35.8%

      \[\leadsto z \cdot \left(t + \color{blue}{\frac{c}{\frac{z}{i}}}\right) \]
    9. Taylor expanded in z around inf 31.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.9 \cdot 10^{+248} \lor \neg \left(c \cdot i \leq 1.76 \cdot 10^{+146}\right):\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 53.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{else}:\\
\;\;\;\;z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.45e236

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

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

    if 1.45e236 < t

    1. Initial program 93.3%

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

      \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
    4. Taylor expanded in z around inf 68.9%

      \[\leadsto \color{blue}{z \cdot \left(t + \frac{c \cdot i}{z}\right)} \]
    5. Step-by-step derivation
      1. associate-/l*68.9%

        \[\leadsto z \cdot \left(t + \color{blue}{c \cdot \frac{i}{z}}\right) \]
    6. Simplified68.9%

      \[\leadsto \color{blue}{z \cdot \left(t + c \cdot \frac{i}{z}\right)} \]
    7. Step-by-step derivation
      1. clear-num68.9%

        \[\leadsto z \cdot \left(t + c \cdot \color{blue}{\frac{1}{\frac{z}{i}}}\right) \]
      2. un-div-inv68.9%

        \[\leadsto z \cdot \left(t + \color{blue}{\frac{c}{\frac{z}{i}}}\right) \]
    8. Applied egg-rr68.9%

      \[\leadsto z \cdot \left(t + \color{blue}{\frac{c}{\frac{z}{i}}}\right) \]
    9. Taylor expanded in z around inf 62.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.45 \cdot 10^{+236}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 27.0% accurate, 5.0× speedup?

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

\\
c \cdot i
\end{array}
Derivation
  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 24.2%

    \[\leadsto \color{blue}{c \cdot i} \]
  4. Final simplification24.2%

    \[\leadsto c \cdot i \]
  5. Add Preprocessing

Reproduce

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