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

Percentage Accurate: 95.5% → 97.5%
Time: 8.4s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 95.5% accurate, 1.0× speedup?

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

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

Alternative 1: 97.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.9% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

Alternative 3: 97.7% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 59.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + x \cdot y\\ \mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+262}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+206}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{+124}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -3.15 \cdot 10^{-137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \cdot i \leq -1.05 \cdot 10^{-242}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+62} \lor \neg \left(c \cdot i \leq 7.1 \cdot 10^{+115}\right) \land c \cdot i \leq 8.5 \cdot 10^{+261}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* x y))))
   (if (<= (* c i) -8.2e+262)
     (* c i)
     (if (<= (* c i) -1.3e+206)
       t_1
       (if (<= (* c i) -5.4e+124)
         (* c i)
         (if (<= (* c i) -3.15e-137)
           t_1
           (if (<= (* c i) -1.05e-242)
             (* z t)
             (if (or (<= (* c i) 2.4e+62)
                     (and (not (<= (* c i) 7.1e+115)) (<= (* c i) 8.5e+261)))
               t_1
               (* 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) + (x * y);
	double tmp;
	if ((c * i) <= -8.2e+262) {
		tmp = c * i;
	} else if ((c * i) <= -1.3e+206) {
		tmp = t_1;
	} else if ((c * i) <= -5.4e+124) {
		tmp = c * i;
	} else if ((c * i) <= -3.15e-137) {
		tmp = t_1;
	} else if ((c * i) <= -1.05e-242) {
		tmp = z * t;
	} else if (((c * i) <= 2.4e+62) || (!((c * i) <= 7.1e+115) && ((c * i) <= 8.5e+261))) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (x * y)
    if ((c * i) <= (-8.2d+262)) then
        tmp = c * i
    else if ((c * i) <= (-1.3d+206)) then
        tmp = t_1
    else if ((c * i) <= (-5.4d+124)) then
        tmp = c * i
    else if ((c * i) <= (-3.15d-137)) then
        tmp = t_1
    else if ((c * i) <= (-1.05d-242)) then
        tmp = z * t
    else if (((c * i) <= 2.4d+62) .or. (.not. ((c * i) <= 7.1d+115)) .and. ((c * i) <= 8.5d+261)) then
        tmp = t_1
    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 t_1 = (a * b) + (x * y);
	double tmp;
	if ((c * i) <= -8.2e+262) {
		tmp = c * i;
	} else if ((c * i) <= -1.3e+206) {
		tmp = t_1;
	} else if ((c * i) <= -5.4e+124) {
		tmp = c * i;
	} else if ((c * i) <= -3.15e-137) {
		tmp = t_1;
	} else if ((c * i) <= -1.05e-242) {
		tmp = z * t;
	} else if (((c * i) <= 2.4e+62) || (!((c * i) <= 7.1e+115) && ((c * i) <= 8.5e+261))) {
		tmp = t_1;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (x * y)
	tmp = 0
	if (c * i) <= -8.2e+262:
		tmp = c * i
	elif (c * i) <= -1.3e+206:
		tmp = t_1
	elif (c * i) <= -5.4e+124:
		tmp = c * i
	elif (c * i) <= -3.15e-137:
		tmp = t_1
	elif (c * i) <= -1.05e-242:
		tmp = z * t
	elif ((c * i) <= 2.4e+62) or (not ((c * i) <= 7.1e+115) and ((c * i) <= 8.5e+261)):
		tmp = t_1
	else:
		tmp = c * i
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(x * y))
	tmp = 0.0
	if (Float64(c * i) <= -8.2e+262)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -1.3e+206)
		tmp = t_1;
	elseif (Float64(c * i) <= -5.4e+124)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -3.15e-137)
		tmp = t_1;
	elseif (Float64(c * i) <= -1.05e-242)
		tmp = Float64(z * t);
	elseif ((Float64(c * i) <= 2.4e+62) || (!(Float64(c * i) <= 7.1e+115) && (Float64(c * i) <= 8.5e+261)))
		tmp = t_1;
	else
		tmp = Float64(c * i);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (x * y);
	tmp = 0.0;
	if ((c * i) <= -8.2e+262)
		tmp = c * i;
	elseif ((c * i) <= -1.3e+206)
		tmp = t_1;
	elseif ((c * i) <= -5.4e+124)
		tmp = c * i;
	elseif ((c * i) <= -3.15e-137)
		tmp = t_1;
	elseif ((c * i) <= -1.05e-242)
		tmp = z * t;
	elseif (((c * i) <= 2.4e+62) || (~(((c * i) <= 7.1e+115)) && ((c * i) <= 8.5e+261)))
		tmp = t_1;
	else
		tmp = 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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -8.2e+262], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.3e+206], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -5.4e+124], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -3.15e-137], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.05e-242], N[(z * t), $MachinePrecision], If[Or[LessEqual[N[(c * i), $MachinePrecision], 2.4e+62], And[N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.1e+115]], $MachinePrecision], LessEqual[N[(c * i), $MachinePrecision], 8.5e+261]]], t$95$1, N[(c * i), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+206}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{+124}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;c \cdot i \leq -3.15 \cdot 10^{-137}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+62} \lor \neg \left(c \cdot i \leq 7.1 \cdot 10^{+115}\right) \land c \cdot i \leq 8.5 \cdot 10^{+261}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -8.20000000000000055e262 or -1.29999999999999994e206 < (*.f64 c i) < -5.39999999999999956e124 or 2.4e62 < (*.f64 c i) < 7.0999999999999997e115 or 8.5000000000000005e261 < (*.f64 c i)

    1. Initial program 92.8%

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

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

    if -8.20000000000000055e262 < (*.f64 c i) < -1.29999999999999994e206 or -5.39999999999999956e124 < (*.f64 c i) < -3.15e-137 or -1.05000000000000009e-242 < (*.f64 c i) < 2.4e62 or 7.0999999999999997e115 < (*.f64 c i) < 8.5000000000000005e261

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

    if -3.15e-137 < (*.f64 c i) < -1.05000000000000009e-242

    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 z around inf 70.1%

      \[\leadsto \color{blue}{t \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.2 \cdot 10^{+262}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.3 \cdot 10^{+206}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;c \cdot i \leq -5.4 \cdot 10^{+124}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -3.15 \cdot 10^{-137}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;c \cdot i \leq -1.05 \cdot 10^{-242}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 2.4 \cdot 10^{+62} \lor \neg \left(c \cdot i \leq 7.1 \cdot 10^{+115}\right) \land c \cdot i \leq 8.5 \cdot 10^{+261}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 6: 97.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;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 (+ (* c i) (+ (* a b) (+ (* z t) (* x y))))))
   (if (<= t_1 INFINITY) 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 = (c * i) + ((a * b) + ((z * t) + (x * y)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)))
	tmp = 0
	if t_1 <= math.inf:
		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(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))))
	tmp = 0.0
	if (t_1 <= Inf)
		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 = (c * i) + ((a * b) + ((z * t) + (x * y)));
	tmp = 0.0;
	if (t_1 <= Inf)
		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[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

Alternative 7: 65.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-317}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+125}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -5e6 or 1.05e125 < (*.f64 a b)

    1. Initial program 91.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+91.5%

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

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

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

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

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

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

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

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

    if -5e6 < (*.f64 a b) < -1.00000023e-317 or 4.80000000000000036e-307 < (*.f64 a b) < 1.05e125

    1. Initial program 99.2%

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

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

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

    if -1.00000023e-317 < (*.f64 a b) < 4.80000000000000036e-307

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5000000:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-317}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 4.8 \cdot 10^{-307}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.05 \cdot 10^{+125}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]

Alternative 8: 82.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+224}:\\
\;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\

\mathbf{elif}\;x \leq -8.2 \cdot 10^{+74} \lor \neg \left(x \leq 1.25 \cdot 10^{-79}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\

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


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

    1. Initial program 74.9%

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

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

    if -2.1000000000000002e224 < x < -8.2000000000000001e74 or 1.25e-79 < x

    1. Initial program 98.0%

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

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

    if -8.2000000000000001e74 < x < 1.25e-79

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+224}:\\ \;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;x \leq -8.2 \cdot 10^{+74} \lor \neg \left(x \leq 1.25 \cdot 10^{-79}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \end{array} \]

Alternative 9: 37.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq -8.2 \cdot 10^{-40}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \leq -2.1 \cdot 10^{-219}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;c \leq 1.3 \cdot 10^{-230}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \leq 4.2 \cdot 10^{-200}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.95000000000000005e30 or 1.8e-112 < c

    1. Initial program 95.8%

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

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

    if -1.95000000000000005e30 < c < -8.19999999999999926e-40 or -2.1e-219 < c < 1.3000000000000001e-230 or 4.1999999999999998e-200 < c < 1.8e-112

    1. Initial program 95.8%

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

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

    if -8.19999999999999926e-40 < c < -2.1e-219 or 1.3000000000000001e-230 < c < 4.1999999999999998e-200

    1. Initial program 97.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.95 \cdot 10^{+30}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \leq -8.2 \cdot 10^{-40}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-219}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \leq 1.3 \cdot 10^{-230}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-200}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 10: 59.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+197} \lor \neg \left(x \leq -3 \cdot 10^{+147}\right) \land \left(x \leq -1.25 \cdot 10^{+119} \lor \neg \left(x \leq 2.05 \cdot 10^{-64}\right)\right):\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000002e197 or -2.99999999999999993e147 < x < -1.25e119 or 2.05e-64 < x

    1. Initial program 95.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+95.5%

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

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

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

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

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

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

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

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

    if -2.90000000000000002e197 < x < -2.99999999999999993e147 or -1.25e119 < x < 2.05e-64

    1. Initial program 96.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+197} \lor \neg \left(x \leq -3 \cdot 10^{+147}\right) \land \left(x \leq -1.25 \cdot 10^{+119} \lor \neg \left(x \leq 2.05 \cdot 10^{-64}\right)\right):\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \]

Alternative 11: 66.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4700000 \lor \neg \left(a \cdot b \leq 3.7 \cdot 10^{+127}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -4.7e6 or 3.6999999999999998e127 < (*.f64 a b)

    1. Initial program 91.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+91.5%

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

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

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

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

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

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

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

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

    if -4.7e6 < (*.f64 a b) < 3.6999999999999998e127

    1. Initial program 99.3%

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

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

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

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

Alternative 12: 82.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+74} \lor \neg \left(x \leq 2.4 \cdot 10^{-79}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1999999999999998e74 or 2.40000000000000006e-79 < x

    1. Initial program 95.6%

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

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

    if -4.1999999999999998e74 < x < 2.40000000000000006e-79

    1. Initial program 96.4%

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

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

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

Alternative 13: 74.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 89.8%

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

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

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

    if -5.0000000000000002e237 < x < 2.05e-64

    1. Initial program 95.5%

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

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

    if 2.05e-64 < x

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 36.7% accurate, 2.1× speedup?

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

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

\mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.7000000000000001e30 or 1.8e-112 < c

    1. Initial program 95.8%

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

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

    if -1.7000000000000001e30 < c < 1.8e-112

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+30}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{-112}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 15: 27.1% 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.1%

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

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

    \[\leadsto a \cdot b \]

Reproduce

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