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

Percentage Accurate: 97.7% → 99.0%
Time: 11.4s
Alternatives: 13
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 13 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: 97.7% 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: 99.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \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} \]
(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))))))))
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;
}
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;
}
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
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
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
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}

\\
\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 y around inf 0.0%

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

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

    \[\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 2: 98.2% accurate, 0.1× speedup?

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

\\
\left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\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 + \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-define97.6%

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

      \[\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*97.6%

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

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

    \[\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. Add Preprocessing

Alternative 3: 65.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\ t_2 := c + a \cdot \left(b \cdot -0.25\right)\\ t_3 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+162}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq -2000000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-291}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-303}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-21}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* t (* z 0.0625))))
        (t_2 (+ c (* a (* b -0.25))))
        (t_3 (+ c (* x y))))
   (if (<= (* x y) -1e+162)
     t_3
     (if (<= (* x y) -2000000000000.0)
       t_1
       (if (<= (* x y) -2e-291)
         t_2
         (if (<= (* x y) 2e-303)
           t_1
           (if (<= (* x y) 2e-21) t_2 (if (<= (* x y) 4e+39) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (t * (z * 0.0625));
	double t_2 = c + (a * (b * -0.25));
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -1e+162) {
		tmp = t_3;
	} else if ((x * y) <= -2000000000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -2e-291) {
		tmp = t_2;
	} else if ((x * y) <= 2e-303) {
		tmp = t_1;
	} else if ((x * y) <= 2e-21) {
		tmp = t_2;
	} else if ((x * y) <= 4e+39) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
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 + (t * (z * 0.0625d0))
    t_2 = c + (a * (b * (-0.25d0)))
    t_3 = c + (x * y)
    if ((x * y) <= (-1d+162)) then
        tmp = t_3
    else if ((x * y) <= (-2000000000000.0d0)) then
        tmp = t_1
    else if ((x * y) <= (-2d-291)) then
        tmp = t_2
    else if ((x * y) <= 2d-303) then
        tmp = t_1
    else if ((x * y) <= 2d-21) then
        tmp = t_2
    else if ((x * y) <= 4d+39) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (t * (z * 0.0625));
	double t_2 = c + (a * (b * -0.25));
	double t_3 = c + (x * y);
	double tmp;
	if ((x * y) <= -1e+162) {
		tmp = t_3;
	} else if ((x * y) <= -2000000000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -2e-291) {
		tmp = t_2;
	} else if ((x * y) <= 2e-303) {
		tmp = t_1;
	} else if ((x * y) <= 2e-21) {
		tmp = t_2;
	} else if ((x * y) <= 4e+39) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (t * (z * 0.0625))
	t_2 = c + (a * (b * -0.25))
	t_3 = c + (x * y)
	tmp = 0
	if (x * y) <= -1e+162:
		tmp = t_3
	elif (x * y) <= -2000000000000.0:
		tmp = t_1
	elif (x * y) <= -2e-291:
		tmp = t_2
	elif (x * y) <= 2e-303:
		tmp = t_1
	elif (x * y) <= 2e-21:
		tmp = t_2
	elif (x * y) <= 4e+39:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(t * Float64(z * 0.0625)))
	t_2 = Float64(c + Float64(a * Float64(b * -0.25)))
	t_3 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -1e+162)
		tmp = t_3;
	elseif (Float64(x * y) <= -2000000000000.0)
		tmp = t_1;
	elseif (Float64(x * y) <= -2e-291)
		tmp = t_2;
	elseif (Float64(x * y) <= 2e-303)
		tmp = t_1;
	elseif (Float64(x * y) <= 2e-21)
		tmp = t_2;
	elseif (Float64(x * y) <= 4e+39)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (t * (z * 0.0625));
	t_2 = c + (a * (b * -0.25));
	t_3 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -1e+162)
		tmp = t_3;
	elseif ((x * y) <= -2000000000000.0)
		tmp = t_1;
	elseif ((x * y) <= -2e-291)
		tmp = t_2;
	elseif ((x * y) <= 2e-303)
		tmp = t_1;
	elseif ((x * y) <= 2e-21)
		tmp = t_2;
	elseif ((x * y) <= 4e+39)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+162], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -2000000000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2e-291], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 2e-303], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 2e-21], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4e+39], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + a \cdot \left(b \cdot -0.25\right)\\
t_3 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+162}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \cdot y \leq -2000000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-291}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.9999999999999994e161 or 3.99999999999999976e39 < (*.f64 x y)

    1. Initial program 96.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 x around inf 79.3%

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

    if -9.9999999999999994e161 < (*.f64 x y) < -2e12 or -1.99999999999999992e-291 < (*.f64 x y) < 1.99999999999999986e-303 or 1.99999999999999982e-21 < (*.f64 x y) < 3.99999999999999976e39

    1. Initial program 98.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 inf 73.7%

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} + c \]
    5. Simplified73.7%

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

    if -2e12 < (*.f64 x y) < -1.99999999999999992e-291 or 1.99999999999999986e-303 < (*.f64 x y) < 1.99999999999999982e-21

    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 a around inf 73.8%

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

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

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

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

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

Alternative 4: 45.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(z \cdot 0.0625\right)\\ t_2 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+155}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2900000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-298}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-19}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* t (* z 0.0625))) (t_2 (* (* a b) -0.25)))
   (if (<= (* x y) -1.8e+155)
     (* x y)
     (if (<= (* x y) -2900000000.0)
       t_1
       (if (<= (* x y) -5.5e-298)
         t_2
         (if (<= (* x y) 1.4e-302)
           t_1
           (if (<= (* x y) 1.4e-19)
             t_2
             (if (<= (* x y) 6e+41) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = t * (z * 0.0625);
	double t_2 = (a * b) * -0.25;
	double tmp;
	if ((x * y) <= -1.8e+155) {
		tmp = x * y;
	} else if ((x * y) <= -2900000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -5.5e-298) {
		tmp = t_2;
	} else if ((x * y) <= 1.4e-302) {
		tmp = t_1;
	} else if ((x * y) <= 1.4e-19) {
		tmp = t_2;
	} else if ((x * y) <= 6e+41) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
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 = t * (z * 0.0625d0)
    t_2 = (a * b) * (-0.25d0)
    if ((x * y) <= (-1.8d+155)) then
        tmp = x * y
    else if ((x * y) <= (-2900000000.0d0)) then
        tmp = t_1
    else if ((x * y) <= (-5.5d-298)) then
        tmp = t_2
    else if ((x * y) <= 1.4d-302) then
        tmp = t_1
    else if ((x * y) <= 1.4d-19) then
        tmp = t_2
    else if ((x * y) <= 6d+41) then
        tmp = t_1
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = t * (z * 0.0625);
	double t_2 = (a * b) * -0.25;
	double tmp;
	if ((x * y) <= -1.8e+155) {
		tmp = x * y;
	} else if ((x * y) <= -2900000000.0) {
		tmp = t_1;
	} else if ((x * y) <= -5.5e-298) {
		tmp = t_2;
	} else if ((x * y) <= 1.4e-302) {
		tmp = t_1;
	} else if ((x * y) <= 1.4e-19) {
		tmp = t_2;
	} else if ((x * y) <= 6e+41) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = t * (z * 0.0625)
	t_2 = (a * b) * -0.25
	tmp = 0
	if (x * y) <= -1.8e+155:
		tmp = x * y
	elif (x * y) <= -2900000000.0:
		tmp = t_1
	elif (x * y) <= -5.5e-298:
		tmp = t_2
	elif (x * y) <= 1.4e-302:
		tmp = t_1
	elif (x * y) <= 1.4e-19:
		tmp = t_2
	elif (x * y) <= 6e+41:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(t * Float64(z * 0.0625))
	t_2 = Float64(Float64(a * b) * -0.25)
	tmp = 0.0
	if (Float64(x * y) <= -1.8e+155)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -2900000000.0)
		tmp = t_1;
	elseif (Float64(x * y) <= -5.5e-298)
		tmp = t_2;
	elseif (Float64(x * y) <= 1.4e-302)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.4e-19)
		tmp = t_2;
	elseif (Float64(x * y) <= 6e+41)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = t * (z * 0.0625);
	t_2 = (a * b) * -0.25;
	tmp = 0.0;
	if ((x * y) <= -1.8e+155)
		tmp = x * y;
	elseif ((x * y) <= -2900000000.0)
		tmp = t_1;
	elseif ((x * y) <= -5.5e-298)
		tmp = t_2;
	elseif ((x * y) <= 1.4e-302)
		tmp = t_1;
	elseif ((x * y) <= 1.4e-19)
		tmp = t_2;
	elseif ((x * y) <= 6e+41)
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e+155], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2900000000.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5.5e-298], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-302], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.4e-19], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e+41], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+155}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -2900000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-298}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.80000000000000004e155 or 5.9999999999999997e41 < (*.f64 x y)

    1. Initial program 96.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 88.5%

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

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

    if -1.80000000000000004e155 < (*.f64 x y) < -2.9e9 or -5.4999999999999996e-298 < (*.f64 x y) < 1.4e-302 or 1.40000000000000001e-19 < (*.f64 x y) < 5.9999999999999997e41

    1. Initial program 98.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 inf 74.0%

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

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

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

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

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*48.8%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative48.8%

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} \]
    8. Simplified48.8%

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

    if -2.9e9 < (*.f64 x y) < -5.4999999999999996e-298 or 1.4e-302 < (*.f64 x y) < 1.40000000000000001e-19

    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 z around 0 81.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{+155}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2900000000:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-298}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-302}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.4 \cdot 10^{-19}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+41}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ t_2 := t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ \mathbf{if}\;t \leq -5.6 \cdot 10^{-34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-110}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{+49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{+81}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+170}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* a b) 0.25)))
        (t_2 (* t (+ (* z 0.0625) (/ c t)))))
   (if (<= t -5.6e-34)
     t_2
     (if (<= t 2.7e-110)
       t_1
       (if (<= t 6.6e-15)
         (+ c (* x y))
         (if (<= t 7.4e+49)
           t_1
           (if (<= t 2.3e+81)
             (+ c (* t (* z 0.0625)))
             (if (<= t 1.5e+170) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double t_2 = t * ((z * 0.0625) + (c / t));
	double tmp;
	if (t <= -5.6e-34) {
		tmp = t_2;
	} else if (t <= 2.7e-110) {
		tmp = t_1;
	} else if (t <= 6.6e-15) {
		tmp = c + (x * y);
	} else if (t <= 7.4e+49) {
		tmp = t_1;
	} else if (t <= 2.3e+81) {
		tmp = c + (t * (z * 0.0625));
	} else if (t <= 1.5e+170) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
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 = (x * y) - ((a * b) * 0.25d0)
    t_2 = t * ((z * 0.0625d0) + (c / t))
    if (t <= (-5.6d-34)) then
        tmp = t_2
    else if (t <= 2.7d-110) then
        tmp = t_1
    else if (t <= 6.6d-15) then
        tmp = c + (x * y)
    else if (t <= 7.4d+49) then
        tmp = t_1
    else if (t <= 2.3d+81) then
        tmp = c + (t * (z * 0.0625d0))
    else if (t <= 1.5d+170) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double t_2 = t * ((z * 0.0625) + (c / t));
	double tmp;
	if (t <= -5.6e-34) {
		tmp = t_2;
	} else if (t <= 2.7e-110) {
		tmp = t_1;
	} else if (t <= 6.6e-15) {
		tmp = c + (x * y);
	} else if (t <= 7.4e+49) {
		tmp = t_1;
	} else if (t <= 2.3e+81) {
		tmp = c + (t * (z * 0.0625));
	} else if (t <= 1.5e+170) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	t_2 = t * ((z * 0.0625) + (c / t))
	tmp = 0
	if t <= -5.6e-34:
		tmp = t_2
	elif t <= 2.7e-110:
		tmp = t_1
	elif t <= 6.6e-15:
		tmp = c + (x * y)
	elif t <= 7.4e+49:
		tmp = t_1
	elif t <= 2.3e+81:
		tmp = c + (t * (z * 0.0625))
	elif t <= 1.5e+170:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))
	t_2 = Float64(t * Float64(Float64(z * 0.0625) + Float64(c / t)))
	tmp = 0.0
	if (t <= -5.6e-34)
		tmp = t_2;
	elseif (t <= 2.7e-110)
		tmp = t_1;
	elseif (t <= 6.6e-15)
		tmp = Float64(c + Float64(x * y));
	elseif (t <= 7.4e+49)
		tmp = t_1;
	elseif (t <= 2.3e+81)
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	elseif (t <= 1.5e+170)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) - ((a * b) * 0.25);
	t_2 = t * ((z * 0.0625) + (c / t));
	tmp = 0.0;
	if (t <= -5.6e-34)
		tmp = t_2;
	elseif (t <= 2.7e-110)
		tmp = t_1;
	elseif (t <= 6.6e-15)
		tmp = c + (x * y);
	elseif (t <= 7.4e+49)
		tmp = t_1;
	elseif (t <= 2.3e+81)
		tmp = c + (t * (z * 0.0625));
	elseif (t <= 1.5e+170)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(z * 0.0625), $MachinePrecision] + N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e-34], t$95$2, If[LessEqual[t, 2.7e-110], t$95$1, If[LessEqual[t, 6.6e-15], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.4e+49], t$95$1, If[LessEqual[t, 2.3e+81], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+170], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
t_2 := t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 2.7 \cdot 10^{-110}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 7.4 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{+81}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -5.59999999999999994e-34 or 1.49999999999999998e170 < t

    1. Initial program 95.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 inf 66.1%

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} + c \]
    5. Simplified66.1%

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

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

    if -5.59999999999999994e-34 < t < 2.6999999999999998e-110 or 6.6e-15 < t < 7.40000000000000036e49 or 2.2999999999999999e81 < t < 1.49999999999999998e170

    1. Initial program 99.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 88.0%

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

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

    if 2.6999999999999998e-110 < t < 6.6e-15

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

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

    if 7.40000000000000036e49 < t < 2.2999999999999999e81

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{-34}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ \mathbf{elif}\;t \leq 2.7 \cdot 10^{-110}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{+49}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{+81}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+170}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 63.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 2.3 \cdot 10^{+89}\right) \land \left(a \cdot b \leq 1.22 \cdot 10^{+123} \lor \neg \left(a \cdot b \leq 6.2 \cdot 10^{+165}\right)\right):\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= (* a b) -6.5e+118)
         (and (not (<= (* a b) 2.3e+89))
              (or (<= (* a b) 1.22e+123) (not (<= (* a b) 6.2e+165)))))
   (* (* a b) -0.25)
   (+ c (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((a * b) <= -6.5e+118) || (!((a * b) <= 2.3e+89) && (((a * b) <= 1.22e+123) || !((a * b) <= 6.2e+165)))) {
		tmp = (a * b) * -0.25;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
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) <= (-6.5d+118)) .or. (.not. ((a * b) <= 2.3d+89)) .and. ((a * b) <= 1.22d+123) .or. (.not. ((a * b) <= 6.2d+165))) then
        tmp = (a * b) * (-0.25d0)
    else
        tmp = c + (x * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((a * b) <= -6.5e+118) || (!((a * b) <= 2.3e+89) && (((a * b) <= 1.22e+123) || !((a * b) <= 6.2e+165)))) {
		tmp = (a * b) * -0.25;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((a * b) <= -6.5e+118) or (not ((a * b) <= 2.3e+89) and (((a * b) <= 1.22e+123) or not ((a * b) <= 6.2e+165))):
		tmp = (a * b) * -0.25
	else:
		tmp = c + (x * y)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(a * b) <= -6.5e+118) || (!(Float64(a * b) <= 2.3e+89) && ((Float64(a * b) <= 1.22e+123) || !(Float64(a * b) <= 6.2e+165))))
		tmp = Float64(Float64(a * b) * -0.25);
	else
		tmp = Float64(c + Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (((a * b) <= -6.5e+118) || (~(((a * b) <= 2.3e+89)) && (((a * b) <= 1.22e+123) || ~(((a * b) <= 6.2e+165)))))
		tmp = (a * b) * -0.25;
	else
		tmp = c + (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -6.5e+118], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.3e+89]], $MachinePrecision], Or[LessEqual[N[(a * b), $MachinePrecision], 1.22e+123], N[Not[LessEqual[N[(a * b), $MachinePrecision], 6.2e+165]], $MachinePrecision]]]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 2.3 \cdot 10^{+89}\right) \land \left(a \cdot b \leq 1.22 \cdot 10^{+123} \lor \neg \left(a \cdot b \leq 6.2 \cdot 10^{+165}\right)\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -6.5e118 or 2.2999999999999999e89 < (*.f64 a b) < 1.22e123 or 6.2000000000000003e165 < (*.f64 a b)

    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 z around 0 84.2%

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

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

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

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

    if -6.5e118 < (*.f64 a b) < 2.2999999999999999e89 or 1.22e123 < (*.f64 a b) < 6.2000000000000003e165

    1. Initial program 99.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 x around inf 63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -6.5 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 2.3 \cdot 10^{+89}\right) \land \left(a \cdot b \leq 1.22 \cdot 10^{+123} \lor \neg \left(a \cdot b \leq 6.2 \cdot 10^{+165}\right)\right):\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 61.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
t_2 := c + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+162}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.9999999999999994e161 or 3.99999999999999976e39 < (*.f64 x y)

    1. Initial program 96.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 x around inf 79.3%

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

    if -9.9999999999999994e161 < (*.f64 x y) < -1.00000000000000004e36 or 1.99999999999999982e-21 < (*.f64 x y) < 3.99999999999999976e39

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} + c \]
    5. Simplified71.2%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*63.3%

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} \]
    8. Simplified63.3%

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

    if -1.00000000000000004e36 < (*.f64 x y) < 1.99999999999999982e-21

    1. Initial program 98.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 a around inf 69.1%

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

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

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

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

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

Alternative 8: 43.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+155}:\\
\;\;\;\;x \cdot y\\

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

\mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{-30}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.05e155 or 4.59999999999999987e40 < (*.f64 x y)

    1. Initial program 96.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 88.5%

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

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

    if -1.05e155 < (*.f64 x y) < -5.5999999999999998e-219 or 1.8000000000000002e-30 < (*.f64 x y) < 4.59999999999999987e40

    1. Initial program 96.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 inf 59.0%

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} + c \]
    5. Simplified59.0%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    7. Step-by-step derivation
      1. associate-*r*43.6%

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} \]
      2. *-commutative43.6%

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} \]
    8. Simplified43.6%

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

    if -5.5999999999999998e-219 < (*.f64 x y) < 1.8000000000000002e-30

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+155}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -5.6 \cdot 10^{-219}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.8 \cdot 10^{-30}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+40}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124}:\\ \;\;\;\;\left(c + x \cdot y\right) - t\_1\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+33}:\\ \;\;\;\;c + \left(x \cdot y + t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c + t\_2\right) - t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)) (t_2 (* 0.0625 (* z t))))
   (if (<= (* a b) -1e+124)
     (- (+ c (* x y)) t_1)
     (if (<= (* a b) 5e+33) (+ c (+ (* x y) t_2)) (- (+ c t_2) t_1)))))
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 tmp;
	if ((a * b) <= -1e+124) {
		tmp = (c + (x * y)) - t_1;
	} else if ((a * b) <= 5e+33) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (c + t_2) - t_1;
	}
	return tmp;
}
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) * 0.25d0
    t_2 = 0.0625d0 * (z * t)
    if ((a * b) <= (-1d+124)) then
        tmp = (c + (x * y)) - t_1
    else if ((a * b) <= 5d+33) then
        tmp = c + ((x * y) + t_2)
    else
        tmp = (c + t_2) - t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if ((a * b) <= -1e+124) {
		tmp = (c + (x * y)) - t_1;
	} else if ((a * b) <= 5e+33) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = (c + t_2) - t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	t_2 = 0.0625 * (z * t)
	tmp = 0
	if (a * b) <= -1e+124:
		tmp = (c + (x * y)) - t_1
	elif (a * b) <= 5e+33:
		tmp = c + ((x * y) + t_2)
	else:
		tmp = (c + t_2) - t_1
	return tmp
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))
	tmp = 0.0
	if (Float64(a * b) <= -1e+124)
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	elseif (Float64(a * b) <= 5e+33)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	else
		tmp = Float64(Float64(c + t_2) - t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	t_2 = 0.0625 * (z * t);
	tmp = 0.0;
	if ((a * b) <= -1e+124)
		tmp = (c + (x * y)) - t_1;
	elseif ((a * b) <= 5e+33)
		tmp = c + ((x * y) + t_2);
	else
		tmp = (c + t_2) - t_1;
	end
	tmp_2 = tmp;
end
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]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+124], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+33], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(c + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := 0.0625 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124}:\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\

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

\mathbf{else}:\\
\;\;\;\;\left(c + t\_2\right) - t\_1\\


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

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

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

    if -9.99999999999999948e123 < (*.f64 a b) < 4.99999999999999973e33

    1. Initial program 99.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 a around 0 94.4%

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

    if 4.99999999999999973e33 < (*.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 84.7%

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

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

Alternative 10: 89.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+77}\right):\\
\;\;\;\;\left(c + x \cdot y\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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.99999999999999948e123 or 1.99999999999999997e77 < (*.f64 a b)

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

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

    if -9.99999999999999948e123 < (*.f64 a b) < 1.99999999999999997e77

    1. Initial program 99.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 a around 0 93.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+77}\right):\\ \;\;\;\;\left(c + x \cdot y\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 11: 88.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 10^{+165}\right):\\
\;\;\;\;x \cdot y - \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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.99999999999999948e123 or 9.99999999999999899e164 < (*.f64 a b)

    1. Initial program 93.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 z around 0 87.0%

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

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

    if -9.99999999999999948e123 < (*.f64 a b) < 9.99999999999999899e164

    1. Initial program 99.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 a around 0 91.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+124} \lor \neg \left(a \cdot b \leq 10^{+165}\right):\\ \;\;\;\;x \cdot y - \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 12: 42.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+68} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.2500000000000002e68 or 2.49999999999999981e-25 < (*.f64 x y)

    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 z around 0 76.4%

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

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

    if -2.2500000000000002e68 < (*.f64 x y) < 2.49999999999999981e-25

    1. Initial program 97.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 c around inf 32.5%

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

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

Alternative 13: 22.5% accurate, 17.0× speedup?

\[\begin{array}{l} \\ c \end{array} \]
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
	return 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 = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
def code(x, y, z, t, a, b, c):
	return c
function code(x, y, z, t, a, b, c)
	return c
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = c;
end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}

\\
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 21.2%

    \[\leadsto \color{blue}{c} \]
  4. Add Preprocessing

Reproduce

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