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

Percentage Accurate: 95.6% → 98.0%
Time: 17.3s
Alternatives: 18
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 0.1× speedup?

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


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

    1. Initial program 100.0%

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

    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-def28.6%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{a \cdot b + x \cdot y}\right) \]
    5. Step-by-step derivation
      1. fma-def57.1%

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

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

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

Alternative 4: 97.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. 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-def28.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef35.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, y, z \cdot t\right) - a \cdot b}{\mathsf{fma}\left(x, y, z \cdot t\right) \cdot \mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot b\right) \cdot \left(a \cdot b\right)}}}\right) \]
      8. clear-num0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 97.6% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. 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-def28.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef35.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, y, z \cdot t\right) - a \cdot b}{\mathsf{fma}\left(x, y, z \cdot t\right) \cdot \mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot b\right) \cdot \left(a \cdot b\right)}}}\right) \]
      8. clear-num0.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative28.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(x, y, a \cdot b\right)\right)} \]
      7. fma-udef50.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 44.5%

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
    10. Step-by-step derivation
      1. fma-def44.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, b, x \cdot y\right)} \]
    11. Simplified44.5%

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

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

Alternative 6: 58.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+134}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{+72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{+72}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{-164}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 10^{+84}\right) \land x \cdot y \leq 1.76 \cdot 10^{+161}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))))
   (if (<= (* x y) -8.2e+134)
     (* x y)
     (if (<= (* x y) -2.9e+72)
       (* z t)
       (if (<= (* x y) -2.5e+72)
         (* x y)
         (if (<= (* x y) 0.0)
           t_1
           (if (<= (* x y) 1.2e-164)
             (* z t)
             (if (or (<= (* x y) 2.1e+36)
                     (and (not (<= (* x y) 1e+84)) (<= (* x y) 1.76e+161)))
               t_1
               (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -8.2e+134) {
		tmp = x * y;
	} else if ((x * y) <= -2.9e+72) {
		tmp = z * t;
	} else if ((x * y) <= -2.5e+72) {
		tmp = x * y;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.2e-164) {
		tmp = z * t;
	} else if (((x * y) <= 2.1e+36) || (!((x * y) <= 1e+84) && ((x * y) <= 1.76e+161))) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    if ((x * y) <= (-8.2d+134)) then
        tmp = x * y
    else if ((x * y) <= (-2.9d+72)) then
        tmp = z * t
    else if ((x * y) <= (-2.5d+72)) then
        tmp = x * y
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 1.2d-164) then
        tmp = z * t
    else if (((x * y) <= 2.1d+36) .or. (.not. ((x * y) <= 1d+84)) .and. ((x * y) <= 1.76d+161)) then
        tmp = t_1
    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 t_1 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -8.2e+134) {
		tmp = x * y;
	} else if ((x * y) <= -2.9e+72) {
		tmp = z * t;
	} else if ((x * y) <= -2.5e+72) {
		tmp = x * y;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 1.2e-164) {
		tmp = z * t;
	} else if (((x * y) <= 2.1e+36) || (!((x * y) <= 1e+84) && ((x * y) <= 1.76e+161))) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -8.2e+134:
		tmp = x * y
	elif (x * y) <= -2.9e+72:
		tmp = z * t
	elif (x * y) <= -2.5e+72:
		tmp = x * y
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 1.2e-164:
		tmp = z * t
	elif ((x * y) <= 2.1e+36) or (not ((x * y) <= 1e+84) and ((x * y) <= 1.76e+161)):
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(c * i))
	tmp = 0.0
	if (Float64(x * y) <= -8.2e+134)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -2.9e+72)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= -2.5e+72)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.2e-164)
		tmp = Float64(z * t);
	elseif ((Float64(x * y) <= 2.1e+36) || (!(Float64(x * y) <= 1e+84) && (Float64(x * y) <= 1.76e+161)))
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (c * i);
	tmp = 0.0;
	if ((x * y) <= -8.2e+134)
		tmp = x * y;
	elseif ((x * y) <= -2.9e+72)
		tmp = z * t;
	elseif ((x * y) <= -2.5e+72)
		tmp = x * y;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 1.2e-164)
		tmp = z * t;
	elseif (((x * y) <= 2.1e+36) || (~(((x * y) <= 1e+84)) && ((x * y) <= 1.76e+161)))
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e+134], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.9e+72], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.5e+72], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.2e-164], N[(z * t), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 2.1e+36], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+84]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 1.76e+161]]], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{+72}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 10^{+84}\right) \land x \cdot y \leq 1.76 \cdot 10^{+161}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -8.2000000000000007e134 or -2.90000000000000017e72 < (*.f64 x y) < -2.49999999999999996e72 or 2.10000000000000004e36 < (*.f64 x y) < 1.00000000000000006e84 or 1.75999999999999994e161 < (*.f64 x y)

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

    if -8.2000000000000007e134 < (*.f64 x y) < -2.90000000000000017e72 or -0.0 < (*.f64 x y) < 1.19999999999999992e-164

    1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.49999999999999996e72 < (*.f64 x y) < -0.0 or 1.19999999999999992e-164 < (*.f64 x y) < 2.10000000000000004e36 or 1.00000000000000006e84 < (*.f64 x y) < 1.75999999999999994e161

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+134}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{+72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{+72}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{-164}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 10^{+84}\right) \land x \cdot y \leq 1.76 \cdot 10^{+161}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 62.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ t_2 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+224}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -3700000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{-58}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+84}\right) \land x \cdot y \leq 1.55 \cdot 10^{+161}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* z t))) (t_2 (+ (* a b) (* c i))))
   (if (<= (* x y) -6.2e+224)
     (* x y)
     (if (<= (* x y) -1.5e+73)
       t_1
       (if (<= (* x y) -3700000000000.0)
         t_2
         (if (<= (* x y) 8e-58)
           t_1
           (if (or (<= (* x y) 1.65e+36)
                   (and (not (<= (* x y) 1.15e+84)) (<= (* x y) 1.55e+161)))
             t_2
             (* x y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -6.2e+224) {
		tmp = x * y;
	} else if ((x * y) <= -1.5e+73) {
		tmp = t_1;
	} else if ((x * y) <= -3700000000000.0) {
		tmp = t_2;
	} else if ((x * y) <= 8e-58) {
		tmp = t_1;
	} else if (((x * y) <= 1.65e+36) || (!((x * y) <= 1.15e+84) && ((x * y) <= 1.55e+161))) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (a * b) + (c * i)
    if ((x * y) <= (-6.2d+224)) then
        tmp = x * y
    else if ((x * y) <= (-1.5d+73)) then
        tmp = t_1
    else if ((x * y) <= (-3700000000000.0d0)) then
        tmp = t_2
    else if ((x * y) <= 8d-58) then
        tmp = t_1
    else if (((x * y) <= 1.65d+36) .or. (.not. ((x * y) <= 1.15d+84)) .and. ((x * y) <= 1.55d+161)) then
        tmp = t_2
    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 t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -6.2e+224) {
		tmp = x * y;
	} else if ((x * y) <= -1.5e+73) {
		tmp = t_1;
	} else if ((x * y) <= -3700000000000.0) {
		tmp = t_2;
	} else if ((x * y) <= 8e-58) {
		tmp = t_1;
	} else if (((x * y) <= 1.65e+36) || (!((x * y) <= 1.15e+84) && ((x * y) <= 1.55e+161))) {
		tmp = t_2;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -6.2e+224:
		tmp = x * y
	elif (x * y) <= -1.5e+73:
		tmp = t_1
	elif (x * y) <= -3700000000000.0:
		tmp = t_2
	elif (x * y) <= 8e-58:
		tmp = t_1
	elif ((x * y) <= 1.65e+36) or (not ((x * y) <= 1.15e+84) and ((x * y) <= 1.55e+161)):
		tmp = t_2
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	t_2 = Float64(Float64(a * b) + Float64(c * i))
	tmp = 0.0
	if (Float64(x * y) <= -6.2e+224)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.5e+73)
		tmp = t_1;
	elseif (Float64(x * y) <= -3700000000000.0)
		tmp = t_2;
	elseif (Float64(x * y) <= 8e-58)
		tmp = t_1;
	elseif ((Float64(x * y) <= 1.65e+36) || (!(Float64(x * y) <= 1.15e+84) && (Float64(x * y) <= 1.55e+161)))
		tmp = t_2;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (z * t);
	t_2 = (a * b) + (c * i);
	tmp = 0.0;
	if ((x * y) <= -6.2e+224)
		tmp = x * y;
	elseif ((x * y) <= -1.5e+73)
		tmp = t_1;
	elseif ((x * y) <= -3700000000000.0)
		tmp = t_2;
	elseif ((x * y) <= 8e-58)
		tmp = t_1;
	elseif (((x * y) <= 1.65e+36) || (~(((x * y) <= 1.15e+84)) && ((x * y) <= 1.55e+161)))
		tmp = t_2;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -6.2e+224], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.5e+73], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3700000000000.0], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 8e-58], t$95$1, If[Or[LessEqual[N[(x * y), $MachinePrecision], 1.65e+36], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.15e+84]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 1.55e+161]]], t$95$2, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{+73}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -3700000000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{-58}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+84}\right) \land x \cdot y \leq 1.55 \cdot 10^{+161}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -6.1999999999999999e224 or 1.6499999999999999e36 < (*.f64 x y) < 1.1499999999999999e84 or 1.55000000000000003e161 < (*.f64 x y)

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999999e224 < (*.f64 x y) < -1.50000000000000005e73 or -3.7e12 < (*.f64 x y) < 8.0000000000000002e-58

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative83.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in x around 0 76.1%

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

    if -1.50000000000000005e73 < (*.f64 x y) < -3.7e12 or 8.0000000000000002e-58 < (*.f64 x y) < 1.6499999999999999e36 or 1.1499999999999999e84 < (*.f64 x y) < 1.55000000000000003e161

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+224}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{+73}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -3700000000000:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{-58}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.65 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+84}\right) \land x \cdot y \leq 1.55 \cdot 10^{+161}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 8: 43.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6 \cdot 10^{+134}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.2 \cdot 10^{+74}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+66}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -17000000:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{-49}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+32}:\\ \;\;\;\;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) -6e+134)
   (* x y)
   (if (<= (* x y) -3.2e+74)
     (* z t)
     (if (<= (* x y) -1.46e+66)
       (* x y)
       (if (<= (* x y) -17000000.0)
         (* c i)
         (if (<= (* x y) 0.0)
           (* a b)
           (if (<= (* x y) 5.5e-49)
             (* z t)
             (if (<= (* x y) 1.55e+32) (* 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) <= -6e+134) {
		tmp = x * y;
	} else if ((x * y) <= -3.2e+74) {
		tmp = z * t;
	} else if ((x * y) <= -1.46e+66) {
		tmp = x * y;
	} else if ((x * y) <= -17000000.0) {
		tmp = c * i;
	} else if ((x * y) <= 0.0) {
		tmp = a * b;
	} else if ((x * y) <= 5.5e-49) {
		tmp = z * t;
	} else if ((x * y) <= 1.55e+32) {
		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) <= (-6d+134)) then
        tmp = x * y
    else if ((x * y) <= (-3.2d+74)) then
        tmp = z * t
    else if ((x * y) <= (-1.46d+66)) then
        tmp = x * y
    else if ((x * y) <= (-17000000.0d0)) then
        tmp = c * i
    else if ((x * y) <= 0.0d0) then
        tmp = a * b
    else if ((x * y) <= 5.5d-49) then
        tmp = z * t
    else if ((x * y) <= 1.55d+32) 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) <= -6e+134) {
		tmp = x * y;
	} else if ((x * y) <= -3.2e+74) {
		tmp = z * t;
	} else if ((x * y) <= -1.46e+66) {
		tmp = x * y;
	} else if ((x * y) <= -17000000.0) {
		tmp = c * i;
	} else if ((x * y) <= 0.0) {
		tmp = a * b;
	} else if ((x * y) <= 5.5e-49) {
		tmp = z * t;
	} else if ((x * y) <= 1.55e+32) {
		tmp = c * i;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -6e+134:
		tmp = x * y
	elif (x * y) <= -3.2e+74:
		tmp = z * t
	elif (x * y) <= -1.46e+66:
		tmp = x * y
	elif (x * y) <= -17000000.0:
		tmp = c * i
	elif (x * y) <= 0.0:
		tmp = a * b
	elif (x * y) <= 5.5e-49:
		tmp = z * t
	elif (x * y) <= 1.55e+32:
		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) <= -6e+134)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -3.2e+74)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= -1.46e+66)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -17000000.0)
		tmp = Float64(c * i);
	elseif (Float64(x * y) <= 0.0)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= 5.5e-49)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 1.55e+32)
		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) <= -6e+134)
		tmp = x * y;
	elseif ((x * y) <= -3.2e+74)
		tmp = z * t;
	elseif ((x * y) <= -1.46e+66)
		tmp = x * y;
	elseif ((x * y) <= -17000000.0)
		tmp = c * i;
	elseif ((x * y) <= 0.0)
		tmp = a * b;
	elseif ((x * y) <= 5.5e-49)
		tmp = z * t;
	elseif ((x * y) <= 1.55e+32)
		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], -6e+134], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.2e+74], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.46e+66], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -17000000.0], N[(c * i), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 0.0], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5.5e-49], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.55e+32], N[(c * i), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+66}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -17000000:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;a \cdot b\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -5.99999999999999993e134 or -3.19999999999999995e74 < (*.f64 x y) < -1.45999999999999995e66 or 1.54999999999999997e32 < (*.f64 x y)

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999993e134 < (*.f64 x y) < -3.19999999999999995e74 or -0.0 < (*.f64 x y) < 5.50000000000000031e-49

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.45999999999999995e66 < (*.f64 x y) < -1.7e7 or 5.50000000000000031e-49 < (*.f64 x y) < 1.54999999999999997e32

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e7 < (*.f64 x y) < -0.0

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6 \cdot 10^{+134}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.2 \cdot 10^{+74}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+66}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -17000000:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 5.5 \cdot 10^{-49}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{+32}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 66.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + z \cdot t\\ t_2 := a \cdot b + x \cdot y\\ t_3 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -3.05 \cdot 10^{+134}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -5.2 \cdot 10^{+106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{+70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -9500000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-38}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 9.4 \cdot 10^{+32}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* z t)))
        (t_2 (+ (* a b) (* x y)))
        (t_3 (+ (* a b) (* c i))))
   (if (<= (* x y) -3.05e+134)
     t_2
     (if (<= (* x y) -5.2e+106)
       t_1
       (if (<= (* x y) -4.5e+70)
         t_2
         (if (<= (* x y) -9500000000000.0)
           t_3
           (if (<= (* x y) 1.3e-38)
             t_1
             (if (<= (* x y) 9.4e+32) t_3 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (x * y);
	double t_3 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -3.05e+134) {
		tmp = t_2;
	} else if ((x * y) <= -5.2e+106) {
		tmp = t_1;
	} else if ((x * y) <= -4.5e+70) {
		tmp = t_2;
	} else if ((x * y) <= -9500000000000.0) {
		tmp = t_3;
	} else if ((x * y) <= 1.3e-38) {
		tmp = t_1;
	} else if ((x * y) <= 9.4e+32) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (a * b) + (x * y)
    t_3 = (a * b) + (c * i)
    if ((x * y) <= (-3.05d+134)) then
        tmp = t_2
    else if ((x * y) <= (-5.2d+106)) then
        tmp = t_1
    else if ((x * y) <= (-4.5d+70)) then
        tmp = t_2
    else if ((x * y) <= (-9500000000000.0d0)) then
        tmp = t_3
    else if ((x * y) <= 1.3d-38) then
        tmp = t_1
    else if ((x * y) <= 9.4d+32) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (a * b) + (x * y);
	double t_3 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -3.05e+134) {
		tmp = t_2;
	} else if ((x * y) <= -5.2e+106) {
		tmp = t_1;
	} else if ((x * y) <= -4.5e+70) {
		tmp = t_2;
	} else if ((x * y) <= -9500000000000.0) {
		tmp = t_3;
	} else if ((x * y) <= 1.3e-38) {
		tmp = t_1;
	} else if ((x * y) <= 9.4e+32) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (a * b) + (x * y)
	t_3 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -3.05e+134:
		tmp = t_2
	elif (x * y) <= -5.2e+106:
		tmp = t_1
	elif (x * y) <= -4.5e+70:
		tmp = t_2
	elif (x * y) <= -9500000000000.0:
		tmp = t_3
	elif (x * y) <= 1.3e-38:
		tmp = t_1
	elif (x * y) <= 9.4e+32:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	t_2 = Float64(Float64(a * b) + Float64(x * y))
	t_3 = Float64(Float64(a * b) + Float64(c * i))
	tmp = 0.0
	if (Float64(x * y) <= -3.05e+134)
		tmp = t_2;
	elseif (Float64(x * y) <= -5.2e+106)
		tmp = t_1;
	elseif (Float64(x * y) <= -4.5e+70)
		tmp = t_2;
	elseif (Float64(x * y) <= -9500000000000.0)
		tmp = t_3;
	elseif (Float64(x * y) <= 1.3e-38)
		tmp = t_1;
	elseif (Float64(x * y) <= 9.4e+32)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (z * t);
	t_2 = (a * b) + (x * y);
	t_3 = (a * b) + (c * i);
	tmp = 0.0;
	if ((x * y) <= -3.05e+134)
		tmp = t_2;
	elseif ((x * y) <= -5.2e+106)
		tmp = t_1;
	elseif ((x * y) <= -4.5e+70)
		tmp = t_2;
	elseif ((x * y) <= -9500000000000.0)
		tmp = t_3;
	elseif ((x * y) <= 1.3e-38)
		tmp = t_1;
	elseif ((x * y) <= 9.4e+32)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.05e+134], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+106], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -4.5e+70], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -9500000000000.0], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 1.3e-38], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 9.4e+32], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -5.2 \cdot 10^{+106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{+70}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -9500000000000:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 9.4 \cdot 10^{+32}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -3.04999999999999989e134 or -5.20000000000000039e106 < (*.f64 x y) < -4.4999999999999999e70 or 9.40000000000000047e32 < (*.f64 x y)

    1. Initial program 93.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative89.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(x, y, a \cdot b\right)\right)} \]
      7. fma-udef90.1%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 78.1%

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

    if -3.04999999999999989e134 < (*.f64 x y) < -5.20000000000000039e106 or -9.5e12 < (*.f64 x y) < 1.30000000000000005e-38

    1. Initial program 95.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative82.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(x, y, a \cdot b\right)\right)} \]
      7. fma-udef83.8%

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

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

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

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

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

    if -4.4999999999999999e70 < (*.f64 x y) < -9.5e12 or 1.30000000000000005e-38 < (*.f64 x y) < 9.40000000000000047e32

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.05 \cdot 10^{+134}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -5.2 \cdot 10^{+106}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{+70}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9500000000000:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{-38}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 9.4 \cdot 10^{+32}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 10: 66.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -4.35 \cdot 10^{+18}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+84}:\\
\;\;\;\;a \cdot b + x \cdot y\\

\mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{+161}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -3.20000000000000019e64 or 1.9000000000000001e161 < (*.f64 x y)

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative91.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in a around 0 83.3%

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

    if -3.20000000000000019e64 < (*.f64 x y) < -4.35e18 or 1.60000000000000005e84 < (*.f64 x y) < 1.9000000000000001e161

    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-def87.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. associate-+r+87.5%

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

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

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

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

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

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

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

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

    if -4.35e18 < (*.f64 x y) < 6.79999999999999954e-134

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative83.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in x around 0 80.3%

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

    if 6.79999999999999954e-134 < (*.f64 x y) < 4.70000000000000023e32

    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-def100.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. associate-+r+100.0%

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

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

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

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

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

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

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

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

    if 4.70000000000000023e32 < (*.f64 x y) < 1.60000000000000005e84

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 87.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+64}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -4.35 \cdot 10^{+18}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 6.8 \cdot 10^{-134}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 4.7 \cdot 10^{+32}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.6 \cdot 10^{+84}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 1.9 \cdot 10^{+161}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \end{array} \]

Alternative 11: 97.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. 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-def28.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef35.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, y, z \cdot t\right) - a \cdot b}{\mathsf{fma}\left(x, y, z \cdot t\right) \cdot \mathsf{fma}\left(x, y, z \cdot t\right) - \left(a \cdot b\right) \cdot \left(a \cdot b\right)}}}\right) \]
      8. clear-num0.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative28.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(x, y, a \cdot b\right)\right)} \]
      7. fma-udef50.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 44.5%

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

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

Alternative 12: 83.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 10^{+84}\right) \land x \cdot y \leq 9.5 \cdot 10^{+161}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot y + z \cdot t\\


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

    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-def94.6%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative91.9%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(x, y, a \cdot b\right)\right)} \]
      7. fma-udef94.6%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 86.8%

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

    if -1.9000000000000001e135 < (*.f64 x y) < 2.10000000000000004e36 or 1.00000000000000006e84 < (*.f64 x y) < 9.50000000000000061e161

    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-def96.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. associate-+r+96.6%

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

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

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

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

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

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

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

    if 2.10000000000000004e36 < (*.f64 x y) < 1.00000000000000006e84 or 9.50000000000000061e161 < (*.f64 x y)

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative93.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in a around 0 88.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.9 \cdot 10^{+135}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 2.1 \cdot 10^{+36} \lor \neg \left(x \cdot y \leq 10^{+84}\right) \land x \cdot y \leq 9.5 \cdot 10^{+161}:\\ \;\;\;\;a \cdot b + \left(c \cdot i + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \end{array} \]

Alternative 13: 66.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2800000000000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+32}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.38e134 or 3.8000000000000003e32 < (*.f64 x y)

    1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative89.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in t around 0 79.8%

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

    if -1.38e134 < (*.f64 x y) < -2.8e12 or 6.50000000000000011e-136 < (*.f64 x y) < 3.8000000000000003e32

    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-def96.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. associate-+r+96.6%

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

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

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

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

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

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

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

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

    if -2.8e12 < (*.f64 x y) < 6.50000000000000011e-136

    1. Initial program 95.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    7. Step-by-step derivation
      1. +-commutative83.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, \mathsf{fma}\left(a, b, x \cdot y\right)\right)} \]
    9. Taylor expanded in x around 0 80.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.38 \cdot 10^{+134}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2800000000000:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{-136}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+32}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 14: 42.3% accurate, 0.8× speedup?

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

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

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

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

\mathbf{elif}\;c \cdot i \leq 4.9 \cdot 10^{+123}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -9.5000000000000006e167 or 4.89999999999999976e123 < (*.f64 c i)

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

    if -9.5000000000000006e167 < (*.f64 c i) < -2.59999999999999996e-131 or -3.7000000000000003e-273 < (*.f64 c i) < 4.89999999999999976e123

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999996e-131 < (*.f64 c i) < -3.7000000000000003e-273

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -9.5 \cdot 10^{+167}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.6 \cdot 10^{-131}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -3.7 \cdot 10^{-273}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 4.9 \cdot 10^{+123}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 15: 87.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.75 \cdot 10^{+134} \lor \neg \left(x \cdot y \leq 2.3 \cdot 10^{+31}\right):\\ \;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\right)\\ \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) -2.75e+134) (not (<= (* x y) 2.3e+31)))
   (+ (* a b) (+ (* 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) <= -2.75e+134) || !((x * y) <= 2.3e+31)) {
		tmp = (a * b) + ((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) <= (-2.75d+134)) .or. (.not. ((x * y) <= 2.3d+31))) then
        tmp = (a * b) + ((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) <= -2.75e+134) || !((x * y) <= 2.3e+31)) {
		tmp = (a * b) + ((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) <= -2.75e+134) or not ((x * y) <= 2.3e+31):
		tmp = (a * b) + ((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) <= -2.75e+134) || !(Float64(x * y) <= 2.3e+31))
		tmp = Float64(Float64(a * b) + 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) <= -2.75e+134) || ~(((x * y) <= 2.3e+31)))
		tmp = (a * b) + ((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], -2.75e+134], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.3e+31]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $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 -2.75 \cdot 10^{+134} \lor \neg \left(x \cdot y \leq 2.3 \cdot 10^{+31}\right):\\
\;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\right)\\

\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) < -2.7499999999999999e134 or 2.3e31 < (*.f64 x y)

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

    if -2.7499999999999999e134 < (*.f64 x y) < 2.3e31

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 87.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5.5 \cdot 10^{+166} \lor \neg \left(c \cdot i \leq 1.35 \cdot 10^{+125}\right):\\ \;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\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) -5.5e+166) (not (<= (* c i) 1.35e+125)))
   (+ (* a b) (+ (* x y) (* c i)))
   (+ (* 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) <= -5.5e+166) || !((c * i) <= 1.35e+125)) {
		tmp = (a * b) + ((x * y) + (c * i));
	} 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) <= (-5.5d+166)) .or. (.not. ((c * i) <= 1.35d+125))) then
        tmp = (a * b) + ((x * y) + (c * i))
    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) <= -5.5e+166) || !((c * i) <= 1.35e+125)) {
		tmp = (a * b) + ((x * y) + (c * i));
	} 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) <= -5.5e+166) or not ((c * i) <= 1.35e+125):
		tmp = (a * b) + ((x * y) + (c * i))
	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) <= -5.5e+166) || !(Float64(c * i) <= 1.35e+125))
		tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(c * i)));
	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) <= -5.5e+166) || ~(((c * i) <= 1.35e+125)))
		tmp = (a * b) + ((x * y) + (c * i));
	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], -5.5e+166], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.35e+125]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(c * i), $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 -5.5 \cdot 10^{+166} \lor \neg \left(c \cdot i \leq 1.35 \cdot 10^{+125}\right):\\
\;\;\;\;a \cdot b + \left(x \cdot y + c \cdot i\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) < -5.50000000000000008e166 or 1.3499999999999999e125 < (*.f64 c i)

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

    if -5.50000000000000008e166 < (*.f64 c i) < 1.3499999999999999e125

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 42.0% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -1.74999999999999999e93 or 2.6999999999999999e184 < (*.f64 c i)

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

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

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

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

    if -1.74999999999999999e93 < (*.f64 c i) < 2.6999999999999999e184

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.75 \cdot 10^{+93}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 2.7 \cdot 10^{+184}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 18: 27.6% accurate, 5.0× speedup?

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

\\
a \cdot b
\end{array}
Derivation
  1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{a \cdot b} \]
  5. Final simplification26.3%

    \[\leadsto a \cdot b \]

Reproduce

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