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

Percentage Accurate: 95.6% → 97.7%
Time: 12.0s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 95.6% accurate, 1.0× speedup?

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

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

Alternative 1: 97.7% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.7% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*25.0%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-125.0%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity25.0%

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

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

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

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

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

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

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

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

Alternative 4: 96.8% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;a \cdot b + 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. Step-by-step derivation
      1. fma-def0.0%

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*25.0%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-125.0%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity25.0%

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

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

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

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

Alternative 5: 81.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+106} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+133}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.14999999999999992e238 or -3.4e199 < (*.f64 x y) < -2.19999999999999992e106 or 7.19999999999999956e133 < (*.f64 x y)

    1. Initial program 88.6%

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

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

    if -2.14999999999999992e238 < (*.f64 x y) < -3.4e199

    1. Initial program 83.3%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*68.0%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-168.0%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity68.0%

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

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

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

    if -2.19999999999999992e106 < (*.f64 x y) < 7.19999999999999956e133

    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 x around 0 89.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.15 \cdot 10^{+238}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{+199}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+106} \lor \neg \left(x \cdot y \leq 7.2 \cdot 10^{+133}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \end{array} \]

Alternative 6: 42.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -9.2 \cdot 10^{+86}:\\
\;\;\;\;x \cdot y\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -5.4000000000000002e112 or 1.66000000000000002e121 < (*.f64 a b)

    1. Initial program 87.8%

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

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

    if -5.4000000000000002e112 < (*.f64 a b) < -9.19999999999999958e86 or -4.39999999999999988e-264 < (*.f64 a b) < 1.66000000000000002e121

    1. Initial program 98.2%

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

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

    if -9.19999999999999958e86 < (*.f64 a b) < -1.30000000000000009e-27

    1. Initial program 92.9%

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

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

    if -1.30000000000000009e-27 < (*.f64 a b) < -4.39999999999999988e-264

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5.4 \cdot 10^{+112}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -9.2 \cdot 10^{+86}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1.3 \cdot 10^{-27}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -4.4 \cdot 10^{-264}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 1.66 \cdot 10^{+121}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 7: 63.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq 7.6 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \cdot i \leq 5.6 \cdot 10^{-40}:\\
\;\;\;\;x \cdot y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -2.3999999999999998e143 or 2.0000000000000001e206 < (*.f64 c i)

    1. Initial program 85.1%

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

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

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

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

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

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

    if -2.3999999999999998e143 < (*.f64 c i) < 7.6e-87 or 5.5999999999999999e-40 < (*.f64 c i) < 2.0000000000000001e206

    1. Initial program 96.7%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*71.8%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-171.8%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity71.8%

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

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

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

    if 7.6e-87 < (*.f64 c i) < 5.5999999999999999e-40

    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 x around inf 85.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.4 \cdot 10^{+143}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 7.6 \cdot 10^{-87}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 5.6 \cdot 10^{-40}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+206}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]

Alternative 8: 65.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ \mathbf{if}\;a \cdot b \leq -9.2 \cdot 10^{+86}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 4200000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+56}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.04 \cdot 10^{+77}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (* z t))))
   (if (<= (* a b) -9.2e+86)
     (+ (* a b) (* c i))
     (if (<= (* a b) 4200000000.0)
       t_1
       (if (<= (* a b) 1.65e+56)
         (* x y)
         (if (<= (* a b) 1.04e+77) t_1 (+ (* a b) (* 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) + (z * t);
	double tmp;
	if ((a * b) <= -9.2e+86) {
		tmp = (a * b) + (c * i);
	} else if ((a * b) <= 4200000000.0) {
		tmp = t_1;
	} else if ((a * b) <= 1.65e+56) {
		tmp = x * y;
	} else if ((a * b) <= 1.04e+77) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (c * i) + (z * t)
    if ((a * b) <= (-9.2d+86)) then
        tmp = (a * b) + (c * i)
    else if ((a * b) <= 4200000000.0d0) then
        tmp = t_1
    else if ((a * b) <= 1.65d+56) then
        tmp = x * y
    else if ((a * b) <= 1.04d+77) then
        tmp = t_1
    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 t_1 = (c * i) + (z * t);
	double tmp;
	if ((a * b) <= -9.2e+86) {
		tmp = (a * b) + (c * i);
	} else if ((a * b) <= 4200000000.0) {
		tmp = t_1;
	} else if ((a * b) <= 1.65e+56) {
		tmp = x * y;
	} else if ((a * b) <= 1.04e+77) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	tmp = 0
	if (a * b) <= -9.2e+86:
		tmp = (a * b) + (c * i)
	elif (a * b) <= 4200000000.0:
		tmp = t_1
	elif (a * b) <= 1.65e+56:
		tmp = x * y
	elif (a * b) <= 1.04e+77:
		tmp = t_1
	else:
		tmp = (a * b) + (z * t)
	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(a * b) <= -9.2e+86)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(a * b) <= 4200000000.0)
		tmp = t_1;
	elseif (Float64(a * b) <= 1.65e+56)
		tmp = Float64(x * y);
	elseif (Float64(a * b) <= 1.04e+77)
		tmp = t_1;
	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)
	t_1 = (c * i) + (z * t);
	tmp = 0.0;
	if ((a * b) <= -9.2e+86)
		tmp = (a * b) + (c * i);
	elseif ((a * b) <= 4200000000.0)
		tmp = t_1;
	elseif ((a * b) <= 1.65e+56)
		tmp = x * y;
	elseif ((a * b) <= 1.04e+77)
		tmp = t_1;
	else
		tmp = (a * b) + (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[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -9.2e+86], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4200000000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.65e+56], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.04e+77], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq 4200000000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 1.04 \cdot 10^{+77}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -9.19999999999999958e86

    1. Initial program 85.5%

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

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

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

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

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

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

    if -9.19999999999999958e86 < (*.f64 a b) < 4.2e9 or 1.65000000000000001e56 < (*.f64 a b) < 1.04e77

    1. Initial program 97.2%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*72.7%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-172.7%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity72.7%

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

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

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

    if 4.2e9 < (*.f64 a b) < 1.65000000000000001e56

    1. Initial program 85.7%

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

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

    if 1.04e77 < (*.f64 a b)

    1. Initial program 93.9%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{{1}^{0.3333333333333333} \cdot \left(t \cdot z\right)} + a \cdot b\right) + c \cdot i \]
    5. Step-by-step derivation
      1. associate-*r*90.0%

        \[\leadsto \left(\color{blue}{\left({1}^{0.3333333333333333} \cdot t\right) \cdot z} + a \cdot b\right) + c \cdot i \]
      2. pow-base-190.0%

        \[\leadsto \left(\left(\color{blue}{1} \cdot t\right) \cdot z + a \cdot b\right) + c \cdot i \]
      3. *-lft-identity90.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -9.2 \cdot 10^{+86}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 4200000000:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+56}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.04 \cdot 10^{+77}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 9: 42.0% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{+148}:\\
\;\;\;\;z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -4.90000000000000026e194 or 3.4000000000000003e148 < (*.f64 a b)

    1. Initial program 87.8%

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

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

    if -4.90000000000000026e194 < (*.f64 a b) < -2.74999999999999986e-263

    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 inf 41.7%

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

    if -2.74999999999999986e-263 < (*.f64 a b) < 3.4000000000000003e148

    1. Initial program 98.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -4.9 \cdot 10^{+194}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -2.75 \cdot 10^{-263}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 3.4 \cdot 10^{+148}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 10: 62.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.38 \cdot 10^{+79} \lor \neg \left(x \cdot y \leq 3.7 \cdot 10^{+119}\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.38e+79) (not (<= (* x y) 3.7e+119)))
   (* 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.38e+79) || !((x * y) <= 3.7e+119)) {
		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.38d+79)) .or. (.not. ((x * y) <= 3.7d+119))) 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.38e+79) || !((x * y) <= 3.7e+119)) {
		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.38e+79) or not ((x * y) <= 3.7e+119):
		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.38e+79) || !(Float64(x * y) <= 3.7e+119))
		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.38e+79) || ~(((x * y) <= 3.7e+119)))
		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.38e+79], N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.7e+119]], $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.38 \cdot 10^{+79} \lor \neg \left(x \cdot y \leq 3.7 \cdot 10^{+119}\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.38e79 or 3.7e119 < (*.f64 x y)

    1. Initial program 89.0%

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

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

    if -1.38e79 < (*.f64 x y) < 3.7e119

    1. Initial program 96.0%

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

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

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

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

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

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

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

Alternative 11: 43.3% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -4.9 \cdot 10^{+194} \lor \neg \left(a \cdot b \leq 1.08 \cdot 10^{+76}\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) -4.9e+194) (not (<= (* a b) 1.08e+76))) (* 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) <= -4.9e+194) || !((a * b) <= 1.08e+76)) {
		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) <= (-4.9d+194)) .or. (.not. ((a * b) <= 1.08d+76))) 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) <= -4.9e+194) || !((a * b) <= 1.08e+76)) {
		tmp = a * b;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((a * b) <= -4.9e+194) or not ((a * b) <= 1.08e+76):
		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) <= -4.9e+194) || !(Float64(a * b) <= 1.08e+76))
		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) <= -4.9e+194) || ~(((a * b) <= 1.08e+76)))
		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], -4.9e+194], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.08e+76]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4.9 \cdot 10^{+194} \lor \neg \left(a \cdot b \leq 1.08 \cdot 10^{+76}\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) < -4.90000000000000026e194 or 1.07999999999999999e76 < (*.f64 a b)

    1. Initial program 89.7%

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

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

    if -4.90000000000000026e194 < (*.f64 a b) < 1.07999999999999999e76

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -4.9 \cdot 10^{+194} \lor \neg \left(a \cdot b \leq 1.08 \cdot 10^{+76}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 12: 27.0% 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 93.7%

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

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

    \[\leadsto a \cdot b \]

Reproduce

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