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

Percentage Accurate: 96.1% → 97.3%
Time: 10.4s
Alternatives: 10
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 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: 96.1% 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.3% accurate, 0.4× 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}:\\ \;\;\;\;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 (* 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 = 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 = 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 = 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(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 = 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[(z * t), $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}:\\
\;\;\;\;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 \]
    2. Add Preprocessing

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{t \cdot z} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6454.7%

        \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{z}\right) \]
    5. Simplified54.7%

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

    \[\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}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 41.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{+76}:\\
\;\;\;\;c \cdot i\\

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

\mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-122}:\\
\;\;\;\;a \cdot b\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -2.0500000000000002e169 or 4.5e192 < (*.f64 x y)

    1. Initial program 90.6%

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

      \[\leadsto \color{blue}{x \cdot y} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6480.8%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{y}\right) \]
    5. Simplified80.8%

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

    if -2.0500000000000002e169 < (*.f64 x y) < -2.45000000000000013e76 or 1.15000000000000003e-122 < (*.f64 x y) < 4.5e192

    1. Initial program 96.0%

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

      \[\leadsto \color{blue}{c \cdot i} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6446.7%

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{i}\right) \]
    5. Simplified46.7%

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

    if -2.45000000000000013e76 < (*.f64 x y) < 2.2e-294

    1. Initial program 97.8%

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

      \[\leadsto \color{blue}{t \cdot z} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6445.0%

        \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{z}\right) \]
    5. Simplified45.0%

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

    if 2.2e-294 < (*.f64 x y) < 1.15000000000000003e-122

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6457.2%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{b}\right) \]
    5. Simplified57.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.05 \cdot 10^{+169}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.45 \cdot 10^{+76}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-294}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{-122}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+192}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq -2.35 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq 1.35 \cdot 10^{-75}:\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 8.6 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 88.3%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a \cdot b\right)}, \mathsf{*.f64}\left(c, i\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6478.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(\color{blue}{c}, i\right)\right) \]
    5. Simplified78.5%

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

    if -1.24999999999999994e123 < (*.f64 c i) < -2.35e-7 or 1.3499999999999999e-75 < (*.f64 c i) < 8.60000000000000004e140

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right)\right) \]
      7. *-lowering-*.f6487.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    5. Simplified87.3%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left(a \cdot b\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f6473.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    8. Simplified73.1%

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

    if -2.35e-7 < (*.f64 c i) < 1.3499999999999999e-75

    1. Initial program 98.3%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    5. Simplified96.6%

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right) \]
      3. *-lowering-*.f6474.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right) \]
    8. Simplified74.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.35 \cdot 10^{-7}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 1.35 \cdot 10^{-75}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 8.6 \cdot 10^{+140}:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 43.5% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.60000000000000015e107 or 9.99999999999999967e78 < (*.f64 c i)

    1. Initial program 90.0%

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

      \[\leadsto \color{blue}{c \cdot i} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6468.9%

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{i}\right) \]
    5. Simplified68.9%

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

    if -1.60000000000000015e107 < (*.f64 c i) < -3.1999999999999999e-234 or 8.0000000000000002e-300 < (*.f64 c i) < 9.99999999999999967e78

    1. Initial program 99.1%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6439.5%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{b}\right) \]
    5. Simplified39.5%

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

    if -3.1999999999999999e-234 < (*.f64 c i) < 8.0000000000000002e-300

    1. Initial program 98.1%

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

      \[\leadsto \color{blue}{t \cdot z} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6446.0%

        \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{z}\right) \]
    5. Simplified46.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.6 \cdot 10^{+107}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -3.2 \cdot 10^{-234}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 8 \cdot 10^{-300}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 10^{+79}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 65.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq -0.32:\\
\;\;\;\;x \cdot y + a \cdot b\\

\mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{-51}:\\
\;\;\;\;a \cdot b + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -2.6999999999999999e111 or 8.19999999999999947e-51 < (*.f64 c i)

    1. Initial program 92.0%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, \mathsf{*.f64}\left(c, i\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6478.3%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\color{blue}{c}, i\right)\right) \]
    5. Simplified78.3%

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

    if -2.6999999999999999e111 < (*.f64 c i) < -0.320000000000000007

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left(a \cdot b\right)}\right) \]
    7. Step-by-step derivation
      1. *-lowering-*.f6481.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(a, \color{blue}{b}\right)\right) \]
    8. Simplified81.0%

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

    if -0.320000000000000007 < (*.f64 c i) < 8.19999999999999947e-51

    1. Initial program 98.3%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right)\right) \]
      7. *-lowering-*.f6496.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right)\right) \]
    5. Simplified96.8%

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right) \]
      3. *-lowering-*.f6474.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right) \]
    8. Simplified74.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.7 \cdot 10^{+111}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -0.32:\\ \;\;\;\;x \cdot y + a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 8.2 \cdot 10^{-51}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.7% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -2.8000000000000001e131 or 5.5999999999999996e108 < (*.f64 c i)

    1. Initial program 88.8%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, \mathsf{*.f64}\left(c, i\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\color{blue}{c}, i\right)\right) \]
    5. Simplified85.6%

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

    if -2.8000000000000001e131 < (*.f64 c i) < 5.5999999999999996e108

    1. Initial program 98.9%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

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

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

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

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

Alternative 7: 67.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+29}:\\
\;\;\;\;a \cdot b + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -6.00000000000000026e92 or 4.5000000000000002e29 < (*.f64 c i)

    1. Initial program 91.0%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a \cdot b\right)}, \mathsf{*.f64}\left(c, i\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6470.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(\color{blue}{c}, i\right)\right) \]
    5. Simplified70.8%

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

    if -6.00000000000000026e92 < (*.f64 c i) < 4.5000000000000002e29

    1. Initial program 98.7%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

        \[\leadsto \left(a \cdot b + t \cdot z\right) + \color{blue}{x \cdot y} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot y + \color{blue}{\left(a \cdot b + t \cdot z\right)} \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y\right), \color{blue}{\left(a \cdot b + t \cdot z\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\color{blue}{a \cdot b} + t \cdot z\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right)\right) \]
      7. *-lowering-*.f6495.4%

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

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

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(a \cdot b\right), \color{blue}{\left(t \cdot z\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \left(\color{blue}{t} \cdot z\right)\right) \]
      3. *-lowering-*.f6469.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right) \]
    8. Simplified69.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+92}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+29}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.5% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -6.4e177 or 2.1e193 < (*.f64 x y)

    1. Initial program 90.6%

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

      \[\leadsto \color{blue}{x \cdot y} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6480.8%

        \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{y}\right) \]
    5. Simplified80.8%

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

    if -6.4e177 < (*.f64 x y) < 2.1e193

    1. Initial program 97.4%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(a \cdot b\right)}, \mathsf{*.f64}\left(c, i\right)\right) \]
    4. Step-by-step derivation
      1. *-lowering-*.f6463.1%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(a, b\right), \mathsf{*.f64}\left(\color{blue}{c}, i\right)\right) \]
    5. Simplified63.1%

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

Alternative 9: 43.4% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.6999999999999998e108 or 2e80 < (*.f64 c i)

    1. Initial program 90.0%

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

      \[\leadsto \color{blue}{c \cdot i} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6468.9%

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{i}\right) \]
    5. Simplified68.9%

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

    if -3.6999999999999998e108 < (*.f64 c i) < 2e80

    1. Initial program 98.8%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. *-lowering-*.f6436.4%

        \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{b}\right) \]
    5. Simplified36.4%

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

Alternative 10: 27.5% accurate, 5.0× speedup?

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

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

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Step-by-step derivation
    1. *-lowering-*.f6427.0%

      \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{b}\right) \]
  5. Simplified27.0%

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

Reproduce

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