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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.8% 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 91.8%

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

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

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

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

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

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

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

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

Alternative 3: 97.2% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right) + x \cdot y\\


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

    1. Initial program 63.2%

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

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

    if -inf.0 < (*.f64 x y)

    1. Initial program 94.1%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(x, y, z \cdot t + a \cdot b\right)}\right) \]
      5. fma-def97.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. Simplified97.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-udef95.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.6% 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:\\ \;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(c \cdot i + a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c \cdot i\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)
   (+ (fma x y (* z t)) (+ (* c i) (* a b)))
   (fma y x (* 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) + ((a * b) + ((x * y) + (z * t)))) <= ((double) INFINITY)) {
		tmp = fma(x, y, (z * t)) + ((c * i) + (a * b));
	} else {
		tmp = fma(y, x, (c * i));
	}
	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(fma(x, y, Float64(z * t)) + Float64(Float64(c * i) + Float64(a * b)));
	else
		tmp = fma(y, x, Float64(c * i));
	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[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(c * i), $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:\\
\;\;\;\;\mathsf{fma}\left(x, y, z \cdot t\right) + \left(c \cdot i + a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c \cdot i\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. fma-def100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\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 a around 0 19.0%

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

      \[\leadsto \color{blue}{c \cdot i + y \cdot x} \]
    4. Step-by-step derivation
      1. +-commutative47.9%

        \[\leadsto \color{blue}{y \cdot x + c \cdot i} \]
      2. fma-def57.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c \cdot i\right)} \]
    5. Applied egg-rr57.4%

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

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

Alternative 5: 97.4% 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(i, c, 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 i c (* 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(i, c, (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(i, c, 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[(i * c + 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(i, c, 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 z around 0 42.9%

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

      \[\leadsto \color{blue}{c \cdot i + a \cdot b} \]
    4. Step-by-step derivation
      1. *-commutative47.8%

        \[\leadsto \color{blue}{i \cdot c} + a \cdot b \]
      2. fma-def57.3%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification96.5%

    \[\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(i, c, a \cdot b\right)\\ \end{array} \]

Alternative 6: 97.6% 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(y, x, c \cdot i\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 y x (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(y, x, (c * i));
	}
	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(y, x, Float64(c * i));
	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[(y * x + N[(c * i), $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(y, x, c \cdot i\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 a around 0 19.0%

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

      \[\leadsto \color{blue}{c \cdot i + y \cdot x} \]
    4. Step-by-step derivation
      1. +-commutative47.9%

        \[\leadsto \color{blue}{y \cdot x + c \cdot i} \]
      2. fma-def57.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c \cdot i\right)} \]
    5. Applied egg-rr57.4%

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

    \[\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(y, x, c \cdot i\right)\\ \end{array} \]

Alternative 7: 97.2% 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}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \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 (+ (* c i) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (x * y);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (x * y);
	}
	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 = (c * i) + (x * y)
	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(c * i) + Float64(x * y));
	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 = (c * i) + (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(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[(c * i), $MachinePrecision] + N[(x * y), $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}:\\
\;\;\;\;c \cdot i + x \cdot y\\


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

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

      \[\leadsto \color{blue}{c \cdot i + y \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.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 + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \end{array} \]

Alternative 8: 66.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := a \cdot b + x \cdot y\\ t_3 := c \cdot i + x \cdot y\\ \mathbf{if}\;a \cdot b \leq -1.16 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -1.35 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-151}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq 9.8 \cdot 10^{-163}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{+85}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (* z t)))
        (t_2 (+ (* a b) (* x y)))
        (t_3 (+ (* c i) (* x y))))
   (if (<= (* a b) -1.16e+33)
     t_2
     (if (<= (* a b) -1.35e-5)
       t_1
       (if (<= (* a b) -8.2e-151)
         t_3
         (if (<= (* a b) 9.8e-163) t_1 (if (<= (* a b) 4.5e+85) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + (z * t);
	double t_2 = (a * b) + (x * y);
	double t_3 = (c * i) + (x * y);
	double tmp;
	if ((a * b) <= -1.16e+33) {
		tmp = t_2;
	} else if ((a * b) <= -1.35e-5) {
		tmp = t_1;
	} else if ((a * b) <= -8.2e-151) {
		tmp = t_3;
	} else if ((a * b) <= 9.8e-163) {
		tmp = t_1;
	} else if ((a * b) <= 4.5e+85) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (c * i) + (z * t)
    t_2 = (a * b) + (x * y)
    t_3 = (c * i) + (x * y)
    if ((a * b) <= (-1.16d+33)) then
        tmp = t_2
    else if ((a * b) <= (-1.35d-5)) then
        tmp = t_1
    else if ((a * b) <= (-8.2d-151)) then
        tmp = t_3
    else if ((a * b) <= 9.8d-163) then
        tmp = t_1
    else if ((a * b) <= 4.5d+85) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + (z * t);
	double t_2 = (a * b) + (x * y);
	double t_3 = (c * i) + (x * y);
	double tmp;
	if ((a * b) <= -1.16e+33) {
		tmp = t_2;
	} else if ((a * b) <= -1.35e-5) {
		tmp = t_1;
	} else if ((a * b) <= -8.2e-151) {
		tmp = t_3;
	} else if ((a * b) <= 9.8e-163) {
		tmp = t_1;
	} else if ((a * b) <= 4.5e+85) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (a * b) + (x * y)
	t_3 = (c * i) + (x * y)
	tmp = 0
	if (a * b) <= -1.16e+33:
		tmp = t_2
	elif (a * b) <= -1.35e-5:
		tmp = t_1
	elif (a * b) <= -8.2e-151:
		tmp = t_3
	elif (a * b) <= 9.8e-163:
		tmp = t_1
	elif (a * b) <= 4.5e+85:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(z * t))
	t_2 = Float64(Float64(a * b) + Float64(x * y))
	t_3 = Float64(Float64(c * i) + Float64(x * y))
	tmp = 0.0
	if (Float64(a * b) <= -1.16e+33)
		tmp = t_2;
	elseif (Float64(a * b) <= -1.35e-5)
		tmp = t_1;
	elseif (Float64(a * b) <= -8.2e-151)
		tmp = t_3;
	elseif (Float64(a * b) <= 9.8e-163)
		tmp = t_1;
	elseif (Float64(a * b) <= 4.5e+85)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * i) + (z * t);
	t_2 = (a * b) + (x * y);
	t_3 = (c * i) + (x * y);
	tmp = 0.0;
	if ((a * b) <= -1.16e+33)
		tmp = t_2;
	elseif ((a * b) <= -1.35e-5)
		tmp = t_1;
	elseif ((a * b) <= -8.2e-151)
		tmp = t_3;
	elseif ((a * b) <= 9.8e-163)
		tmp = t_1;
	elseif ((a * b) <= 4.5e+85)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1.16e+33], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -1.35e-5], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -8.2e-151], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 9.8e-163], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 4.5e+85], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-151}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{+85}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.16000000000000001e33 or 4.50000000000000007e85 < (*.f64 a b)

    1. Initial program 86.9%

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

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

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

    if -1.16000000000000001e33 < (*.f64 a b) < -1.3499999999999999e-5 or -8.2000000000000002e-151 < (*.f64 a b) < 9.8000000000000005e-163

    1. Initial program 94.7%

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

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

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

    if -1.3499999999999999e-5 < (*.f64 a b) < -8.2000000000000002e-151 or 9.8000000000000005e-163 < (*.f64 a b) < 4.50000000000000007e85

    1. Initial program 94.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.16 \cdot 10^{+33}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1.35 \cdot 10^{-5}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-151}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 9.8 \cdot 10^{-163}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 4.5 \cdot 10^{+85}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 9: 65.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+33} \lor \neg \left(a \cdot b \leq 1.95 \cdot 10^{-150}\right) \land \left(a \cdot b \leq 6.5 \cdot 10^{-96} \lor \neg \left(a \cdot b \leq 4.75 \cdot 10^{+61}\right)\right):\\ \;\;\;\;a \cdot b + x \cdot y\\ \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) -2.25e+33)
         (and (not (<= (* a b) 1.95e-150))
              (or (<= (* a b) 6.5e-96) (not (<= (* a b) 4.75e+61)))))
   (+ (* a b) (* x y))
   (+ (* 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) <= -2.25e+33) || (!((a * b) <= 1.95e-150) && (((a * b) <= 6.5e-96) || !((a * b) <= 4.75e+61)))) {
		tmp = (a * b) + (x * y);
	} 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) <= (-2.25d+33)) .or. (.not. ((a * b) <= 1.95d-150)) .and. ((a * b) <= 6.5d-96) .or. (.not. ((a * b) <= 4.75d+61))) then
        tmp = (a * b) + (x * y)
    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) <= -2.25e+33) || (!((a * b) <= 1.95e-150) && (((a * b) <= 6.5e-96) || !((a * b) <= 4.75e+61)))) {
		tmp = (a * b) + (x * y);
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((a * b) <= -2.25e+33) or (not ((a * b) <= 1.95e-150) and (((a * b) <= 6.5e-96) or not ((a * b) <= 4.75e+61))):
		tmp = (a * b) + (x * y)
	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) <= -2.25e+33) || (!(Float64(a * b) <= 1.95e-150) && ((Float64(a * b) <= 6.5e-96) || !(Float64(a * b) <= 4.75e+61))))
		tmp = Float64(Float64(a * b) + Float64(x * y));
	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) <= -2.25e+33) || (~(((a * b) <= 1.95e-150)) && (((a * b) <= 6.5e-96) || ~(((a * b) <= 4.75e+61)))))
		tmp = (a * b) + (x * y);
	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], -2.25e+33], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.95e-150]], $MachinePrecision], Or[LessEqual[N[(a * b), $MachinePrecision], 6.5e-96], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4.75e+61]], $MachinePrecision]]]], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+33} \lor \neg \left(a \cdot b \leq 1.95 \cdot 10^{-150}\right) \land \left(a \cdot b \leq 6.5 \cdot 10^{-96} \lor \neg \left(a \cdot b \leq 4.75 \cdot 10^{+61}\right)\right):\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.25e33 or 1.9500000000000001e-150 < (*.f64 a b) < 6.50000000000000001e-96 or 4.7499999999999998e61 < (*.f64 a b)

    1. Initial program 88.4%

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

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

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

    if -2.25e33 < (*.f64 a b) < 1.9500000000000001e-150 or 6.50000000000000001e-96 < (*.f64 a b) < 4.7499999999999998e61

    1. Initial program 94.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+33} \lor \neg \left(a \cdot b \leq 1.95 \cdot 10^{-150}\right) \land \left(a \cdot b \leq 6.5 \cdot 10^{-96} \lor \neg \left(a \cdot b \leq 4.75 \cdot 10^{+61}\right)\right):\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]

Alternative 10: 73.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \leq -1.05 \cdot 10^{+136}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -1.65 \cdot 10^{+103}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{elif}\;x \leq -2.2 \cdot 10^{+95}:\\
\;\;\;\;c \cdot i + a \cdot b\\

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-114}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -7.00000000000000004e157 or 2.4000000000000001e-114 < x

    1. Initial program 90.3%

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

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

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

    if -7.00000000000000004e157 < x < -1.05e136 or -2.1999999999999999e95 < x < 2.4000000000000001e-114

    1. Initial program 93.2%

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

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

    if -1.05e136 < x < -1.65000000000000004e103

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

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

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

    if -1.65000000000000004e103 < x < -2.1999999999999999e95

    1. Initial program 50.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{+157}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{+136}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{+103}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{+95}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-114}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \end{array} \]

Alternative 11: 43.5% accurate, 0.8× speedup?

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

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

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

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

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

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


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

    1. Initial program 86.3%

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

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

    if -1.61999999999999996e50 < (*.f64 c i) < -2.55e-58

    1. Initial program 89.5%

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

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

    if -2.55e-58 < (*.f64 c i) < -9.5000000000000008e-183

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

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

    if -9.5000000000000008e-183 < (*.f64 c i) < 1.0500000000000001e53

    1. Initial program 97.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.62 \cdot 10^{+50}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.55 \cdot 10^{-58}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq -9.5 \cdot 10^{-183}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.05 \cdot 10^{+53}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 12: 61.6% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;c \cdot i \leq 7.2 \cdot 10^{+172}:\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -2.6500000000000001e50 or 7.1999999999999995e172 < (*.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 c around inf 68.7%

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

    if -2.6500000000000001e50 < (*.f64 c i) < -1.08000000000000003e-182

    1. Initial program 92.4%

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

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

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

    if -1.08000000000000003e-182 < (*.f64 c i) < 7.1999999999999995e172

    1. Initial program 96.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.65 \cdot 10^{+50}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.08 \cdot 10^{-182}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 7.2 \cdot 10^{+172}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 13: 65.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := c \cdot i + a \cdot b\\
\mathbf{if}\;c \cdot i \leq -4:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 86.8%

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

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

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

    if -4 < (*.f64 c i) < -4.2000000000000004e-183

    1. Initial program 94.7%

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

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

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

    if -4.2000000000000004e-183 < (*.f64 c i) < 8.19999999999999959e67

    1. Initial program 96.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{elif}\;c \cdot i \leq -4.2 \cdot 10^{-183}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{+67}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \]

Alternative 14: 88.1% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.65e62 or 1.9e48 < (*.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 z around 0 87.1%

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

    if -1.65e62 < (*.f64 a b) < 1.9e48

    1. Initial program 94.4%

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

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

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

Alternative 15: 43.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.7 \cdot 10^{+62}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 1.22 \cdot 10^{-160}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{+85}:\\ \;\;\;\;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.7e+62)
   (* a b)
   (if (<= (* a b) 1.22e-160)
     (* z t)
     (if (<= (* a b) 5.8e+85) (* 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.7e+62) {
		tmp = a * b;
	} else if ((a * b) <= 1.22e-160) {
		tmp = z * t;
	} else if ((a * b) <= 5.8e+85) {
		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.7d+62)) then
        tmp = a * b
    else if ((a * b) <= 1.22d-160) then
        tmp = z * t
    else if ((a * b) <= 5.8d+85) 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.7e+62) {
		tmp = a * b;
	} else if ((a * b) <= 1.22e-160) {
		tmp = z * t;
	} else if ((a * b) <= 5.8e+85) {
		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.7e+62:
		tmp = a * b
	elif (a * b) <= 1.22e-160:
		tmp = z * t
	elif (a * b) <= 5.8e+85:
		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.7e+62)
		tmp = Float64(a * b);
	elseif (Float64(a * b) <= 1.22e-160)
		tmp = Float64(z * t);
	elseif (Float64(a * b) <= 5.8e+85)
		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.7e+62)
		tmp = a * b;
	elseif ((a * b) <= 1.22e-160)
		tmp = z * t;
	elseif ((a * b) <= 5.8e+85)
		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.7e+62], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.22e-160], N[(z * t), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.8e+85], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.70000000000000007e62 or 5.79999999999999995e85 < (*.f64 a b)

    1. Initial program 86.2%

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

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

    if -1.70000000000000007e62 < (*.f64 a b) < 1.22000000000000003e-160

    1. Initial program 95.2%

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

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

    if 1.22000000000000003e-160 < (*.f64 a b) < 5.79999999999999995e85

    1. Initial program 93.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.7 \cdot 10^{+62}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 1.22 \cdot 10^{-160}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 5.8 \cdot 10^{+85}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 16: 75.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.7999999999999993e85

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

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

    if -9.7999999999999993e85 < x < 2.4000000000000001e-114

    1. Initial program 93.4%

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

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

    if 2.4000000000000001e-114 < x

    1. Initial program 90.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{+85}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-114}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \end{array} \]

Alternative 17: 44.0% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 86.2%

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

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

    if -5.79999999999999986e64 < (*.f64 a b) < 1.19999999999999998e85

    1. Initial program 94.6%

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

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

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

Alternative 18: 51.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-114}:\\
\;\;\;\;a \cdot b + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.14999999999999993e156 or 2.4000000000000001e-114 < x

    1. Initial program 90.3%

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

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

    if -2.14999999999999993e156 < x < 2.4000000000000001e-114

    1. Initial program 92.9%

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

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

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

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

Alternative 19: 27.7% 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 91.8%

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

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

    \[\leadsto a \cdot b \]

Reproduce

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