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

Percentage Accurate: 95.8% → 97.9%
Time: 11.9s
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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.9% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \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 z t (fma c i (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(z, t, fma(c, i, fma(x, y, (a * b))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(z, t, fma(c, i, fma(x, y, Float64(a * b))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(c * i + N[(x * y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, a \cdot b\right)\right)\right)
\end{array}
Derivation
  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. associate-+l+96.5%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.1% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, a \cdot b\right) + c \cdot i\right)
\end{array}
Derivation
  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. associate-+l+96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.7% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, 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 \]
    2. Step-by-step derivation
      1. associate-+l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, 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 z t (* 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(z, t, (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(z, t, 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[(z * t + 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(z, t, 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. associate-+l+0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.1% 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\\ t_3 := a \cdot b + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+98}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -1.06 \cdot 10^{-242}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{+74}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+223}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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)))
        (t_3 (+ (* a b) (* x y))))
   (if (<= (* x y) -2.1e+98)
     t_3
     (if (<= (* x y) -2.6e+52)
       t_1
       (if (<= (* x y) -1.06e-242)
         t_2
         (if (<= (* x y) 4e+26)
           t_1
           (if (<= (* x y) 1.1e+74)
             t_2
             (if (<= (* x y) 3.8e+151)
               t_1
               (if (<= (* x y) 3.1e+223) t_2 t_3)))))))))
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 t_3 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -2.1e+98) {
		tmp = t_3;
	} else if ((x * y) <= -2.6e+52) {
		tmp = t_1;
	} else if ((x * y) <= -1.06e-242) {
		tmp = t_2;
	} else if ((x * y) <= 4e+26) {
		tmp = t_1;
	} else if ((x * y) <= 1.1e+74) {
		tmp = t_2;
	} else if ((x * y) <= 3.8e+151) {
		tmp = t_1;
	} else if ((x * y) <= 3.1e+223) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	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) + (c * i)
    t_3 = (a * b) + (x * y)
    if ((x * y) <= (-2.1d+98)) then
        tmp = t_3
    else if ((x * y) <= (-2.6d+52)) then
        tmp = t_1
    else if ((x * y) <= (-1.06d-242)) then
        tmp = t_2
    else if ((x * y) <= 4d+26) then
        tmp = t_1
    else if ((x * y) <= 1.1d+74) then
        tmp = t_2
    else if ((x * y) <= 3.8d+151) then
        tmp = t_1
    else if ((x * y) <= 3.1d+223) then
        tmp = t_2
    else
        tmp = t_3
    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 t_3 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -2.1e+98) {
		tmp = t_3;
	} else if ((x * y) <= -2.6e+52) {
		tmp = t_1;
	} else if ((x * y) <= -1.06e-242) {
		tmp = t_2;
	} else if ((x * y) <= 4e+26) {
		tmp = t_1;
	} else if ((x * y) <= 1.1e+74) {
		tmp = t_2;
	} else if ((x * y) <= 3.8e+151) {
		tmp = t_1;
	} else if ((x * y) <= 3.1e+223) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (a * b) + (c * i)
	t_3 = (a * b) + (x * y)
	tmp = 0
	if (x * y) <= -2.1e+98:
		tmp = t_3
	elif (x * y) <= -2.6e+52:
		tmp = t_1
	elif (x * y) <= -1.06e-242:
		tmp = t_2
	elif (x * y) <= 4e+26:
		tmp = t_1
	elif (x * y) <= 1.1e+74:
		tmp = t_2
	elif (x * y) <= 3.8e+151:
		tmp = t_1
	elif (x * y) <= 3.1e+223:
		tmp = t_2
	else:
		tmp = t_3
	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))
	t_3 = Float64(Float64(a * b) + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -2.1e+98)
		tmp = t_3;
	elseif (Float64(x * y) <= -2.6e+52)
		tmp = t_1;
	elseif (Float64(x * y) <= -1.06e-242)
		tmp = t_2;
	elseif (Float64(x * y) <= 4e+26)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.1e+74)
		tmp = t_2;
	elseif (Float64(x * y) <= 3.8e+151)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.1e+223)
		tmp = t_2;
	else
		tmp = t_3;
	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);
	t_3 = (a * b) + (x * y);
	tmp = 0.0;
	if ((x * y) <= -2.1e+98)
		tmp = t_3;
	elseif ((x * y) <= -2.6e+52)
		tmp = t_1;
	elseif ((x * y) <= -1.06e-242)
		tmp = t_2;
	elseif ((x * y) <= 4e+26)
		tmp = t_1;
	elseif ((x * y) <= 1.1e+74)
		tmp = t_2;
	elseif ((x * y) <= 3.8e+151)
		tmp = t_1;
	elseif ((x * y) <= 3.1e+223)
		tmp = t_2;
	else
		tmp = t_3;
	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]}, Block[{t$95$3 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+98], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e+52], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.06e-242], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e+26], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.1e+74], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 3.8e+151], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.1e+223], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -1.06 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{+74}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+223}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.10000000000000004e98 or 3.09999999999999982e223 < (*.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. associate-+l+92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.10000000000000004e98 < (*.f64 x y) < -2.6e52 or -1.06000000000000008e-242 < (*.f64 x y) < 4.00000000000000019e26 or 1.1000000000000001e74 < (*.f64 x y) < 3.8e151

    1. Initial program 99.1%

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

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

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

    if -2.6e52 < (*.f64 x y) < -1.06000000000000008e-242 or 4.00000000000000019e26 < (*.f64 x y) < 1.1000000000000001e74 or 3.8e151 < (*.f64 x y) < 3.09999999999999982e223

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+98}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{+52}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -1.06 \cdot 10^{-242}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+26}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.1 \cdot 10^{+74}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 3.8 \cdot 10^{+151}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 3.1 \cdot 10^{+223}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 6: 66.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ \mathbf{if}\;x \cdot y \leq -1.85 \cdot 10^{+100}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 0.38:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.75 \cdot 10^{+84} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+174}\right) \land x \cdot y \leq 5.5 \cdot 10^{+211}:\\ \;\;\;\;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) (* z t))))
   (if (<= (* x y) -1.85e+100)
     (+ (* c i) (* x y))
     (if (<= (* x y) -4.5e-190)
       t_1
       (if (<= (* x y) 0.38)
         (+ (* a b) (* z t))
         (if (or (<= (* x y) 2.75e+84)
                 (and (not (<= (* x y) 1.1e+174)) (<= (* x y) 5.5e+211)))
           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) + (z * t);
	double tmp;
	if ((x * y) <= -1.85e+100) {
		tmp = (c * i) + (x * y);
	} else if ((x * y) <= -4.5e-190) {
		tmp = t_1;
	} else if ((x * y) <= 0.38) {
		tmp = (a * b) + (z * t);
	} else if (((x * y) <= 2.75e+84) || (!((x * y) <= 1.1e+174) && ((x * y) <= 5.5e+211))) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (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 = (c * i) + (z * t)
    if ((x * y) <= (-1.85d+100)) then
        tmp = (c * i) + (x * y)
    else if ((x * y) <= (-4.5d-190)) then
        tmp = t_1
    else if ((x * y) <= 0.38d0) then
        tmp = (a * b) + (z * t)
    else if (((x * y) <= 2.75d+84) .or. (.not. ((x * y) <= 1.1d+174)) .and. ((x * y) <= 5.5d+211)) then
        tmp = t_1
    else
        tmp = (a * b) + (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 = (c * i) + (z * t);
	double tmp;
	if ((x * y) <= -1.85e+100) {
		tmp = (c * i) + (x * y);
	} else if ((x * y) <= -4.5e-190) {
		tmp = t_1;
	} else if ((x * y) <= 0.38) {
		tmp = (a * b) + (z * t);
	} else if (((x * y) <= 2.75e+84) || (!((x * y) <= 1.1e+174) && ((x * y) <= 5.5e+211))) {
		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) + (z * t)
	tmp = 0
	if (x * y) <= -1.85e+100:
		tmp = (c * i) + (x * y)
	elif (x * y) <= -4.5e-190:
		tmp = t_1
	elif (x * y) <= 0.38:
		tmp = (a * b) + (z * t)
	elif ((x * y) <= 2.75e+84) or (not ((x * y) <= 1.1e+174) and ((x * y) <= 5.5e+211)):
		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(z * t))
	tmp = 0.0
	if (Float64(x * y) <= -1.85e+100)
		tmp = Float64(Float64(c * i) + Float64(x * y));
	elseif (Float64(x * y) <= -4.5e-190)
		tmp = t_1;
	elseif (Float64(x * y) <= 0.38)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif ((Float64(x * y) <= 2.75e+84) || (!(Float64(x * y) <= 1.1e+174) && (Float64(x * y) <= 5.5e+211)))
		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) + (z * t);
	tmp = 0.0;
	if ((x * y) <= -1.85e+100)
		tmp = (c * i) + (x * y);
	elseif ((x * y) <= -4.5e-190)
		tmp = t_1;
	elseif ((x * y) <= 0.38)
		tmp = (a * b) + (z * t);
	elseif (((x * y) <= 2.75e+84) || (~(((x * y) <= 1.1e+174)) && ((x * y) <= 5.5e+211)))
		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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.85e+100], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -4.5e-190], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 0.38], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], 2.75e+84], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.1e+174]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 5.5e+211]]], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 0.38:\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 2.75 \cdot 10^{+84} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+174}\right) \land x \cdot y \leq 5.5 \cdot 10^{+211}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001e100 < (*.f64 x y) < -4.50000000000000021e-190 or 0.38 < (*.f64 x y) < 2.7500000000000002e84 or 1.1000000000000001e174 < (*.f64 x y) < 5.49999999999999988e211

    1. Initial program 97.5%

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

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

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

    if -4.50000000000000021e-190 < (*.f64 x y) < 0.38

    1. Initial program 98.8%

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

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

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

    if 2.7500000000000002e84 < (*.f64 x y) < 1.1000000000000001e174 or 5.49999999999999988e211 < (*.f64 x y)

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.85 \cdot 10^{+100}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-190}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 0.38:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.75 \cdot 10^{+84} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+174}\right) \land x \cdot y \leq 5.5 \cdot 10^{+211}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 7: 97.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;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. associate-+l+0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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 8: 85.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+160}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+105} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+133}\right) \land z \cdot t \leq 2 \cdot 10^{+164}:\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -5.0000000000000002e160

    1. Initial program 91.1%

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

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

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

    if -5.0000000000000002e160 < (*.f64 z t) < 5.00000000000000046e105 or 4.99999999999999961e133 < (*.f64 z t) < 2e164

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000046e105 < (*.f64 z t) < 4.99999999999999961e133 or 2e164 < (*.f64 z t)

    1. Initial program 93.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+160}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+105} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+133}\right) \land z \cdot t \leq 2 \cdot 10^{+164}:\\ \;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 9: 66.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \cdot i \leq 1.32 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 86.1%

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

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

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

    if -8.19999999999999988e150 < (*.f64 c i) < 0.0 or 1.54999999999999991e-38 < (*.f64 c i) < 1.3199999999999999e70

    1. Initial program 100.0%

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

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

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

    if 0.0 < (*.f64 c i) < 1.54999999999999991e-38

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3199999999999999e70 < (*.f64 c i)

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+150}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 0:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.55 \cdot 10^{-38}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 1.32 \cdot 10^{+70}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]

Alternative 10: 88.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5.7 \cdot 10^{+149} \lor \neg \left(c \cdot i \leq 3.4 \cdot 10^{+66}\right):\\ \;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\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.7e+149) (not (<= (* c i) 3.4e+66)))
   (+ (* a b) (+ (* c i) (* x y)))
   (+ (* 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.7e+149) || !((c * i) <= 3.4e+66)) {
		tmp = (a * b) + ((c * i) + (x * y));
	} 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.7d+149)) .or. (.not. ((c * i) <= 3.4d+66))) then
        tmp = (a * b) + ((c * i) + (x * y))
    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.7e+149) || !((c * i) <= 3.4e+66)) {
		tmp = (a * b) + ((c * i) + (x * y));
	} 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.7e+149) or not ((c * i) <= 3.4e+66):
		tmp = (a * b) + ((c * i) + (x * y))
	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.7e+149) || !(Float64(c * i) <= 3.4e+66))
		tmp = Float64(Float64(a * b) + Float64(Float64(c * i) + Float64(x * y)));
	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.7e+149) || ~(((c * i) <= 3.4e+66)))
		tmp = (a * b) + ((c * i) + (x * y));
	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.7e+149], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.4e+66]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(N[(c * i), $MachinePrecision] + N[(x * y), $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.7 \cdot 10^{+149} \lor \neg \left(c \cdot i \leq 3.4 \cdot 10^{+66}\right):\\
\;\;\;\;a \cdot b + \left(c \cdot i + x \cdot y\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.69999999999999965e149 or 3.4000000000000003e66 < (*.f64 c i)

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.69999999999999965e149 < (*.f64 c i) < 3.4000000000000003e66

    1. Initial program 100.0%

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

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

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

Alternative 11: 88.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

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

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


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

    1. Initial program 90.6%

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

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

    if -3.79999999999999971e29 < (*.f64 c i) < 7.0000000000000002e65

    1. Initial program 100.0%

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

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

    if 7.0000000000000002e65 < (*.f64 c i)

    1. Initial program 92.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 59.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;i \leq -1.1 \cdot 10^{-110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;i \leq 3.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;i \leq 1.6 \cdot 10^{-15}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;i \leq 2.1 \cdot 10^{+112}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;i \leq 3.6 \cdot 10^{+178}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))))
   (if (<= i -1.1e-110)
     t_1
     (if (<= i 3.6e-224)
       (+ (* x y) (* z t))
       (if (<= i 1.6e-15)
         (+ (* a b) (* z t))
         (if (<= i 2.1e+112)
           (+ (* a b) (* x y))
           (if (<= i 3.6e+178) t_1 (+ (* c i) (* z t)))))))))
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 (i <= -1.1e-110) {
		tmp = t_1;
	} else if (i <= 3.6e-224) {
		tmp = (x * y) + (z * t);
	} else if (i <= 1.6e-15) {
		tmp = (a * b) + (z * t);
	} else if (i <= 2.1e+112) {
		tmp = (a * b) + (x * y);
	} else if (i <= 3.6e+178) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    if (i <= (-1.1d-110)) then
        tmp = t_1
    else if (i <= 3.6d-224) then
        tmp = (x * y) + (z * t)
    else if (i <= 1.6d-15) then
        tmp = (a * b) + (z * t)
    else if (i <= 2.1d+112) then
        tmp = (a * b) + (x * y)
    else if (i <= 3.6d+178) then
        tmp = t_1
    else
        tmp = (c * i) + (z * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (c * i);
	double tmp;
	if (i <= -1.1e-110) {
		tmp = t_1;
	} else if (i <= 3.6e-224) {
		tmp = (x * y) + (z * t);
	} else if (i <= 1.6e-15) {
		tmp = (a * b) + (z * t);
	} else if (i <= 2.1e+112) {
		tmp = (a * b) + (x * y);
	} else if (i <= 3.6e+178) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	tmp = 0
	if i <= -1.1e-110:
		tmp = t_1
	elif i <= 3.6e-224:
		tmp = (x * y) + (z * t)
	elif i <= 1.6e-15:
		tmp = (a * b) + (z * t)
	elif i <= 2.1e+112:
		tmp = (a * b) + (x * y)
	elif i <= 3.6e+178:
		tmp = t_1
	else:
		tmp = (c * i) + (z * t)
	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 (i <= -1.1e-110)
		tmp = t_1;
	elseif (i <= 3.6e-224)
		tmp = Float64(Float64(x * y) + Float64(z * t));
	elseif (i <= 1.6e-15)
		tmp = Float64(Float64(a * b) + Float64(z * t));
	elseif (i <= 2.1e+112)
		tmp = Float64(Float64(a * b) + Float64(x * y));
	elseif (i <= 3.6e+178)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (c * i);
	tmp = 0.0;
	if (i <= -1.1e-110)
		tmp = t_1;
	elseif (i <= 3.6e-224)
		tmp = (x * y) + (z * t);
	elseif (i <= 1.6e-15)
		tmp = (a * b) + (z * t);
	elseif (i <= 2.1e+112)
		tmp = (a * b) + (x * y);
	elseif (i <= 3.6e+178)
		tmp = t_1;
	else
		tmp = (c * i) + (z * t);
	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[i, -1.1e-110], t$95$1, If[LessEqual[i, 3.6e-224], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.6e-15], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 2.1e+112], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.6e+178], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;i \leq 3.6 \cdot 10^{-224}:\\
\;\;\;\;x \cdot y + z \cdot t\\

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

\mathbf{elif}\;i \leq 2.1 \cdot 10^{+112}:\\
\;\;\;\;a \cdot b + x \cdot y\\

\mathbf{elif}\;i \leq 3.6 \cdot 10^{+178}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if i < -1.1e-110 or 2.0999999999999999e112 < i < 3.5999999999999998e178

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-110 < i < 3.6e-224

    1. Initial program 100.0%

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

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

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

    if 3.6e-224 < i < 1.6e-15

    1. Initial program 97.2%

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

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

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

    if 1.6e-15 < i < 2.0999999999999999e112

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5999999999999998e178 < i

    1. Initial program 88.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{-110}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;i \leq 3.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;i \leq 1.6 \cdot 10^{-15}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;i \leq 2.1 \cdot 10^{+112}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;i \leq 3.6 \cdot 10^{+178}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]

Alternative 13: 37.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq -8 \cdot 10^{-179}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;b \leq 2.7 \cdot 10^{-198}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;b \leq 1.15 \cdot 10^{-25}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{-5}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \leq 2.8 \cdot 10^{+116}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.5500000000000001e107 or 2.80000000000000004e116 < b

    1. Initial program 98.6%

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

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

    if -2.5500000000000001e107 < b < -8.0000000000000002e-179 or 2.7000000000000002e-198 < b < 1.15e-25 or 3.60000000000000009e-5 < b < 2.80000000000000004e116

    1. Initial program 97.5%

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

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

    if -8.0000000000000002e-179 < b < 2.7000000000000002e-198

    1. Initial program 92.2%

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

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

    if 1.15e-25 < b < 3.60000000000000009e-5

    1. Initial program 87.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.55 \cdot 10^{+107}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-179}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-198}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-25}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-5}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{+116}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 14: 62.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+150} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+227}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.35000000000000004e150 or 1.1499999999999999e227 < (*.f64 x y)

    1. Initial program 91.8%

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

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

    if -1.35000000000000004e150 < (*.f64 x y) < 1.1499999999999999e227

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.35 \cdot 10^{+150} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+227}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]

Alternative 15: 37.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;b \leq -1.56 \cdot 10^{-177}:\\
\;\;\;\;z \cdot t\\

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

\mathbf{elif}\;b \leq 2.85 \cdot 10^{+116}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.8000000000000001e111 or 2.84999999999999991e116 < b

    1. Initial program 98.6%

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

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

    if -1.8000000000000001e111 < b < -1.5600000000000001e-177 or 2.5499999999999998e-198 < b < 2.84999999999999991e116

    1. Initial program 96.9%

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

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

    if -1.5600000000000001e-177 < b < 2.5499999999999998e-198

    1. Initial program 92.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8 \cdot 10^{+111}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;b \leq -1.56 \cdot 10^{-177}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{-198}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;b \leq 2.85 \cdot 10^{+116}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 16: 42.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+39} \lor \neg \left(a \cdot b \leq 7.5 \cdot 10^{+122}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5.2e39 or 7.5000000000000002e122 < (*.f64 a b)

    1. Initial program 95.9%

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

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

    if -5.2e39 < (*.f64 a b) < 7.5000000000000002e122

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+39} \lor \neg \left(a \cdot b \leq 7.5 \cdot 10^{+122}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 17: 60.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.1 \cdot 10^{-110} \lor \neg \left(i \leq 6 \cdot 10^{+113}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.1e-110 or 6e113 < i

    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. associate-+l+94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-110 < i < 6e113

    1. Initial program 98.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -1.1 \cdot 10^{-110} \lor \neg \left(i \leq 6 \cdot 10^{+113}\right):\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 18: 27.4% accurate, 5.0× speedup?

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

\\
a \cdot b
\end{array}
Derivation
  1. Initial program 96.5%

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

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

    \[\leadsto a \cdot b \]

Reproduce

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