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

Percentage Accurate: 96.0% → 98.1%
Time: 9.1s
Alternatives: 17
Speedup: 0.5×

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 17 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: 96.0% 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.1% 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 94.5%

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

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-def96.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-def98.0%

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

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

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

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

Alternative 2: 97.7% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


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

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

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

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

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

      \[\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. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

    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. Taylor expanded in c around 0 42.9%

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    4. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \color{blue}{t \cdot z + a \cdot b} \]
      2. *-commutative57.1%

        \[\leadsto \color{blue}{z \cdot t} + a \cdot b \]
      3. fma-def57.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
    5. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

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

Alternative 3: 97.7% accurate, 0.1× speedup?

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

\\
\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 + \mathsf{fma}\left(x, y, z \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\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. associate-+l+100.0%

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

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

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

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

        \[\leadsto \left(\color{blue}{x \cdot y} + \left(z \cdot t + a \cdot b\right)\right) + c \cdot i \]
      6. associate-+l+100.0%

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

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

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

    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. Taylor expanded in c around 0 42.9%

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    4. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \color{blue}{t \cdot z + a \cdot b} \]
      2. *-commutative57.1%

        \[\leadsto \color{blue}{z \cdot t} + a \cdot b \]
      3. fma-def57.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
    5. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.7%

    \[\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 + \mathsf{fma}\left(x, y, z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\ \end{array} \]

Alternative 4: 97.7% accurate, 0.1× 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}:\\ \;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\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 (fma z t (* a b)))))
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 = fma(z, t, (a * b));
	}
	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 = fma(z, t, Float64(a * b));
	end
	return 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[(z * t + N[(a * b), $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}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\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 \]

    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. Taylor expanded in c around 0 42.9%

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    4. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \color{blue}{t \cdot z + a \cdot b} \]
      2. *-commutative57.1%

        \[\leadsto \color{blue}{z \cdot t} + a \cdot b \]
      3. fma-def57.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
    5. Applied egg-rr57.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\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}:\\ \;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\ \end{array} \]

Alternative 5: 97.4% accurate, 0.5× 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}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \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 (+ (* a b) (* z t)))))
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 = (a * b) + (z * t);
	}
	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 = (a * b) + (z * t);
	}
	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 = (a * b) + (z * t)
	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(Float64(a * b) + Float64(z * t));
	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 = (a * b) + (z * t);
	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[(N[(a * b), $MachinePrecision] + N[(z * t), $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}:\\
\;\;\;\;a \cdot b + z \cdot t\\


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

    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. Taylor expanded in c around 0 42.9%

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

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

    \[\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}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 6: 41.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.02 \cdot 10^{+188}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -3.1 \cdot 10^{-17}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-218}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-174}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 6.2 \cdot 10^{-59}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 5.1 \cdot 10^{+203}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* a b) -1.02e+188)
   (* a b)
   (if (<= (* a b) -3.1e-17)
     (* z t)
     (if (<= (* a b) -3.4e-218)
       (* c i)
       (if (<= (* a b) 2e-174)
         (* z t)
         (if (<= (* a b) 6.2e-59)
           (* c i)
           (if (<= (* a b) 5.1e+203) (* z t) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a * b) <= -1.02e+188) {
		tmp = a * b;
	} else if ((a * b) <= -3.1e-17) {
		tmp = z * t;
	} else if ((a * b) <= -3.4e-218) {
		tmp = c * i;
	} else if ((a * b) <= 2e-174) {
		tmp = z * t;
	} else if ((a * b) <= 6.2e-59) {
		tmp = c * i;
	} else if ((a * b) <= 5.1e+203) {
		tmp = z * t;
	} else {
		tmp = a * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((a * b) <= (-1.02d+188)) then
        tmp = a * b
    else if ((a * b) <= (-3.1d-17)) then
        tmp = z * t
    else if ((a * b) <= (-3.4d-218)) then
        tmp = c * i
    else if ((a * b) <= 2d-174) then
        tmp = z * t
    else if ((a * b) <= 6.2d-59) then
        tmp = c * i
    else if ((a * b) <= 5.1d+203) then
        tmp = z * t
    else
        tmp = a * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a * b) <= -1.02e+188) {
		tmp = a * b;
	} else if ((a * b) <= -3.1e-17) {
		tmp = z * t;
	} else if ((a * b) <= -3.4e-218) {
		tmp = c * i;
	} else if ((a * b) <= 2e-174) {
		tmp = z * t;
	} else if ((a * b) <= 6.2e-59) {
		tmp = c * i;
	} else if ((a * b) <= 5.1e+203) {
		tmp = z * t;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (a * b) <= -1.02e+188:
		tmp = a * b
	elif (a * b) <= -3.1e-17:
		tmp = z * t
	elif (a * b) <= -3.4e-218:
		tmp = c * i
	elif (a * b) <= 2e-174:
		tmp = z * t
	elif (a * b) <= 6.2e-59:
		tmp = c * i
	elif (a * b) <= 5.1e+203:
		tmp = z * t
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(a * b) <= -1.02e+188)
		tmp = Float64(a * b);
	elseif (Float64(a * b) <= -3.1e-17)
		tmp = Float64(z * t);
	elseif (Float64(a * b) <= -3.4e-218)
		tmp = Float64(c * i);
	elseif (Float64(a * b) <= 2e-174)
		tmp = Float64(z * t);
	elseif (Float64(a * b) <= 6.2e-59)
		tmp = Float64(c * i);
	elseif (Float64(a * b) <= 5.1e+203)
		tmp = Float64(z * t);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((a * b) <= -1.02e+188)
		tmp = a * b;
	elseif ((a * b) <= -3.1e-17)
		tmp = z * t;
	elseif ((a * b) <= -3.4e-218)
		tmp = c * i;
	elseif ((a * b) <= 2e-174)
		tmp = z * t;
	elseif ((a * b) <= 6.2e-59)
		tmp = c * i;
	elseif ((a * b) <= 5.1e+203)
		tmp = z * t;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -1.02e+188], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.1e-17], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.4e-218], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2e-174], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 6.2e-59], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.1e+203], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.02 \cdot 10^{+188}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;a \cdot b \leq -3.1 \cdot 10^{-17}:\\
\;\;\;\;z \cdot t\\

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

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-174}:\\
\;\;\;\;z \cdot t\\

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

\mathbf{elif}\;a \cdot b \leq 5.1 \cdot 10^{+203}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.02e188 or 5.1000000000000002e203 < (*.f64 a b)

    1. Initial program 88.5%

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

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

    if -1.02e188 < (*.f64 a b) < -3.0999999999999998e-17 or -3.39999999999999986e-218 < (*.f64 a b) < 2e-174 or 6.19999999999999998e-59 < (*.f64 a b) < 5.1000000000000002e203

    1. Initial program 95.8%

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

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

    if -3.0999999999999998e-17 < (*.f64 a b) < -3.39999999999999986e-218 or 2e-174 < (*.f64 a b) < 6.19999999999999998e-59

    1. Initial program 98.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.02 \cdot 10^{+188}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -3.1 \cdot 10^{-17}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -3.4 \cdot 10^{-218}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-174}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 6.2 \cdot 10^{-59}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 5.1 \cdot 10^{+203}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 7: 41.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+188}:\\
\;\;\;\;a \cdot b\\

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

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

\mathbf{elif}\;a \cdot b \leq 6.4 \cdot 10^{-188}:\\
\;\;\;\;z \cdot t\\

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

\mathbf{elif}\;a \cdot b \leq 1.45 \cdot 10^{+201}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -1.09999999999999999e188 or 1.4500000000000001e201 < (*.f64 a b)

    1. Initial program 88.5%

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

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

    if -1.09999999999999999e188 < (*.f64 a b) < -3.8000000000000002e-15 or -5.8999999999999999e-217 < (*.f64 a b) < 6.40000000000000044e-188 or 4.49999999999999976e-91 < (*.f64 a b) < 1.4500000000000001e201

    1. Initial program 95.9%

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

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

    if -3.8000000000000002e-15 < (*.f64 a b) < -5.8999999999999999e-217

    1. Initial program 100.0%

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

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

    if 6.40000000000000044e-188 < (*.f64 a b) < 4.49999999999999976e-91

    1. Initial program 93.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.1 \cdot 10^{+188}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -3.8 \cdot 10^{-15}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -5.9 \cdot 10^{-217}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 6.4 \cdot 10^{-188}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{-91}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.45 \cdot 10^{+201}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 8: 64.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -1.02 \cdot 10^{+155}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.45 \cdot 10^{-45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \cdot i \leq -4.8 \cdot 10^{-272}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 3.15 \cdot 10^{+190}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \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) -1.02e+155)
     (+ (* a b) (* c i))
     (if (<= (* c i) -1.45e-45)
       t_1
       (if (<= (* c i) -4.8e-272)
         (+ (* a b) (* x y))
         (if (<= (* c i) 3.15e+190) t_1 (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double tmp;
	if ((c * i) <= -1.02e+155) {
		tmp = (a * b) + (c * i);
	} else if ((c * i) <= -1.45e-45) {
		tmp = t_1;
	} else if ((c * i) <= -4.8e-272) {
		tmp = (a * b) + (x * y);
	} else if ((c * i) <= 3.15e+190) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    if ((c * i) <= (-1.02d+155)) then
        tmp = (a * b) + (c * i)
    else if ((c * i) <= (-1.45d-45)) then
        tmp = t_1
    else if ((c * i) <= (-4.8d-272)) then
        tmp = (a * b) + (x * y)
    else if ((c * i) <= 3.15d+190) then
        tmp = t_1
    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 t_1 = (a * b) + (z * t);
	double tmp;
	if ((c * i) <= -1.02e+155) {
		tmp = (a * b) + (c * i);
	} else if ((c * i) <= -1.45e-45) {
		tmp = t_1;
	} else if ((c * i) <= -4.8e-272) {
		tmp = (a * b) + (x * y);
	} else if ((c * i) <= 3.15e+190) {
		tmp = t_1;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	tmp = 0
	if (c * i) <= -1.02e+155:
		tmp = (a * b) + (c * i)
	elif (c * i) <= -1.45e-45:
		tmp = t_1
	elif (c * i) <= -4.8e-272:
		tmp = (a * b) + (x * y)
	elif (c * i) <= 3.15e+190:
		tmp = t_1
	else:
		tmp = c * i
	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) <= -1.02e+155)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(c * i) <= -1.45e-45)
		tmp = t_1;
	elseif (Float64(c * i) <= -4.8e-272)
		tmp = Float64(Float64(a * b) + Float64(x * y));
	elseif (Float64(c * i) <= 3.15e+190)
		tmp = t_1;
	else
		tmp = Float64(c * i);
	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) <= -1.02e+155)
		tmp = (a * b) + (c * i);
	elseif ((c * i) <= -1.45e-45)
		tmp = t_1;
	elseif ((c * i) <= -4.8e-272)
		tmp = (a * b) + (x * y);
	elseif ((c * i) <= 3.15e+190)
		tmp = t_1;
	else
		tmp = c * i;
	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], -1.02e+155], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.45e-45], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -4.8e-272], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 3.15e+190], t$95$1, N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -1.45 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \cdot i \leq 3.15 \cdot 10^{+190}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 90.2%

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

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

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

    if -1.02e155 < (*.f64 c i) < -1.45e-45 or -4.7999999999999998e-272 < (*.f64 c i) < 3.1500000000000001e190

    1. Initial program 98.1%

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

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

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

    if -1.45e-45 < (*.f64 c i) < -4.7999999999999998e-272

    1. Initial program 97.1%

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

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

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

    if 3.1500000000000001e190 < (*.f64 c i)

    1. Initial program 76.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.02 \cdot 10^{+155}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.45 \cdot 10^{-45}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -4.8 \cdot 10^{-272}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 3.15 \cdot 10^{+190}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 9: 65.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 10^{-185}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 1.85 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 93.3%

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

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

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

    if -3.2999999999999999e59 < (*.f64 a b) < 9.9999999999999999e-186 or 9.5e-91 < (*.f64 a b) < 1.85e114

    1. Initial program 97.2%

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

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

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

    if 9.9999999999999999e-186 < (*.f64 a b) < 9.5e-91

    1. Initial program 93.3%

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

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

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

    if 1.85e114 < (*.f64 a b)

    1. Initial program 87.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.3 \cdot 10^{+59}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 10^{-185}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 9.5 \cdot 10^{-91}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 1.85 \cdot 10^{+114}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 10: 85.5% accurate, 0.8× speedup?

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

\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) < -3.79999999999999963e137 or 1.5999999999999999e176 < (*.f64 c i)

    1. Initial program 84.5%

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

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

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

    if -3.79999999999999963e137 < (*.f64 c i) < 1.5999999999999999e176

    1. Initial program 98.4%

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

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

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

Alternative 11: 88.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+94} \lor \neg \left(c \cdot i \leq 1.75 \cdot 10^{+103}\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) -2.1e+94) (not (<= (* c i) 1.75e+103)))
   (+ (* 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) <= -2.1e+94) || !((c * i) <= 1.75e+103)) {
		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) <= (-2.1d+94)) .or. (.not. ((c * i) <= 1.75d+103))) 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) <= -2.1e+94) || !((c * i) <= 1.75e+103)) {
		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) <= -2.1e+94) or not ((c * i) <= 1.75e+103):
		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) <= -2.1e+94) || !(Float64(c * i) <= 1.75e+103))
		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) <= -2.1e+94) || ~(((c * i) <= 1.75e+103)))
		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], -2.1e+94], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.75e+103]], $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 -2.1 \cdot 10^{+94} \lor \neg \left(c \cdot i \leq 1.75 \cdot 10^{+103}\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) < -2.09999999999999989e94 or 1.75e103 < (*.f64 c i)

    1. Initial program 88.3%

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

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

    if -2.09999999999999989e94 < (*.f64 c i) < 1.75e103

    1. Initial program 98.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+94} \lor \neg \left(c \cdot i \leq 1.75 \cdot 10^{+103}\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} \]

Alternative 12: 88.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 3 \cdot 10^{+114}\right):\\ \;\;\;\;a \cdot b + t_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (or (<= (* a b) -2.3e+84) (not (<= (* a b) 3e+114)))
     (+ (* a b) t_1)
     (+ (* c i) t_1))))
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 tmp;
	if (((a * b) <= -2.3e+84) || !((a * b) <= 3e+114)) {
		tmp = (a * b) + t_1;
	} else {
		tmp = (c * i) + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    if (((a * b) <= (-2.3d+84)) .or. (.not. ((a * b) <= 3d+114))) then
        tmp = (a * b) + t_1
    else
        tmp = (c * i) + t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if (((a * b) <= -2.3e+84) || !((a * b) <= 3e+114)) {
		tmp = (a * b) + t_1;
	} else {
		tmp = (c * i) + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) + (z * t)
	tmp = 0
	if ((a * b) <= -2.3e+84) or not ((a * b) <= 3e+114):
		tmp = (a * b) + t_1
	else:
		tmp = (c * i) + t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if ((Float64(a * b) <= -2.3e+84) || !(Float64(a * b) <= 3e+114))
		tmp = Float64(Float64(a * b) + t_1);
	else
		tmp = Float64(Float64(c * i) + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x * y) + (z * t);
	tmp = 0.0;
	if (((a * b) <= -2.3e+84) || ~(((a * b) <= 3e+114)))
		tmp = (a * b) + t_1;
	else
		tmp = (c * i) + t_1;
	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]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -2.3e+84], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3e+114]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 3 \cdot 10^{+114}\right):\\
\;\;\;\;a \cdot b + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.2999999999999999e84 or 3e114 < (*.f64 a b)

    1. Initial program 90.4%

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

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

    if -2.2999999999999999e84 < (*.f64 a b) < 3e114

    1. Initial program 96.9%

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

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

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

Alternative 13: 55.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.45 \cdot 10^{+108}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{+100} \lor \neg \left(t \leq 7 \cdot 10^{+163}\right) \land t \leq 3.65 \cdot 10^{+180}:\\ \;\;\;\;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 -4.45e+108)
   (* z t)
   (if (or (<= t 5.3e+100) (and (not (<= t 7e+163)) (<= t 3.65e+180)))
     (+ (* 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 <= -4.45e+108) {
		tmp = z * t;
	} else if ((t <= 5.3e+100) || (!(t <= 7e+163) && (t <= 3.65e+180))) {
		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 <= (-4.45d+108)) then
        tmp = z * t
    else if ((t <= 5.3d+100) .or. (.not. (t <= 7d+163)) .and. (t <= 3.65d+180)) 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 <= -4.45e+108) {
		tmp = z * t;
	} else if ((t <= 5.3e+100) || (!(t <= 7e+163) && (t <= 3.65e+180))) {
		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 <= -4.45e+108:
		tmp = z * t
	elif (t <= 5.3e+100) or (not (t <= 7e+163) and (t <= 3.65e+180)):
		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 <= -4.45e+108)
		tmp = Float64(z * t);
	elseif ((t <= 5.3e+100) || (!(t <= 7e+163) && (t <= 3.65e+180)))
		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 <= -4.45e+108)
		tmp = z * t;
	elseif ((t <= 5.3e+100) || (~((t <= 7e+163)) && (t <= 3.65e+180)))
		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, -4.45e+108], N[(z * t), $MachinePrecision], If[Or[LessEqual[t, 5.3e+100], And[N[Not[LessEqual[t, 7e+163]], $MachinePrecision], LessEqual[t, 3.65e+180]]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.45 \cdot 10^{+108}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;t \leq 5.3 \cdot 10^{+100} \lor \neg \left(t \leq 7 \cdot 10^{+163}\right) \land t \leq 3.65 \cdot 10^{+180}:\\
\;\;\;\;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 < -4.4500000000000001e108 or 5.2999999999999998e100 < t < 7.0000000000000005e163 or 3.65000000000000019e180 < t

    1. Initial program 88.3%

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

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

    if -4.4500000000000001e108 < t < 5.2999999999999998e100 or 7.0000000000000005e163 < t < 3.65000000000000019e180

    1. Initial program 97.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.45 \cdot 10^{+108}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{+100} \lor \neg \left(t \leq 7 \cdot 10^{+163}\right) \land t \leq 3.65 \cdot 10^{+180}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]

Alternative 14: 64.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+154}:\\
\;\;\;\;a \cdot b + c \cdot i\\

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

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


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

    1. Initial program 90.2%

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

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

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

    if -8.5000000000000002e154 < (*.f64 c i) < 7.00000000000000046e185

    1. Initial program 97.9%

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

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

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

    if 7.00000000000000046e185 < (*.f64 c i)

    1. Initial program 76.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.5 \cdot 10^{+154}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 7 \cdot 10^{+185}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 15: 65.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -3.9 \cdot 10^{+59}:\\
\;\;\;\;a \cdot b + x \cdot y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -3.90000000000000021e59

    1. Initial program 93.3%

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

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

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

    if -3.90000000000000021e59 < (*.f64 a b) < 2.15e114

    1. Initial program 96.8%

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

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

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

    if 2.15e114 < (*.f64 a b)

    1. Initial program 87.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.9 \cdot 10^{+59}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.15 \cdot 10^{+114}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 16: 42.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.2 \cdot 10^{+85}:\\
\;\;\;\;a \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.19999999999999998e85 or 1.1e115 < (*.f64 a b)

    1. Initial program 90.4%

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

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

    if -1.19999999999999998e85 < (*.f64 a b) < 1.1e115

    1. Initial program 96.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.2 \cdot 10^{+85}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 1.1 \cdot 10^{+115}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 17: 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 94.5%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  3. Final simplification27.9%

    \[\leadsto a \cdot b \]

Reproduce

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