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

Percentage Accurate: 95.5% → 97.8%
Time: 12.6s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 95.5% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 0.0× speedup?

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

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

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

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

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

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

Alternative 2: 97.7% accurate, 0.1× speedup?

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot i + t \cdot \left(z + \color{blue}{x \cdot \frac{y}{t}}\right) \]
    8. Simplified50.0%

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

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

        \[\leadsto c \cdot i + x \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right) \]
    11. Simplified50.0%

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

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

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

Alternative 3: 88.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+207}:\\
\;\;\;\;c \cdot i + t\_1\\

\mathbf{elif}\;x \cdot y \leq -100000000000:\\
\;\;\;\;a \cdot b + t\_1\\

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

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


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

    1. Initial program 87.5%

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

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

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

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

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

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

    if -4.9999999999999999e207 < (*.f64 x y) < -1e11

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

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

    if -1e11 < (*.f64 x y) < 5.00000000000000022e41

    1. Initial program 98.5%

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

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

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

    if 5.00000000000000022e41 < (*.f64 x y)

    1. Initial program 95.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{a \cdot b + \left(x \cdot y + z \cdot t\right)}\right) \]
      4. fma-define96.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.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 inf 93.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(y + \left(\frac{a \cdot b}{x} + \frac{c \cdot i}{x}\right)\right)} \]
    9. Step-by-step derivation
      1. associate-+r+87.3%

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\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-define25.0%

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

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

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

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

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

        \[\leadsto c \cdot i + t \cdot \left(z + \color{blue}{x \cdot \frac{y}{t}}\right) \]
    8. Simplified50.0%

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

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

        \[\leadsto c \cdot i + x \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right) \]
    11. Simplified50.0%

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

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

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

Alternative 5: 87.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -100000000000:\\
\;\;\;\;a \cdot b + t\_1\\

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

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


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

    1. Initial program 91.8%

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

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

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

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

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

    if -4.9999999999999999e207 < (*.f64 x y) < -1e11

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

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

    if -1e11 < (*.f64 x y) < 1.9999999999999998e181

    1. Initial program 98.1%

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

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

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

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

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

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

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

Alternative 6: 66.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{-218}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+76}:\\ \;\;\;\;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 (<= (* x y) -1e-11)
   (* x (+ y (/ (* z t) x)))
   (if (<= (* x y) 1e-218)
     (+ (* a b) (* z t))
     (if (<= (* x y) 5e+76) (+ (* 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) <= -1e-11) {
		tmp = x * (y + ((z * t) / x));
	} else if ((x * y) <= 1e-218) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 5e+76) {
		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 ((x * y) <= (-1d-11)) then
        tmp = x * (y + ((z * t) / x))
    else if ((x * y) <= 1d-218) then
        tmp = (a * b) + (z * t)
    else if ((x * y) <= 5d+76) 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 ((x * y) <= -1e-11) {
		tmp = x * (y + ((z * t) / x));
	} else if ((x * y) <= 1e-218) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 5e+76) {
		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 (x * y) <= -1e-11:
		tmp = x * (y + ((z * t) / x))
	elif (x * y) <= 1e-218:
		tmp = (a * b) + (z * t)
	elif (x * y) <= 5e+76:
		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(x * y) <= -1e-11)
		tmp = Float64(x * Float64(y + Float64(Float64(z * t) / x)));
	elseif (Float64(x * y) <= 1e-218)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif (Float64(x * y) <= 5e+76)
		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 ((x * y) <= -1e-11)
		tmp = x * (y + ((z * t) / x));
	elseif ((x * y) <= 1e-218)
		tmp = (a * b) + (z * t);
	elseif ((x * y) <= 5e+76)
		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[LessEqual[N[(x * y), $MachinePrecision], -1e-11], N[(x * N[(y + N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-218], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+76], 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}\;x \cdot y \leq -1 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(y + \frac{z \cdot t}{x}\right)\\

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

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

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


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

    1. Initial program 94.8%

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot i + x \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right) \]
    11. Simplified84.8%

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

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

    if -9.99999999999999939e-12 < (*.f64 x y) < 1e-218

    1. Initial program 97.9%

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

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

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

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

    if 1e-218 < (*.f64 x y) < 4.99999999999999991e76

    1. Initial program 97.8%

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

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

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

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

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

    if 4.99999999999999991e76 < (*.f64 x y)

    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-define99.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. Simplified99.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 c around 0 80.9%

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

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

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

Alternative 7: 66.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.5 \cdot 10^{+143}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.36 \cdot 10^{-204}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+78}:\\ \;\;\;\;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 (<= (* x y) -4.5e+143)
   (+ (* x y) (* c i))
   (if (<= (* x y) 1.36e-204)
     (+ (* a b) (* z t))
     (if (<= (* x y) 7.5e+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 ((x * y) <= -4.5e+143) {
		tmp = (x * y) + (c * i);
	} else if ((x * y) <= 1.36e-204) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 7.5e+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 ((x * y) <= (-4.5d+143)) then
        tmp = (x * y) + (c * i)
    else if ((x * y) <= 1.36d-204) then
        tmp = (a * b) + (z * t)
    else if ((x * y) <= 7.5d+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 ((x * y) <= -4.5e+143) {
		tmp = (x * y) + (c * i);
	} else if ((x * y) <= 1.36e-204) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 7.5e+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 (x * y) <= -4.5e+143:
		tmp = (x * y) + (c * i)
	elif (x * y) <= 1.36e-204:
		tmp = (a * b) + (z * t)
	elif (x * y) <= 7.5e+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(x * y) <= -4.5e+143)
		tmp = Float64(Float64(x * y) + Float64(c * i));
	elseif (Float64(x * y) <= 1.36e-204)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif (Float64(x * y) <= 7.5e+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 ((x * y) <= -4.5e+143)
		tmp = (x * y) + (c * i);
	elseif ((x * y) <= 1.36e-204)
		tmp = (a * b) + (z * t);
	elseif ((x * y) <= 7.5e+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[LessEqual[N[(x * y), $MachinePrecision], -4.5e+143], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.36e-204], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 7.5e+78], 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}\;x \cdot y \leq -4.5 \cdot 10^{+143}:\\
\;\;\;\;x \cdot y + c \cdot i\\

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

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

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


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

    1. Initial program 89.3%

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

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

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

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

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

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

    if -4.4999999999999997e143 < (*.f64 x y) < 1.3600000000000001e-204

    1. Initial program 98.4%

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

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

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

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

    if 1.3600000000000001e-204 < (*.f64 x y) < 7.49999999999999934e78

    1. Initial program 97.8%

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

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

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

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

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

    if 7.49999999999999934e78 < (*.f64 x y)

    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-define99.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. Simplified99.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 c around 0 80.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.5 \cdot 10^{+143}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.36 \cdot 10^{-204}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+78}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 66.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.50000000000000002e69 or 1.1999999999999999e77 < (*.f64 x y)

    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-define94.9%

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

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

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

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

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

    if -5.50000000000000002e69 < (*.f64 x y) < 1.1e-201

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

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

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

    if 1.1e-201 < (*.f64 x y) < 1.1999999999999999e77

    1. Initial program 97.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+69}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{-201}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+77}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y + a \cdot b\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.99999999999999945e65 or 3.4000000000000001e110 < (*.f64 x y)

    1. Initial program 94.5%

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

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

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

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

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

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

    if -9.99999999999999945e65 < (*.f64 x y) < 4.7e-219

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

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

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

    if 4.7e-219 < (*.f64 x y) < 3.4000000000000001e110

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

Alternative 10: 62.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.1 \cdot 10^{+145}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 5.3 \cdot 10^{-219}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+256}:\\ \;\;\;\;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) -3.1e+145)
   (* x y)
   (if (<= (* x y) 5.3e-219)
     (+ (* a b) (* z t))
     (if (<= (* x y) 8.8e+256) (+ (* 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) <= -3.1e+145) {
		tmp = x * y;
	} else if ((x * y) <= 5.3e-219) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 8.8e+256) {
		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) <= (-3.1d+145)) then
        tmp = x * y
    else if ((x * y) <= 5.3d-219) then
        tmp = (a * b) + (z * t)
    else if ((x * y) <= 8.8d+256) 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) <= -3.1e+145) {
		tmp = x * y;
	} else if ((x * y) <= 5.3e-219) {
		tmp = (a * b) + (z * t);
	} else if ((x * y) <= 8.8e+256) {
		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) <= -3.1e+145:
		tmp = x * y
	elif (x * y) <= 5.3e-219:
		tmp = (a * b) + (z * t)
	elif (x * y) <= 8.8e+256:
		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) <= -3.1e+145)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 5.3e-219)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif (Float64(x * y) <= 8.8e+256)
		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) <= -3.1e+145)
		tmp = x * y;
	elseif ((x * y) <= 5.3e-219)
		tmp = (a * b) + (z * t);
	elseif ((x * y) <= 8.8e+256)
		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], -3.1e+145], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.3e-219], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.8e+256], 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 -3.1 \cdot 10^{+145}:\\
\;\;\;\;x \cdot y\\

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

\mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+256}:\\
\;\;\;\;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) < -3.09999999999999988e145 or 8.7999999999999997e256 < (*.f64 x y)

    1. Initial program 90.7%

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

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

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

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

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

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

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

    if -3.09999999999999988e145 < (*.f64 x y) < 5.3000000000000003e-219

    1. Initial program 98.4%

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

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

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

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

    if 5.3000000000000003e-219 < (*.f64 x y) < 8.7999999999999997e256

    1. Initial program 98.6%

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

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

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

        \[\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 x around 0 82.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.1 \cdot 10^{+145}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 5.3 \cdot 10^{-219}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+256}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 87.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -7.6 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 7.4 \cdot 10^{+47}\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 (or (<= (* c i) -7.6e+39) (not (<= (* c i) 7.4e+47)))
   (+ (* 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) <= -7.6e+39) || !((c * i) <= 7.4e+47)) {
		tmp = (a * b) + ((c * i) + (z * t));
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-7.6d+39)) .or. (.not. ((c * i) <= 7.4d+47))) then
        tmp = (a * b) + ((c * i) + (z * t))
    else
        tmp = (a * b) + ((x * y) + (z * t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -7.6e+39) || !((c * i) <= 7.4e+47)) {
		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) <= -7.6e+39) or not ((c * i) <= 7.4e+47):
		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) <= -7.6e+39) || !(Float64(c * i) <= 7.4e+47))
		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) <= -7.6e+39) || ~(((c * i) <= 7.4e+47)))
		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[Or[LessEqual[N[(c * i), $MachinePrecision], -7.6e+39], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.4e+47]], $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 -7.6 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 7.4 \cdot 10^{+47}\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 2 regimes
  2. if (*.f64 c i) < -7.5999999999999996e39 or 7.40000000000000081e47 < (*.f64 c i)

    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-define99.0%

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

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

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

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

    if -7.5999999999999996e39 < (*.f64 c i) < 7.40000000000000081e47

    1. Initial program 96.6%

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

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

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

        \[\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-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 c around 0 92.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -7.6 \cdot 10^{+39} \lor \neg \left(c \cdot i \leq 7.4 \cdot 10^{+47}\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 12: 84.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+158} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+206}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.9999999999999996e158 or 2.0000000000000001e206 < (*.f64 x y)

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

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

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

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

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

    if -4.9999999999999996e158 < (*.f64 x y) < 2.0000000000000001e206

    1. Initial program 98.4%

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

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

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

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

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

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

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

Alternative 13: 86.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+94}:\\
\;\;\;\;a \cdot b + t\_1\\

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


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

    1. Initial program 91.6%

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

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

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

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

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

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

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

        \[\leadsto a \cdot b + i \cdot \left(c + \color{blue}{t \cdot \frac{z}{i}}\right) \]
    8. Simplified100.0%

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

    if -5.00000000000000034e245 < (*.f64 c i) < 2e94

    1. Initial program 96.7%

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

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

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

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

    if 2e94 < (*.f64 c i)

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

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

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

Alternative 14: 43.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-202}:\\
\;\;\;\;z \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.94999999999999995e76 or 5.49999999999999996e110 < (*.f64 x y)

    1. Initial program 94.5%

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{a \cdot b + \left(x \cdot y + z \cdot t\right)}\right) \]
      4. fma-define97.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.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. Simplified98.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 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 75.6%

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

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

    if -1.94999999999999995e76 < (*.f64 x y) < 6.4000000000000002e-202

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

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

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

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

    if 6.4000000000000002e-202 < (*.f64 x y) < 5.49999999999999996e110

    1. Initial program 98.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.95 \cdot 10^{+76}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-202}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{+110}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 42.5% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.11999999999999997e179 or 8.99999999999999965e149 < (*.f64 a b)

    1. Initial program 92.9%

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

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

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

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

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

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

    if -1.11999999999999997e179 < (*.f64 a b) < 4.3999999999999999e-188

    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-define99.1%

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

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

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

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

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

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

    if 4.3999999999999999e-188 < (*.f64 a b) < 8.99999999999999965e149

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.12 \cdot 10^{+179}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 4.4 \cdot 10^{-188}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 9 \cdot 10^{+149}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 62.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.25 \cdot 10^{+73} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+255}\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) -1.25e+73) (not (<= (* x y) 4e+255)))
   (* 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) <= -1.25e+73) || !((x * y) <= 4e+255)) {
		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) <= (-1.25d+73)) .or. (.not. ((x * y) <= 4d+255))) 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) <= -1.25e+73) || !((x * y) <= 4e+255)) {
		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) <= -1.25e+73) or not ((x * y) <= 4e+255):
		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) <= -1.25e+73) || !(Float64(x * y) <= 4e+255))
		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) <= -1.25e+73) || ~(((x * y) <= 4e+255)))
		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], -1.25e+73], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4e+255]], $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 -1.25 \cdot 10^{+73} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+255}\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) < -1.24999999999999994e73 or 3.99999999999999995e255 < (*.f64 x y)

    1. Initial program 92.6%

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

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

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

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

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

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

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

    if -1.24999999999999994e73 < (*.f64 x y) < 3.99999999999999995e255

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

Alternative 17: 43.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.2 \cdot 10^{+109} \lor \neg \left(c \cdot i \leq 4.9 \cdot 10^{+145}\right):\\
\;\;\;\;c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.2000000000000001e109 or 4.90000000000000003e145 < (*.f64 c i)

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

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

    if -3.2000000000000001e109 < (*.f64 c i) < 4.90000000000000003e145

    1. Initial program 96.6%

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

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

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

        \[\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.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. Simplified98.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 a around inf 35.3%

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

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

Alternative 18: 27.5% 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 96.8%

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

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

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

      \[\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-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 a around inf 27.1%

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

Reproduce

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