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

Percentage Accurate: 95.7% → 97.0%
Time: 14.0s
Alternatives: 12
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 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.7% 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.0% 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}:\\ \;\;\;\;t \cdot z\\ \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 (* t z))))
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 = t * z;
	}
	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 = t * z;
	}
	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 = t * z
	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(t * z);
	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 = t * z;
	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[(t * z), $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}:\\
\;\;\;\;t \cdot z\\


\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 66.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 0:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 10^{+75}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1e71 or 9.99999999999999927e74 < (*.f64 a b)

    1. Initial program 94.9%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1e71 < (*.f64 a b) < -4.99999999999999956e-215 or 0.0 < (*.f64 a b) < 1.20000000000000005e-60

    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 z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4.99999999999999956e-215 < (*.f64 a b) < 0.0 or 1.20000000000000005e-60 < (*.f64 a b) < 9.99999999999999927e74

    1. Initial program 95.3%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 65.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+64}:\\
\;\;\;\;a \cdot b + c \cdot i\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a b) < -1.00000000000000002e64

    1. Initial program 93.6%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.00000000000000002e64 < (*.f64 a b) < -4.99999999999999956e-215

    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 x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4.99999999999999956e-215 < (*.f64 a b) < 0.0

    1. Initial program 93.2%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if 0.0 < (*.f64 a b) < 9.99999999999999984e-46

    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 z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 9.99999999999999984e-46 < (*.f64 a b)

    1. Initial program 97.1%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
    9. Taylor expanded in a around inf 0

      \[\leadsto expr\]
    10. Simplified0

      \[\leadsto expr\]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 4: 65.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+64}:\\
\;\;\;\;a \cdot b + c \cdot i\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a b) < -1.00000000000000002e64

    1. Initial program 93.6%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.00000000000000002e64 < (*.f64 a b) < -4.99999999999999956e-215

    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 x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4.99999999999999956e-215 < (*.f64 a b) < 0.0

    1. Initial program 93.2%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if 0.0 < (*.f64 a b) < 9.99999999999999984e-46

    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 z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 9.99999999999999984e-46 < (*.f64 a b)

    1. Initial program 97.1%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 5 regimes into one program.
  4. Add Preprocessing

Alternative 5: 64.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 10^{-45}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 93.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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1e71 < (*.f64 a b) < -4.99999999999999956e-215 or 0.0 < (*.f64 a b) < 9.99999999999999984e-46

    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 z around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4.99999999999999956e-215 < (*.f64 a b) < 0.0

    1. Initial program 93.2%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around inf 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if 9.99999999999999984e-46 < (*.f64 a b)

    1. Initial program 97.1%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in c around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 6: 60.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-182}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \cdot y \leq 2.4 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.0000000000000003e139 or 2.3999999999999998e103 < (*.f64 x y)

    1. Initial program 93.3%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -5.0000000000000003e139 < (*.f64 x y) < 8.5000000000000001e-182 or 1.25000000000000001e-51 < (*.f64 x y) < 2.3999999999999998e103

    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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 8.5000000000000001e-182 < (*.f64 x y) < 1.25000000000000001e-51

    1. Initial program 94.4%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 83.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+114}:\\
\;\;\;\;a \cdot \left(b + \frac{x \cdot y}{a}\right) + c \cdot i\\

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

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


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

    1. Initial program 92.9%

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

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in a around -inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in t around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -4e114 < (*.f64 c i) < 1.99999999999999995e38

    1. Initial program 98.2%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if 1.99999999999999995e38 < (*.f64 c i)

    1. Initial program 95.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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 83.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot z + c \cdot i\\
\mathbf{if}\;c \cdot i \leq -4 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -4e114 or 1.99999999999999995e38 < (*.f64 c i)

    1. Initial program 94.4%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4e114 < (*.f64 c i) < 1.99999999999999995e38

    1. Initial program 98.2%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 44.2% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -4e114 or 1.00000000000000004e62 < (*.f64 a b)

    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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -4e114 < (*.f64 a b) < -1.0000000000000001e-253

    1. Initial program 98.4%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1.0000000000000001e-253 < (*.f64 a b) < 1.00000000000000004e62

    1. Initial program 96.9%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 66.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+62}:\\ \;\;\;\;t \cdot z + c \cdot i\\ \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 (<= (* a b) -1e+71)
     t_1
     (if (<= (* a b) 1e+62) (+ (* t z) (* 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) + (c * i);
	double tmp;
	if ((a * b) <= -1e+71) {
		tmp = t_1;
	} else if ((a * b) <= 1e+62) {
		tmp = (t * z) + (c * i);
	} 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 ((a * b) <= (-1d+71)) then
        tmp = t_1
    else if ((a * b) <= 1d+62) then
        tmp = (t * z) + (c * i)
    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 ((a * b) <= -1e+71) {
		tmp = t_1;
	} else if ((a * b) <= 1e+62) {
		tmp = (t * z) + (c * i);
	} 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 (a * b) <= -1e+71:
		tmp = t_1
	elif (a * b) <= 1e+62:
		tmp = (t * z) + (c * i)
	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(a * b) <= -1e+71)
		tmp = t_1;
	elseif (Float64(a * b) <= 1e+62)
		tmp = Float64(Float64(t * z) + Float64(c * i));
	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 ((a * b) <= -1e+71)
		tmp = t_1;
	elseif ((a * b) <= 1e+62)
		tmp = (t * z) + (c * i);
	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[(a * b), $MachinePrecision], -1e+71], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e+62], N[(N[(t * z), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1e71 or 1.00000000000000004e62 < (*.f64 a b)

    1. Initial program 95.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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -1e71 < (*.f64 a b) < 1.00000000000000004e62

    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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 43.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -9.6 \cdot 10^{+110}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 9 \cdot 10^{+48}:\\ \;\;\;\;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) -9.6e+110) (* c i) (if (<= (* c i) 9e+48) (* 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) <= -9.6e+110) {
		tmp = c * i;
	} else if ((c * i) <= 9e+48) {
		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) <= (-9.6d+110)) then
        tmp = c * i
    else if ((c * i) <= 9d+48) 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) <= -9.6e+110) {
		tmp = c * i;
	} else if ((c * i) <= 9e+48) {
		tmp = a * b;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -9.6e+110:
		tmp = c * i
	elif (c * i) <= 9e+48:
		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) <= -9.6e+110)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= 9e+48)
		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) <= -9.6e+110)
		tmp = c * i;
	elseif ((c * i) <= 9e+48)
		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], -9.6e+110], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9e+48], N[(a * b), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -9.60000000000000049e110 or 8.99999999999999991e48 < (*.f64 c i)

    1. Initial program 94.5%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -9.60000000000000049e110 < (*.f64 c i) < 8.99999999999999991e48

    1. Initial program 98.2%

      \[\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 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 27.7% accurate, 5.0× speedup?

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

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

    \[\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 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Add Preprocessing

Reproduce

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