Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, C

Percentage Accurate: 98.0% → 97.7%
Time: 13.6s
Alternatives: 17
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
    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
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\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 17 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: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
    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
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\end{array}

Alternative 1: 97.7% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \frac{a \cdot b}{4}\\ t_2 := x \cdot y + \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_2 \leq 5 \cdot 10^{+251}:\\ \;\;\;\;c + \left(t\_2 - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot \left(y + 0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\right) - t\_1\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (/ (* a b) 4.0)) (t_2 (+ (* x y) (/ (* z t) 16.0))))
   (if (<= t_2 5e+251)
     (+ c (- t_2 t_1))
     (+ c (- (* x (+ y (* 0.0625 (* t (/ z x))))) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double t_2 = (x * y) + ((z * t) / 16.0);
	double tmp;
	if (t_2 <= 5e+251) {
		tmp = c + (t_2 - t_1);
	} else {
		tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) / 4.0d0
    t_2 = (x * y) + ((z * t) / 16.0d0)
    if (t_2 <= 5d+251) then
        tmp = c + (t_2 - t_1)
    else
        tmp = c + ((x * (y + (0.0625d0 * (t * (z / x))))) - t_1)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) / 4.0;
	double t_2 = (x * y) + ((z * t) / 16.0);
	double tmp;
	if (t_2 <= 5e+251) {
		tmp = c + (t_2 - t_1);
	} else {
		tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) / 4.0
	t_2 = (x * y) + ((z * t) / 16.0)
	tmp = 0
	if t_2 <= 5e+251:
		tmp = c + (t_2 - t_1)
	else:
		tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1)
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) / 4.0)
	t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0))
	tmp = 0.0
	if (t_2 <= 5e+251)
		tmp = Float64(c + Float64(t_2 - t_1));
	else
		tmp = Float64(c + Float64(Float64(x * Float64(y + Float64(0.0625 * Float64(t * Float64(z / x))))) - t_1));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) / 4.0;
	t_2 = (x * y) + ((z * t) / 16.0);
	tmp = 0.0;
	if (t_2 <= 5e+251)
		tmp = c + (t_2 - t_1);
	else
		tmp = c + ((x * (y + (0.0625 * (t * (z / x))))) - t_1);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+251], N[(c + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * N[(y + N[(0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \frac{a \cdot b}{4}\\
t_2 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{+251}:\\
\;\;\;\;c + \left(t\_2 - t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot \left(y + 0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\right) - t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 5.0000000000000005e251

    1. Initial program 99.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing

    if 5.0000000000000005e251 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64)))

    1. Initial program 85.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 91.1%

      \[\leadsto \left(\color{blue}{x \cdot \left(y + 0.0625 \cdot \frac{t \cdot z}{x}\right)} - \frac{a \cdot b}{4}\right) + c \]
    4. Step-by-step derivation
      1. associate-/l*97.0%

        \[\leadsto \left(x \cdot \left(y + 0.0625 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)}\right) - \frac{a \cdot b}{4}\right) + c \]
    5. Simplified97.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y + \frac{z \cdot t}{16} \leq 5 \cdot 10^{+251}:\\ \;\;\;\;c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot \left(y + 0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\right) - \frac{a \cdot b}{4}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.0% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (+ (fma x y (fma z (/ t 16.0) (/ (* a b) -4.0))) c))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return fma(x, y, fma(z, (t / 16.0), ((a * b) / -4.0))) + c;
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	return Float64(fma(x, y, fma(z, Float64(t / 16.0), Float64(Float64(a * b) / -4.0))) + c)
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. associate--l+97.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)} + c \]
    3. associate-/l*98.4%

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c} \]
  4. Add Preprocessing
  5. Final simplification98.4%

    \[\leadsto \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c \]
  6. Add Preprocessing

Alternative 3: 98.4% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right) \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (+ c (- (fma x y (* z (/ t 16.0))) (* a (/ b 4.0)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c + (fma(x, y, (z * (t / 16.0))) - (a * (b / 4.0)));
}
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	return Float64(c + Float64(fma(x, y, Float64(z * Float64(t / 16.0))) - Float64(a * Float64(b / 4.0))))
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(x * y + N[(z * N[(t / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * N[(b / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Step-by-step derivation
    1. associate-+l-97.6%

      \[\leadsto \color{blue}{\left(x \cdot y + \frac{z \cdot t}{16}\right) - \left(\frac{a \cdot b}{4} - c\right)} \]
    2. *-commutative97.6%

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(x, y, \frac{\color{blue}{z \cdot t}}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    6. associate-/l*98.4%

      \[\leadsto \left(\mathsf{fma}\left(x, y, \color{blue}{z \cdot \frac{t}{16}}\right) - \frac{a \cdot b}{4}\right) + c \]
    7. associate-/l*98.4%

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

    \[\leadsto \color{blue}{\left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right) + c} \]
  4. Add Preprocessing
  5. Final simplification98.4%

    \[\leadsto c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right) \]
  6. Add Preprocessing

Alternative 4: 42.6% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{+20}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-316}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-154}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.12 \cdot 10^{+169}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))))
   (if (<= (* x y) -2.1e+182)
     (* x y)
     (if (<= (* x y) -9.5e+20)
       c
       (if (<= (* x y) 5e-316)
         t_1
         (if (<= (* x y) 6.6e-154)
           c
           (if (<= (* x y) 1.12e+169) t_1 (* x y))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double tmp;
	if ((x * y) <= -2.1e+182) {
		tmp = x * y;
	} else if ((x * y) <= -9.5e+20) {
		tmp = c;
	} else if ((x * y) <= 5e-316) {
		tmp = t_1;
	} else if ((x * y) <= 6.6e-154) {
		tmp = c;
	} else if ((x * y) <= 1.12e+169) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = b * (a * (-0.25d0))
    if ((x * y) <= (-2.1d+182)) then
        tmp = x * y
    else if ((x * y) <= (-9.5d+20)) then
        tmp = c
    else if ((x * y) <= 5d-316) then
        tmp = t_1
    else if ((x * y) <= 6.6d-154) then
        tmp = c
    else if ((x * y) <= 1.12d+169) then
        tmp = t_1
    else
        tmp = x * y
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double tmp;
	if ((x * y) <= -2.1e+182) {
		tmp = x * y;
	} else if ((x * y) <= -9.5e+20) {
		tmp = c;
	} else if ((x * y) <= 5e-316) {
		tmp = t_1;
	} else if ((x * y) <= 6.6e-154) {
		tmp = c;
	} else if ((x * y) <= 1.12e+169) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	tmp = 0
	if (x * y) <= -2.1e+182:
		tmp = x * y
	elif (x * y) <= -9.5e+20:
		tmp = c
	elif (x * y) <= 5e-316:
		tmp = t_1
	elif (x * y) <= 6.6e-154:
		tmp = c
	elif (x * y) <= 1.12e+169:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	tmp = 0.0
	if (Float64(x * y) <= -2.1e+182)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -9.5e+20)
		tmp = c;
	elseif (Float64(x * y) <= 5e-316)
		tmp = t_1;
	elseif (Float64(x * y) <= 6.6e-154)
		tmp = c;
	elseif (Float64(x * y) <= 1.12e+169)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = b * (a * -0.25);
	tmp = 0.0;
	if ((x * y) <= -2.1e+182)
		tmp = x * y;
	elseif ((x * y) <= -9.5e+20)
		tmp = c;
	elseif ((x * y) <= 5e-316)
		tmp = t_1;
	elseif ((x * y) <= 6.6e-154)
		tmp = c;
	elseif ((x * y) <= 1.12e+169)
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.1e+182], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -9.5e+20], c, If[LessEqual[N[(x * y), $MachinePrecision], 5e-316], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.6e-154], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.12e+169], t$95$1, N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{+20}:\\
\;\;\;\;c\\

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

\mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-154}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.0999999999999999e182 or 1.11999999999999996e169 < (*.f64 x y)

    1. Initial program 90.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 84.8%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 80.3%

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

    if -2.0999999999999999e182 < (*.f64 x y) < -9.5e20 or 5.000000017e-316 < (*.f64 x y) < 6.60000000000000055e-154

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf 43.3%

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

    if -9.5e20 < (*.f64 x y) < 5.000000017e-316 or 6.60000000000000055e-154 < (*.f64 x y) < 1.11999999999999996e169

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 66.6%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 37.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*37.3%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} \]
      2. *-commutative37.3%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} \]
      3. *-commutative37.3%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} \]
    6. Simplified37.3%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{+20}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-316}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 6.6 \cdot 10^{-154}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.12 \cdot 10^{+169}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.4% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-55}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+97}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* b (* a -0.25)))))
   (if (<= (* x y) -2e+182)
     (- (* x y) (* (* a b) 0.25))
     (if (<= (* x y) 3e-272)
       t_1
       (if (<= (* x y) 5e-55)
         (* z (+ (* t 0.0625) (/ c z)))
         (if (<= (* x y) 1e+97) t_1 (* y (+ x (* 0.0625 (/ (* z t) y))))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -2e+182) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((x * y) <= 3e-272) {
		tmp = t_1;
	} else if ((x * y) <= 5e-55) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 1e+97) {
		tmp = t_1;
	} else {
		tmp = y * (x + (0.0625 * ((z * t) / y)));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = c + (b * (a * (-0.25d0)))
    if ((x * y) <= (-2d+182)) then
        tmp = (x * y) - ((a * b) * 0.25d0)
    else if ((x * y) <= 3d-272) then
        tmp = t_1
    else if ((x * y) <= 5d-55) then
        tmp = z * ((t * 0.0625d0) + (c / z))
    else if ((x * y) <= 1d+97) then
        tmp = t_1
    else
        tmp = y * (x + (0.0625d0 * ((z * t) / y)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -2e+182) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((x * y) <= 3e-272) {
		tmp = t_1;
	} else if ((x * y) <= 5e-55) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 1e+97) {
		tmp = t_1;
	} else {
		tmp = y * (x + (0.0625 * ((z * t) / y)));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = c + (b * (a * -0.25))
	tmp = 0
	if (x * y) <= -2e+182:
		tmp = (x * y) - ((a * b) * 0.25)
	elif (x * y) <= 3e-272:
		tmp = t_1
	elif (x * y) <= 5e-55:
		tmp = z * ((t * 0.0625) + (c / z))
	elif (x * y) <= 1e+97:
		tmp = t_1
	else:
		tmp = y * (x + (0.0625 * ((z * t) / y)))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -2e+182)
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	elseif (Float64(x * y) <= 3e-272)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-55)
		tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z)));
	elseif (Float64(x * y) <= 1e+97)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y))));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (b * (a * -0.25));
	tmp = 0.0;
	if ((x * y) <= -2e+182)
		tmp = (x * y) - ((a * b) * 0.25);
	elseif ((x * y) <= 3e-272)
		tmp = t_1;
	elseif ((x * y) <= 5e-55)
		tmp = z * ((t * 0.0625) + (c / z));
	elseif ((x * y) <= 1e+97)
		tmp = t_1;
	else
		tmp = y * (x + (0.0625 * ((z * t) / y)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+182], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-55], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+97], t$95$1, N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-55}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\

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

\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\


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

    1. Initial program 89.7%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 93.1%

      \[\leadsto \color{blue}{x \cdot y - 0.25 \cdot \left(a \cdot b\right)} \]

    if -2.0000000000000001e182 < (*.f64 x y) < 3.0000000000000003e-272 or 5.0000000000000002e-55 < (*.f64 x y) < 1.0000000000000001e97

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 67.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*67.3%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative67.3%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative67.3%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified67.3%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]

    if 3.0000000000000003e-272 < (*.f64 x y) < 5.0000000000000002e-55

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 90.7%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in t around inf 74.4%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    5. Step-by-step derivation
      1. *-commutative74.4%

        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} + c \]
      2. *-commutative74.4%

        \[\leadsto \color{blue}{\left(z \cdot t\right)} \cdot 0.0625 + c \]
      3. associate-*r*74.4%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative74.4%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    6. Simplified74.4%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]
    7. Taylor expanded in z around inf 69.9%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t + \frac{c}{z}\right)} \]

    if 1.0000000000000001e97 < (*.f64 x y)

    1. Initial program 94.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 84.9%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right) + x \cdot y} \]
    5. Taylor expanded in y around inf 75.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 3 \cdot 10^{-272}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-55}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+97}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.6% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+57}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-51}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* b (* a -0.25)))))
   (if (<= (* x y) -1.05e+57)
     (+ c (* x y))
     (if (<= (* x y) 2.9e-272)
       t_1
       (if (<= (* x y) 5.6e-51)
         (* z (+ (* t 0.0625) (/ c z)))
         (if (<= (* x y) 8.8e+101) t_1 (+ (* x y) (* 0.0625 (* z t)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -1.05e+57) {
		tmp = c + (x * y);
	} else if ((x * y) <= 2.9e-272) {
		tmp = t_1;
	} else if ((x * y) <= 5.6e-51) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 8.8e+101) {
		tmp = t_1;
	} else {
		tmp = (x * y) + (0.0625 * (z * t));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = c + (b * (a * (-0.25d0)))
    if ((x * y) <= (-1.05d+57)) then
        tmp = c + (x * y)
    else if ((x * y) <= 2.9d-272) then
        tmp = t_1
    else if ((x * y) <= 5.6d-51) then
        tmp = z * ((t * 0.0625d0) + (c / z))
    else if ((x * y) <= 8.8d+101) then
        tmp = t_1
    else
        tmp = (x * y) + (0.0625d0 * (z * t))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -1.05e+57) {
		tmp = c + (x * y);
	} else if ((x * y) <= 2.9e-272) {
		tmp = t_1;
	} else if ((x * y) <= 5.6e-51) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 8.8e+101) {
		tmp = t_1;
	} else {
		tmp = (x * y) + (0.0625 * (z * t));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = c + (b * (a * -0.25))
	tmp = 0
	if (x * y) <= -1.05e+57:
		tmp = c + (x * y)
	elif (x * y) <= 2.9e-272:
		tmp = t_1
	elif (x * y) <= 5.6e-51:
		tmp = z * ((t * 0.0625) + (c / z))
	elif (x * y) <= 8.8e+101:
		tmp = t_1
	else:
		tmp = (x * y) + (0.0625 * (z * t))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -1.05e+57)
		tmp = Float64(c + Float64(x * y));
	elseif (Float64(x * y) <= 2.9e-272)
		tmp = t_1;
	elseif (Float64(x * y) <= 5.6e-51)
		tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z)));
	elseif (Float64(x * y) <= 8.8e+101)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (b * (a * -0.25));
	tmp = 0.0;
	if ((x * y) <= -1.05e+57)
		tmp = c + (x * y);
	elseif ((x * y) <= 2.9e-272)
		tmp = t_1;
	elseif ((x * y) <= 5.6e-51)
		tmp = z * ((t * 0.0625) + (c / z));
	elseif ((x * y) <= 8.8e+101)
		tmp = t_1;
	else
		tmp = (x * y) + (0.0625 * (z * t));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.05e+57], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.9e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5.6e-51], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.8e+101], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+57}:\\
\;\;\;\;c + x \cdot y\\

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

\mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-51}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\


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

    1. Initial program 93.6%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 81.4%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in x around inf 79.6%

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

    if -1.04999999999999995e57 < (*.f64 x y) < 2.89999999999999995e-272 or 5.6e-51 < (*.f64 x y) < 8.8000000000000003e101

    1. Initial program 99.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 68.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*68.3%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative68.3%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative68.3%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified68.3%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]

    if 2.89999999999999995e-272 < (*.f64 x y) < 5.6e-51

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 90.7%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in t around inf 74.4%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    5. Step-by-step derivation
      1. *-commutative74.4%

        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} + c \]
      2. *-commutative74.4%

        \[\leadsto \color{blue}{\left(z \cdot t\right)} \cdot 0.0625 + c \]
      3. associate-*r*74.4%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative74.4%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    6. Simplified74.4%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]
    7. Taylor expanded in z around inf 69.9%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t + \frac{c}{z}\right)} \]

    if 8.8000000000000003e101 < (*.f64 x y)

    1. Initial program 94.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 84.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+57}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{-272}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 5.6 \cdot 10^{-51}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 8.8 \cdot 10^{+101}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 64.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 2.45 \cdot 10^{-272}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-52}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* b (* a -0.25)))))
   (if (<= (* x y) -1.8e+182)
     (- (* x y) (* (* a b) 0.25))
     (if (<= (* x y) 2.45e-272)
       t_1
       (if (<= (* x y) 4.8e-52)
         (* z (+ (* t 0.0625) (/ c z)))
         (if (<= (* x y) 8.5e+101) t_1 (+ (* x y) (* 0.0625 (* z t)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -1.8e+182) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((x * y) <= 2.45e-272) {
		tmp = t_1;
	} else if ((x * y) <= 4.8e-52) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 8.5e+101) {
		tmp = t_1;
	} else {
		tmp = (x * y) + (0.0625 * (z * t));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = c + (b * (a * (-0.25d0)))
    if ((x * y) <= (-1.8d+182)) then
        tmp = (x * y) - ((a * b) * 0.25d0)
    else if ((x * y) <= 2.45d-272) then
        tmp = t_1
    else if ((x * y) <= 4.8d-52) then
        tmp = z * ((t * 0.0625d0) + (c / z))
    else if ((x * y) <= 8.5d+101) then
        tmp = t_1
    else
        tmp = (x * y) + (0.0625d0 * (z * t))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (b * (a * -0.25));
	double tmp;
	if ((x * y) <= -1.8e+182) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((x * y) <= 2.45e-272) {
		tmp = t_1;
	} else if ((x * y) <= 4.8e-52) {
		tmp = z * ((t * 0.0625) + (c / z));
	} else if ((x * y) <= 8.5e+101) {
		tmp = t_1;
	} else {
		tmp = (x * y) + (0.0625 * (z * t));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = c + (b * (a * -0.25))
	tmp = 0
	if (x * y) <= -1.8e+182:
		tmp = (x * y) - ((a * b) * 0.25)
	elif (x * y) <= 2.45e-272:
		tmp = t_1
	elif (x * y) <= 4.8e-52:
		tmp = z * ((t * 0.0625) + (c / z))
	elif (x * y) <= 8.5e+101:
		tmp = t_1
	else:
		tmp = (x * y) + (0.0625 * (z * t))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -1.8e+182)
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	elseif (Float64(x * y) <= 2.45e-272)
		tmp = t_1;
	elseif (Float64(x * y) <= 4.8e-52)
		tmp = Float64(z * Float64(Float64(t * 0.0625) + Float64(c / z)));
	elseif (Float64(x * y) <= 8.5e+101)
		tmp = t_1;
	else
		tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (b * (a * -0.25));
	tmp = 0.0;
	if ((x * y) <= -1.8e+182)
		tmp = (x * y) - ((a * b) * 0.25);
	elseif ((x * y) <= 2.45e-272)
		tmp = t_1;
	elseif ((x * y) <= 4.8e-52)
		tmp = z * ((t * 0.0625) + (c / z));
	elseif ((x * y) <= 8.5e+101)
		tmp = t_1;
	else
		tmp = (x * y) + (0.0625 * (z * t));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+182], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.45e-272], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 4.8e-52], N[(z * N[(N[(t * 0.0625), $MachinePrecision] + N[(c / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.5e+101], t$95$1, N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\

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

\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-52}:\\
\;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\

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

\mathbf{else}:\\
\;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\


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

    1. Initial program 89.7%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 93.1%

      \[\leadsto \color{blue}{x \cdot y - 0.25 \cdot \left(a \cdot b\right)} \]

    if -1.8e182 < (*.f64 x y) < 2.4499999999999999e-272 or 4.8000000000000003e-52 < (*.f64 x y) < 8.5000000000000001e101

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 67.3%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*67.3%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative67.3%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative67.3%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified67.3%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]

    if 2.4499999999999999e-272 < (*.f64 x y) < 4.8000000000000003e-52

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 90.7%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in t around inf 74.4%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    5. Step-by-step derivation
      1. *-commutative74.4%

        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} + c \]
      2. *-commutative74.4%

        \[\leadsto \color{blue}{\left(z \cdot t\right)} \cdot 0.0625 + c \]
      3. associate-*r*74.4%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative74.4%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    6. Simplified74.4%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t\right)} + c \]
    7. Taylor expanded in z around inf 69.9%

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t + \frac{c}{z}\right)} \]

    if 8.5000000000000001e101 < (*.f64 x y)

    1. Initial program 94.1%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 84.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 2.45 \cdot 10^{-272}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{-52}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625 + \frac{c}{z}\right)\\ \mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{+101}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 98.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;c + t\_1\\ \mathbf{else}:\\ \;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
   (if (<= t_1 INFINITY)
     (+ c t_1)
     (+ c (* y (+ x (* 0.0625 (/ (* z t) y))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = c + t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)
	tmp = 0
	if t_1 <= math.inf:
		tmp = c + t_1
	else:
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y)))));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = c + t_1;
	else
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;c + t\_1\\

\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing

    if +inf.0 < (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64)))

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 33.3%

      \[\leadsto \color{blue}{c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    4. Taylor expanded in y around inf 66.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 60.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;z \leq -4.7 \cdot 10^{+122}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-306}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-238}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-70}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y)))
        (t_2 (+ c (* z (* t 0.0625))))
        (t_3 (+ c (* b (* a -0.25)))))
   (if (<= z -4.7e+122)
     t_2
     (if (<= z -1.52e-74)
       t_1
       (if (<= z 5.5e-306)
         t_3
         (if (<= z 1.5e-238) t_1 (if (<= z 9.5e-70) t_3 t_2)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = c + (z * (t * 0.0625));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (z <= -4.7e+122) {
		tmp = t_2;
	} else if (z <= -1.52e-74) {
		tmp = t_1;
	} else if (z <= 5.5e-306) {
		tmp = t_3;
	} else if (z <= 1.5e-238) {
		tmp = t_1;
	} else if (z <= 9.5e-70) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = c + (z * (t * 0.0625d0))
    t_3 = c + (b * (a * (-0.25d0)))
    if (z <= (-4.7d+122)) then
        tmp = t_2
    else if (z <= (-1.52d-74)) then
        tmp = t_1
    else if (z <= 5.5d-306) then
        tmp = t_3
    else if (z <= 1.5d-238) then
        tmp = t_1
    else if (z <= 9.5d-70) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = c + (z * (t * 0.0625));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (z <= -4.7e+122) {
		tmp = t_2;
	} else if (z <= -1.52e-74) {
		tmp = t_1;
	} else if (z <= 5.5e-306) {
		tmp = t_3;
	} else if (z <= 1.5e-238) {
		tmp = t_1;
	} else if (z <= 9.5e-70) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = c + (z * (t * 0.0625))
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if z <= -4.7e+122:
		tmp = t_2
	elif z <= -1.52e-74:
		tmp = t_1
	elif z <= 5.5e-306:
		tmp = t_3
	elif z <= 1.5e-238:
		tmp = t_1
	elif z <= 9.5e-70:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(c + Float64(z * Float64(t * 0.0625)))
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (z <= -4.7e+122)
		tmp = t_2;
	elseif (z <= -1.52e-74)
		tmp = t_1;
	elseif (z <= 5.5e-306)
		tmp = t_3;
	elseif (z <= 1.5e-238)
		tmp = t_1;
	elseif (z <= 9.5e-70)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = c + (z * (t * 0.0625));
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (z <= -4.7e+122)
		tmp = t_2;
	elseif (z <= -1.52e-74)
		tmp = t_1;
	elseif (z <= 5.5e-306)
		tmp = t_3;
	elseif (z <= 1.5e-238)
		tmp = t_1;
	elseif (z <= 9.5e-70)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.7e+122], t$95$2, If[LessEqual[z, -1.52e-74], t$95$1, If[LessEqual[z, 5.5e-306], t$95$3, If[LessEqual[z, 1.5e-238], t$95$1, If[LessEqual[z, 9.5e-70], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := c + z \cdot \left(t \cdot 0.0625\right)\\
t_3 := c + b \cdot \left(a \cdot -0.25\right)\\
\mathbf{if}\;z \leq -4.7 \cdot 10^{+122}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-306}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{-238}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-70}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.70000000000000023e122 or 9.4999999999999994e-70 < z

    1. Initial program 95.8%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 80.5%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in t around inf 63.4%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    5. Step-by-step derivation
      1. *-commutative63.4%

        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot 0.0625} + c \]
      2. *-commutative63.4%

        \[\leadsto \color{blue}{\left(z \cdot t\right)} \cdot 0.0625 + c \]
      3. associate-*r*63.4%

        \[\leadsto \color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c \]
      4. *-commutative63.4%

        \[\leadsto z \cdot \color{blue}{\left(0.0625 \cdot t\right)} + c \]
    6. Simplified63.4%

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

    if -4.70000000000000023e122 < z < -1.51999999999999997e-74 or 5.49999999999999992e-306 < z < 1.5e-238

    1. Initial program 98.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 98.1%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in x around inf 67.4%

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

    if -1.51999999999999997e-74 < z < 5.49999999999999992e-306 or 1.5e-238 < z < 9.4999999999999994e-70

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 65.2%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*65.2%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative65.2%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative65.2%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified65.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.7 \cdot 10^{+122}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-74}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-306}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-238}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-70}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 89.0% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := t\_2 - t\_1\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+94}:\\ \;\;\;\;c + \left(x \cdot y + t\_2\right)\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+239}:\\ \;\;\;\;\left(c + x \cdot y\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))) (t_3 (- t_2 t_1)))
   (if (<= (* a b) -1e+154)
     t_3
     (if (<= (* a b) 2e+94)
       (+ c (+ (* x y) t_2))
       (if (<= (* a b) 4e+239) (- (+ c (* x y)) t_1) t_3)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double t_3 = t_2 - t_1;
	double tmp;
	if ((a * b) <= -1e+154) {
		tmp = t_3;
	} else if ((a * b) <= 2e+94) {
		tmp = c + ((x * y) + t_2);
	} else if ((a * b) <= 4e+239) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (a * b) * 0.25d0
    t_2 = 0.0625d0 * (z * t)
    t_3 = t_2 - t_1
    if ((a * b) <= (-1d+154)) then
        tmp = t_3
    else if ((a * b) <= 2d+94) then
        tmp = c + ((x * y) + t_2)
    else if ((a * b) <= 4d+239) then
        tmp = (c + (x * y)) - t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double t_3 = t_2 - t_1;
	double tmp;
	if ((a * b) <= -1e+154) {
		tmp = t_3;
	} else if ((a * b) <= 2e+94) {
		tmp = c + ((x * y) + t_2);
	} else if ((a * b) <= 4e+239) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	t_2 = 0.0625 * (z * t)
	t_3 = t_2 - t_1
	tmp = 0
	if (a * b) <= -1e+154:
		tmp = t_3
	elif (a * b) <= 2e+94:
		tmp = c + ((x * y) + t_2)
	elif (a * b) <= 4e+239:
		tmp = (c + (x * y)) - t_1
	else:
		tmp = t_3
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	t_2 = Float64(0.0625 * Float64(z * t))
	t_3 = Float64(t_2 - t_1)
	tmp = 0.0
	if (Float64(a * b) <= -1e+154)
		tmp = t_3;
	elseif (Float64(a * b) <= 2e+94)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	elseif (Float64(a * b) <= 4e+239)
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	else
		tmp = t_3;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	t_2 = 0.0625 * (z * t);
	t_3 = t_2 - t_1;
	tmp = 0.0;
	if ((a * b) <= -1e+154)
		tmp = t_3;
	elseif ((a * b) <= 2e+94)
		tmp = c + ((x * y) + t_2);
	elseif ((a * b) <= 4e+239)
		tmp = (c + (x * y)) - t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - t$95$1), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+154], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 2e+94], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 4e+239], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
t_3 := t\_2 - t\_1\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+239}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\

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


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

    1. Initial program 96.9%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 93.8%

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 92.6%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right) - 0.25 \cdot \left(a \cdot b\right)} \]

    if -1.00000000000000004e154 < (*.f64 a b) < 2e94

    1. Initial program 98.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 90.2%

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

    if 2e94 < (*.f64 a b) < 3.99999999999999996e239

    1. Initial program 94.7%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 94.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+94}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+239}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 89.2% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+14}:\\ \;\;\;\;\left(c + x \cdot y\right) - t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+151}:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)))
   (if (<= (* x y) -2e+14)
     (- (+ c (* x y)) t_1)
     (if (<= (* x y) 2e+151)
       (- (+ c (* 0.0625 (* z t))) t_1)
       (+ c (* y (+ x (* 0.0625 (/ (* z t) y)))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double tmp;
	if ((x * y) <= -2e+14) {
		tmp = (c + (x * y)) - t_1;
	} else if ((x * y) <= 2e+151) {
		tmp = (c + (0.0625 * (z * t))) - t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) * 0.25d0
    if ((x * y) <= (-2d+14)) then
        tmp = (c + (x * y)) - t_1
    else if ((x * y) <= 2d+151) then
        tmp = (c + (0.0625d0 * (z * t))) - t_1
    else
        tmp = c + (y * (x + (0.0625d0 * ((z * t) / y))))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double tmp;
	if ((x * y) <= -2e+14) {
		tmp = (c + (x * y)) - t_1;
	} else if ((x * y) <= 2e+151) {
		tmp = (c + (0.0625 * (z * t))) - t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	tmp = 0
	if (x * y) <= -2e+14:
		tmp = (c + (x * y)) - t_1
	elif (x * y) <= 2e+151:
		tmp = (c + (0.0625 * (z * t))) - t_1
	else:
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	tmp = 0.0
	if (Float64(x * y) <= -2e+14)
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	elseif (Float64(x * y) <= 2e+151)
		tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1);
	else
		tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y)))));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	tmp = 0.0;
	if ((x * y) <= -2e+14)
		tmp = (c + (x * y)) - t_1;
	elseif ((x * y) <= 2e+151)
		tmp = (c + (0.0625 * (z * t))) - t_1;
	else
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+14], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+151], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+14}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\

\mathbf{else}:\\
\;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\


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

    1. Initial program 94.8%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 90.8%

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

    if -2e14 < (*.f64 x y) < 2.00000000000000003e151

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 96.0%

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

    if 2.00000000000000003e151 < (*.f64 x y)

    1. Initial program 92.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 87.5%

      \[\leadsto \color{blue}{c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    4. Taylor expanded in y around inf 90.2%

      \[\leadsto c + \color{blue}{y \cdot \left(x + 0.0625 \cdot \frac{t \cdot z}{y}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+14}:\\ \;\;\;\;\left(c + x \cdot y\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+151}:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 88.2% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+114}\right):\\ \;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + t\_1\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))))
   (if (or (<= (* a b) -1e+154) (not (<= (* a b) 5e+114)))
     (- t_1 (* (* a b) 0.25))
     (+ c (+ (* x y) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double tmp;
	if (((a * b) <= -1e+154) || !((a * b) <= 5e+114)) {
		tmp = t_1 - ((a * b) * 0.25);
	} else {
		tmp = c + ((x * y) + t_1);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: t_1
    real(8) :: tmp
    t_1 = 0.0625d0 * (z * t)
    if (((a * b) <= (-1d+154)) .or. (.not. ((a * b) <= 5d+114))) then
        tmp = t_1 - ((a * b) * 0.25d0)
    else
        tmp = c + ((x * y) + t_1)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double tmp;
	if (((a * b) <= -1e+154) || !((a * b) <= 5e+114)) {
		tmp = t_1 - ((a * b) * 0.25);
	} else {
		tmp = c + ((x * y) + t_1);
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	tmp = 0
	if ((a * b) <= -1e+154) or not ((a * b) <= 5e+114):
		tmp = t_1 - ((a * b) * 0.25)
	else:
		tmp = c + ((x * y) + t_1)
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	tmp = 0.0
	if ((Float64(a * b) <= -1e+154) || !(Float64(a * b) <= 5e+114))
		tmp = Float64(t_1 - Float64(Float64(a * b) * 0.25));
	else
		tmp = Float64(c + Float64(Float64(x * y) + t_1));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	tmp = 0.0;
	if (((a * b) <= -1e+154) || ~(((a * b) <= 5e+114)))
		tmp = t_1 - ((a * b) * 0.25);
	else
		tmp = c + ((x * y) + t_1);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(a * b), $MachinePrecision], -1e+154], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+114]], $MachinePrecision]], N[(t$95$1 - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+114}\right):\\
\;\;\;\;t\_1 - \left(a \cdot b\right) \cdot 0.25\\

\mathbf{else}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\


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

    1. Initial program 96.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 93.8%

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 86.9%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right) - 0.25 \cdot \left(a \cdot b\right)} \]

    if -1.00000000000000004e154 < (*.f64 a b) < 5.0000000000000001e114

    1. Initial program 98.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 89.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+154} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+114}\right):\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right) - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 87.4% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+151}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+114}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* a b) -1e+151)
   (- (* x y) (* (* a b) 0.25))
   (if (<= (* a b) 5e+114)
     (+ c (+ (* x y) (* 0.0625 (* z t))))
     (+ c (* b (* a -0.25))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a * b) <= -1e+151) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((a * b) <= 5e+114) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: tmp
    if ((a * b) <= (-1d+151)) then
        tmp = (x * y) - ((a * b) * 0.25d0)
    else if ((a * b) <= 5d+114) then
        tmp = c + ((x * y) + (0.0625d0 * (z * t)))
    else
        tmp = c + (b * (a * (-0.25d0)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a * b) <= -1e+151) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((a * b) <= 5e+114) {
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (a * b) <= -1e+151:
		tmp = (x * y) - ((a * b) * 0.25)
	elif (a * b) <= 5e+114:
		tmp = c + ((x * y) + (0.0625 * (z * t)))
	else:
		tmp = c + (b * (a * -0.25))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(a * b) <= -1e+151)
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	elseif (Float64(a * b) <= 5e+114)
		tmp = Float64(c + Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t))));
	else
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((a * b) <= -1e+151)
		tmp = (x * y) - ((a * b) * 0.25);
	elseif ((a * b) <= 5e+114)
		tmp = c + ((x * y) + (0.0625 * (z * t)));
	else
		tmp = c + (b * (a * -0.25));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(a * b), $MachinePrecision], -1e+151], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+114], N[(c + N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+151}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+114}:\\
\;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\

\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\


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

    1. Initial program 97.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 81.6%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in c around 0 79.3%

      \[\leadsto \color{blue}{x \cdot y - 0.25 \cdot \left(a \cdot b\right)} \]

    if -1.00000000000000002e151 < (*.f64 a b) < 5.0000000000000001e114

    1. Initial program 98.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 90.2%

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

    if 5.0000000000000001e114 < (*.f64 a b)

    1. Initial program 95.6%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 78.5%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*78.5%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative78.5%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative78.5%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified78.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+151}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+114}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 65.0% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+57} \lor \neg \left(x \cdot y \leq 4.6 \cdot 10^{+82}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= (* x y) -1.4e+57) (not (<= (* x y) 4.6e+82)))
   (+ c (* x y))
   (+ c (* b (* a -0.25)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -1.4e+57) || !((x * y) <= 4.6e+82)) {
		tmp = c + (x * y);
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: tmp
    if (((x * y) <= (-1.4d+57)) .or. (.not. ((x * y) <= 4.6d+82))) then
        tmp = c + (x * y)
    else
        tmp = c + (b * (a * (-0.25d0)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -1.4e+57) || !((x * y) <= 4.6e+82)) {
		tmp = c + (x * y);
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((x * y) <= -1.4e+57) or not ((x * y) <= 4.6e+82):
		tmp = c + (x * y)
	else:
		tmp = c + (b * (a * -0.25))
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(x * y) <= -1.4e+57) || !(Float64(x * y) <= 4.6e+82))
		tmp = Float64(c + Float64(x * y));
	else
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (((x * y) <= -1.4e+57) || ~(((x * y) <= 4.6e+82)))
		tmp = c + (x * y);
	else
		tmp = c + (b * (a * -0.25));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.4e+57], N[Not[LessEqual[N[(x * y), $MachinePrecision], 4.6e+82]], $MachinePrecision]], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+57} \lor \neg \left(x \cdot y \leq 4.6 \cdot 10^{+82}\right):\\
\;\;\;\;c + x \cdot y\\

\mathbf{else}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.4e57 or 4.59999999999999976e82 < (*.f64 x y)

    1. Initial program 94.2%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 86.9%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in x around inf 71.9%

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

    if -1.4e57 < (*.f64 x y) < 4.59999999999999976e82

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 63.0%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + c \]
    4. Step-by-step derivation
      1. associate-*r*63.0%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c \]
      2. *-commutative63.0%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} + c \]
      3. *-commutative63.0%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} + c \]
    5. Simplified63.0%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} + c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+57} \lor \neg \left(x \cdot y \leq 4.6 \cdot 10^{+82}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 41.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+96}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= (* x y) -1.8e+182) (not (<= (* x y) 7.5e+96))) (* x y) c))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -1.8e+182) || !((x * y) <= 7.5e+96)) {
		tmp = x * y;
	} else {
		tmp = c;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: tmp
    if (((x * y) <= (-1.8d+182)) .or. (.not. ((x * y) <= 7.5d+96))) then
        tmp = x * y
    else
        tmp = c
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -1.8e+182) || !((x * y) <= 7.5e+96)) {
		tmp = x * y;
	} else {
		tmp = c;
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((x * y) <= -1.8e+182) or not ((x * y) <= 7.5e+96):
		tmp = x * y
	else:
		tmp = c
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(x * y) <= -1.8e+182) || !(Float64(x * y) <= 7.5e+96))
		tmp = Float64(x * y);
	else
		tmp = c;
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (((x * y) <= -1.8e+182) || ~(((x * y) <= 7.5e+96)))
		tmp = x * y;
	else
		tmp = c;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.8e+182], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.5e+96]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+96}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.8e182 or 7.4999999999999996e96 < (*.f64 x y)

    1. Initial program 92.5%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 79.9%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in x around inf 66.9%

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

    if -1.8e182 < (*.f64 x y) < 7.4999999999999996e96

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf 30.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+182} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+96}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 54.8% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+127} \lor \neg \left(a \leq 1.26 \cdot 10^{+44}\right):\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= a -1.7e+127) (not (<= a 1.26e+44)))
   (* b (* a -0.25))
   (+ c (* x y))))
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a <= -1.7e+127) || !(a <= 1.26e+44)) {
		tmp = b * (a * -0.25);
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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) :: tmp
    if ((a <= (-1.7d+127)) .or. (.not. (a <= 1.26d+44))) then
        tmp = b * (a * (-0.25d0))
    else
        tmp = c + (x * y)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((a <= -1.7e+127) || !(a <= 1.26e+44)) {
		tmp = b * (a * -0.25);
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (a <= -1.7e+127) or not (a <= 1.26e+44):
		tmp = b * (a * -0.25)
	else:
		tmp = c + (x * y)
	return tmp
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((a <= -1.7e+127) || !(a <= 1.26e+44))
		tmp = Float64(b * Float64(a * -0.25));
	else
		tmp = Float64(c + Float64(x * y));
	end
	return tmp
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((a <= -1.7e+127) || ~((a <= 1.26e+44)))
		tmp = b * (a * -0.25);
	else
		tmp = c + (x * y);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[a, -1.7e+127], N[Not[LessEqual[a, 1.26e+44]], $MachinePrecision]], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+127} \lor \neg \left(a \leq 1.26 \cdot 10^{+44}\right):\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.69999999999999989e127 or 1.25999999999999996e44 < a

    1. Initial program 98.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 73.9%

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Taylor expanded in a around inf 52.2%

      \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} \]
      2. *-commutative52.2%

        \[\leadsto \color{blue}{b \cdot \left(-0.25 \cdot a\right)} \]
      3. *-commutative52.2%

        \[\leadsto b \cdot \color{blue}{\left(a \cdot -0.25\right)} \]
    6. Simplified52.2%

      \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]

    if -1.69999999999999989e127 < a < 1.25999999999999996e44

    1. Initial program 97.4%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 93.2%

      \[\leadsto \color{blue}{t \cdot \left(\left(0.0625 \cdot z + \frac{x \cdot y}{t}\right) - 0.25 \cdot \frac{a \cdot b}{t}\right)} + c \]
    4. Taylor expanded in x around inf 60.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+127} \lor \neg \left(a \leq 1.26 \cdot 10^{+44}\right):\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 22.5% accurate, 17.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\ \\ c \end{array} \]
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c) :precision binary64 c)
assert(x < y && y < z && z < t && t < a && a < b && b < c);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    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
    code = c
end function
assert x < y && y < z && z < t && t < a && a < b && b < c;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
[x, y, z, t, a, b, c] = sort([x, y, z, t, a, b, c])
def code(x, y, z, t, a, b, c):
	return c
x, y, z, t, a, b, c = sort([x, y, z, t, a, b, c])
function code(x, y, z, t, a, b, c)
	return c
end
x, y, z, t, a, b, c = num2cell(sort([x, y, z, t, a, b, c])){:}
function tmp = code(x, y, z, t, a, b, c)
	tmp = c;
end
NOTE: x, y, z, t, a, b, and c should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
[x, y, z, t, a, b, c] = \mathsf{sort}([x, y, z, t, a, b, c])\\
\\
c
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
  2. Add Preprocessing
  3. Taylor expanded in c around inf 23.6%

    \[\leadsto \color{blue}{c} \]
  4. Final simplification23.6%

    \[\leadsto c \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2024075 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))