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

Percentage Accurate: 95.9% → 98.4%
Time: 11.5s
Alternatives: 16
Speedup: 0.4×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i):
	return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i)
	return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = (((x * y) + (z * t)) + (a * b)) + (c * i);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 95.9% 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.4% accurate, 0.0× 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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + \left(t \cdot \frac{z}{y} + c \cdot \frac{i}{y}\right)\right)\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 c i (fma a b (fma x y (* z t))))
   (* y (+ x (+ (* a (/ b y)) (+ (* t (/ z y)) (* c (/ i y))))))))
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(c, i, fma(a, b, fma(x, y, (z * t))));
	} else {
		tmp = y * (x + ((a * (b / y)) + ((t * (z / y)) + (c * (i / y)))));
	}
	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 = fma(c, i, fma(a, b, fma(x, y, Float64(z * t))));
	else
		tmp = Float64(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(Float64(t * Float64(z / y)) + Float64(c * Float64(i / y))))));
	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[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 15.4%

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

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

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

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

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

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

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

Alternative 2: 98.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + \left(a \cdot \frac{b}{y} + \left(t \cdot \frac{z}{y} + c \cdot \frac{i}{y}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
   (if (<= t_1 INFINITY)
     t_1
     (* y (+ x (+ (* a (/ b y)) (+ (* t (/ z y)) (* c (/ i 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 = y * (x + ((a * (b / y)) + ((t * (z / y)) + (c * (i / 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 = y * (x + ((a * (b / y)) + ((t * (z / y)) + (c * (i / 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 = y * (x + ((a * (b / y)) + ((t * (z / y)) + (c * (i / 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(y * Float64(x + Float64(Float64(a * Float64(b / y)) + Float64(Float64(t * Float64(z / y)) + Float64(c * Float64(i / 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 = y * (x + ((a * (b / y)) + ((t * (z / y)) + (c * (i / 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[(y * N[(x + N[(N[(a * N[(b / y), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision] + N[(c * N[(i / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

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

    1. Initial program 0.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 15.4%

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

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

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

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

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

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

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

Alternative 3: 87.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + \left(c \cdot i + z \cdot t\right)\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -\infty:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{+50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq 8.4 \cdot 10^{+71}:\\ \;\;\;\;a \cdot b + t\_2\\ \mathbf{elif}\;c \cdot i \leq 6.2 \cdot 10^{+203}:\\ \;\;\;\;c \cdot i + t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (+ (* c i) (* z t)))) (t_2 (+ (* x y) (* z t))))
   (if (<= (* c i) (- INFINITY))
     (* c i)
     (if (<= (* c i) -8.5e+50)
       t_1
       (if (<= (* c i) 8.4e+71)
         (+ (* a b) t_2)
         (if (<= (* c i) 6.2e+203) (+ (* c i) t_2) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + ((c * i) + (z * t));
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((c * i) <= -((double) INFINITY)) {
		tmp = c * i;
	} else if ((c * i) <= -8.5e+50) {
		tmp = t_1;
	} else if ((c * i) <= 8.4e+71) {
		tmp = (a * b) + t_2;
	} else if ((c * i) <= 6.2e+203) {
		tmp = (c * i) + t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + ((c * i) + (z * t));
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((c * i) <= -Double.POSITIVE_INFINITY) {
		tmp = c * i;
	} else if ((c * i) <= -8.5e+50) {
		tmp = t_1;
	} else if ((c * i) <= 8.4e+71) {
		tmp = (a * b) + t_2;
	} else if ((c * i) <= 6.2e+203) {
		tmp = (c * i) + t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + ((c * i) + (z * t))
	t_2 = (x * y) + (z * t)
	tmp = 0
	if (c * i) <= -math.inf:
		tmp = c * i
	elif (c * i) <= -8.5e+50:
		tmp = t_1
	elif (c * i) <= 8.4e+71:
		tmp = (a * b) + t_2
	elif (c * i) <= 6.2e+203:
		tmp = (c * i) + t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(z * t)))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= Float64(-Inf))
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -8.5e+50)
		tmp = t_1;
	elseif (Float64(c * i) <= 8.4e+71)
		tmp = Float64(Float64(a * b) + t_2);
	elseif (Float64(c * i) <= 6.2e+203)
		tmp = Float64(Float64(c * i) + t_2);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + ((c * i) + (z * t));
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -Inf)
		tmp = c * i;
	elseif ((c * i) <= -8.5e+50)
		tmp = t_1;
	elseif ((c * i) <= 8.4e+71)
		tmp = (a * b) + t_2;
	elseif ((c * i) <= 6.2e+203)
		tmp = (c * i) + t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], (-Infinity)], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8.5e+50], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 8.4e+71], N[(N[(a * b), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 6.2e+203], N[(N[(c * i), $MachinePrecision] + t$95$2), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \cdot i \leq 8.4 \cdot 10^{+71}:\\
\;\;\;\;a \cdot b + t\_2\\

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

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


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

    1. Initial program 64.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around inf 88.2%

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

    if -inf.0 < (*.f64 c i) < -8.49999999999999961e50 or 6.2e203 < (*.f64 c i)

    1. Initial program 93.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 92.2%

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

    if -8.49999999999999961e50 < (*.f64 c i) < 8.39999999999999957e71

    1. Initial program 98.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 96.2%

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

    if 8.39999999999999957e71 < (*.f64 c i) < 6.2e203

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 96.6%

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

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

Alternative 4: 66.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := x \cdot y + a \cdot b\\ \mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+86}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \cdot b \leq -0.22:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 9.8 \cdot 10^{-115}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 1.35 \cdot 10^{+141}:\\ \;\;\;\;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) (* z t))) (t_2 (+ (* x y) (* a b))))
   (if (<= (* a b) -4.2e+86)
     t_2
     (if (<= (* a b) -0.22)
       t_1
       (if (<= (* a b) 9.8e-115)
         (+ (* x y) (* c i))
         (if (<= (* a b) 1.35e+141) 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) + (z * t);
	double t_2 = (x * y) + (a * b);
	double tmp;
	if ((a * b) <= -4.2e+86) {
		tmp = t_2;
	} else if ((a * b) <= -0.22) {
		tmp = t_1;
	} else if ((a * b) <= 9.8e-115) {
		tmp = (x * y) + (c * i);
	} else if ((a * b) <= 1.35e+141) {
		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) + (z * t)
    t_2 = (x * y) + (a * b)
    if ((a * b) <= (-4.2d+86)) then
        tmp = t_2
    else if ((a * b) <= (-0.22d0)) then
        tmp = t_1
    else if ((a * b) <= 9.8d-115) then
        tmp = (x * y) + (c * i)
    else if ((a * b) <= 1.35d+141) 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) + (z * t);
	double t_2 = (x * y) + (a * b);
	double tmp;
	if ((a * b) <= -4.2e+86) {
		tmp = t_2;
	} else if ((a * b) <= -0.22) {
		tmp = t_1;
	} else if ((a * b) <= 9.8e-115) {
		tmp = (x * y) + (c * i);
	} else if ((a * b) <= 1.35e+141) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (x * y) + (a * b)
	tmp = 0
	if (a * b) <= -4.2e+86:
		tmp = t_2
	elif (a * b) <= -0.22:
		tmp = t_1
	elif (a * b) <= 9.8e-115:
		tmp = (x * y) + (c * i)
	elif (a * b) <= 1.35e+141:
		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(z * t))
	t_2 = Float64(Float64(x * y) + Float64(a * b))
	tmp = 0.0
	if (Float64(a * b) <= -4.2e+86)
		tmp = t_2;
	elseif (Float64(a * b) <= -0.22)
		tmp = t_1;
	elseif (Float64(a * b) <= 9.8e-115)
		tmp = Float64(Float64(x * y) + Float64(c * i));
	elseif (Float64(a * b) <= 1.35e+141)
		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) + (z * t);
	t_2 = (x * y) + (a * b);
	tmp = 0.0;
	if ((a * b) <= -4.2e+86)
		tmp = t_2;
	elseif ((a * b) <= -0.22)
		tmp = t_1;
	elseif ((a * b) <= 9.8e-115)
		tmp = (x * y) + (c * i);
	elseif ((a * b) <= 1.35e+141)
		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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -4.2e+86], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -0.22], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 9.8e-115], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.35e+141], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -0.22:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 1.35 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -4.1999999999999998e86 or 1.35e141 < (*.f64 a b)

    1. Initial program 92.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 87.7%

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

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

    if -4.1999999999999998e86 < (*.f64 a b) < -0.220000000000000001 or 9.79999999999999977e-115 < (*.f64 a b) < 1.35e141

    1. Initial program 94.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 79.1%

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

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

    if -0.220000000000000001 < (*.f64 a b) < 9.79999999999999977e-115

    1. Initial program 97.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 94.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -4.2 \cdot 10^{+86}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -0.22:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 9.8 \cdot 10^{-115}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 1.35 \cdot 10^{+141}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 97.7% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

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

    1. Initial program 0.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 15.4%

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

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

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

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

Alternative 6: 87.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -\infty:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.1 \cdot 10^{+56} \lor \neg \left(c \cdot i \leq 1.9 \cdot 10^{+76}\right):\\ \;\;\;\;a \cdot b + \left(c \cdot i + 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 (<= (* c i) (- INFINITY))
   (* c i)
   (if (or (<= (* c i) -1.1e+56) (not (<= (* c i) 1.9e+76)))
     (+ (* a b) (+ (* 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) <= -((double) INFINITY)) {
		tmp = c * i;
	} else if (((c * i) <= -1.1e+56) || !((c * i) <= 1.9e+76)) {
		tmp = (a * b) + ((c * i) + (z * t));
	} else {
		tmp = (a * b) + ((x * y) + (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 tmp;
	if ((c * i) <= -Double.POSITIVE_INFINITY) {
		tmp = c * i;
	} else if (((c * i) <= -1.1e+56) || !((c * i) <= 1.9e+76)) {
		tmp = (a * b) + ((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) <= -math.inf:
		tmp = c * i
	elif ((c * i) <= -1.1e+56) or not ((c * i) <= 1.9e+76):
		tmp = (a * b) + ((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) <= Float64(-Inf))
		tmp = Float64(c * i);
	elseif ((Float64(c * i) <= -1.1e+56) || !(Float64(c * i) <= 1.9e+76))
		tmp = Float64(Float64(a * b) + 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) <= -Inf)
		tmp = c * i;
	elseif (((c * i) <= -1.1e+56) || ~(((c * i) <= 1.9e+76)))
		tmp = (a * b) + ((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[LessEqual[N[(c * i), $MachinePrecision], (-Infinity)], N[(c * i), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.1e+56], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.9e+76]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $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 -\infty:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;c \cdot i \leq -1.1 \cdot 10^{+56} \lor \neg \left(c \cdot i \leq 1.9 \cdot 10^{+76}\right):\\
\;\;\;\;a \cdot b + \left(c \cdot i + 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 3 regimes
  2. if (*.f64 c i) < -inf.0

    1. Initial program 64.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around inf 88.2%

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

    if -inf.0 < (*.f64 c i) < -1.10000000000000008e56 or 1.90000000000000012e76 < (*.f64 c i)

    1. Initial program 95.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 85.6%

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

    if -1.10000000000000008e56 < (*.f64 c i) < 1.90000000000000012e76

    1. Initial program 98.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 96.2%

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

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

Alternative 7: 61.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 2.65 \cdot 10^{-164}:\\
\;\;\;\;a \cdot b + z \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -8.8e264 or 2.7999999999999999e97 < (*.f64 x y)

    1. Initial program 89.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 82.8%

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

      \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
    7. Taylor expanded in c around 0 73.6%

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

    if -8.8e264 < (*.f64 x y) < 2.65000000000000016e-164

    1. Initial program 97.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 90.8%

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

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

    if 2.65000000000000016e-164 < (*.f64 x y) < 2.7999999999999999e97

    1. Initial program 96.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 77.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.8 \cdot 10^{+264}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 2.65 \cdot 10^{-164}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{+97}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t \leq 2 \cdot 10^{-230}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 2.55 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.4e-65 or 2.5500000000000001e67 < t

    1. Initial program 92.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 77.0%

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

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

    if -7.4e-65 < t < 2.00000000000000009e-230 or 1.94999999999999988e-136 < t < 2.5500000000000001e67

    1. Initial program 97.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 72.6%

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

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

    if 2.00000000000000009e-230 < t < 1.94999999999999988e-136

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 94.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.4 \cdot 10^{-65}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-230}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;t \leq 1.95 \cdot 10^{-136}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;t \leq 2.55 \cdot 10^{+67}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -7.8 \cdot 10^{+264}:\\
\;\;\;\;x \cdot y + c \cdot i\\

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

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 79.2%

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

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

    if -7.79999999999999987e264 < (*.f64 x y) < 4.99999999999999999e97

    1. Initial program 97.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 86.6%

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

    if 4.99999999999999999e97 < (*.f64 x y)

    1. Initial program 94.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 88.4%

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

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

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

Alternative 10: 43.3% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -3.3e62 or 1.10000000000000002e156 < (*.f64 c i)

    1. Initial program 89.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around inf 64.9%

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

    if -3.3e62 < (*.f64 c i) < -1.7999999999999999e-143

    1. Initial program 90.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 68.2%

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

      \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
    7. Taylor expanded in a around 0 53.5%

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

    if -1.7999999999999999e-143 < (*.f64 c i) < 1.10000000000000002e156

    1. Initial program 99.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 73.8%

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

      \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
    7. Taylor expanded in c around 0 42.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.3 \cdot 10^{+62}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.8 \cdot 10^{-143}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{+156}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 43.0% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.70000000000000008e68 or 3.99999999999999981e74 < (*.f64 c i)

    1. Initial program 91.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around inf 60.2%

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

    if -1.70000000000000008e68 < (*.f64 c i) < 2.7000000000000002e-177

    1. Initial program 96.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 66.6%

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

      \[\leadsto a \cdot b + \color{blue}{t \cdot z} \]
    7. Taylor expanded in a around 0 42.3%

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

    if 2.7000000000000002e-177 < (*.f64 c i) < 3.99999999999999981e74

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 35.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.7 \cdot 10^{+68}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{-177}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 4 \cdot 10^{+74}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 63.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.6 \cdot 10^{-96} \lor \neg \left(c \cdot i \leq 4.2 \cdot 10^{+78}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -8.59999999999999961e-96 or 4.2000000000000002e78 < (*.f64 c i)

    1. Initial program 90.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 79.2%

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

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

    if -8.59999999999999961e-96 < (*.f64 c i) < 4.2000000000000002e78

    1. Initial program 99.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 98.5%

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

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

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

Alternative 13: 62.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+201} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+97}\right):\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.5000000000000002e201 or 4.99999999999999999e97 < (*.f64 x y)

    1. Initial program 89.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 83.9%

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

      \[\leadsto c \cdot i + \color{blue}{x \cdot y} \]
    7. Taylor expanded in c around 0 70.5%

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

    if -9.5000000000000002e201 < (*.f64 x y) < 4.99999999999999999e97

    1. Initial program 97.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 87.0%

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

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

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

Alternative 14: 65.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+56}:\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 3.4 \cdot 10^{+168}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\


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

    1. Initial program 83.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 81.9%

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

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

    if -1.40000000000000004e56 < (*.f64 c i) < 3.40000000000000003e168

    1. Initial program 98.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around 0 92.8%

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

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

    if 3.40000000000000003e168 < (*.f64 c i)

    1. Initial program 94.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 89.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+56}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 3.4 \cdot 10^{+168}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 43.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+89} \lor \neg \left(a \cdot b \leq 3.2 \cdot 10^{+97}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* a b) -1.6e+89) (not (<= (* a b) 3.2e+97))) (* a b) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((a * b) <= -1.6e+89) || !((a * b) <= 3.2e+97)) {
		tmp = a * b;
	} else {
		tmp = c * i;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((a * b) <= (-1.6d+89)) .or. (.not. ((a * b) <= 3.2d+97))) then
        tmp = a * b
    else
        tmp = c * i
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((a * b) <= -1.6e+89) || !((a * b) <= 3.2e+97)) {
		tmp = a * b;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((a * b) <= -1.6e+89) or not ((a * b) <= 3.2e+97):
		tmp = a * b
	else:
		tmp = c * i
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(a * b) <= -1.6e+89) || !(Float64(a * b) <= 3.2e+97))
		tmp = Float64(a * b);
	else
		tmp = Float64(c * i);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((a * b) <= -1.6e+89) || ~(((a * b) <= 3.2e+97)))
		tmp = a * b;
	else
		tmp = c * i;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.6e+89], N[Not[LessEqual[N[(a * b), $MachinePrecision], 3.2e+97]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+89} \lor \neg \left(a \cdot b \leq 3.2 \cdot 10^{+97}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.59999999999999994e89 or 3.20000000000000016e97 < (*.f64 a b)

    1. Initial program 92.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 61.3%

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

    if -1.59999999999999994e89 < (*.f64 a b) < 3.20000000000000016e97

    1. Initial program 95.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in c around inf 32.8%

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

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

Alternative 16: 26.9% 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.9%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in a around inf 24.3%

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

Reproduce

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