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

Percentage Accurate: 97.9% → 98.7%
Time: 11.5s
Alternatives: 14
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 14 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.9% 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: 98.7% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)\\

\mathbf{else}:\\
\;\;\;\;c \cdot \left(x \cdot \frac{y}{c}\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 99.7%

      \[\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-99.7%

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - \color{blue}{a \cdot \frac{b}{4}}\right) + c \]
    3. Simplified100.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

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 47.0%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
    5. Taylor expanded in x around inf 46.5%

      \[\leadsto c \cdot \color{blue}{\frac{x \cdot y}{c}} \]
    6. Step-by-step derivation
      1. associate-*r/55.3%

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \frac{y}{c}\right)} \]
    7. Simplified55.3%

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

    \[\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(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(x \cdot \frac{y}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, \frac{t}{16}, \frac{a \cdot b}{-4}\right)\right) + c \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (fma x y (fma 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, fma(z, (t / 16.0), ((a * b) / -4.0))) + 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
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}

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

    \[\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+95.4%

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

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

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

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

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

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

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

    \[\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: 42.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-245}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{-194}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 6000:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* x y) -7.2e+93)
   (* x y)
   (if (<= (* x y) -2.35e-287)
     (* t (* z 0.0625))
     (if (<= (* x y) 1.55e-245)
       c
       (if (<= (* x y) 1.22e-194)
         (* b (* a -0.25))
         (if (<= (* x y) 6000.0) c (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -7.2e+93) {
		tmp = x * y;
	} else if ((x * y) <= -2.35e-287) {
		tmp = t * (z * 0.0625);
	} else if ((x * y) <= 1.55e-245) {
		tmp = c;
	} else if ((x * y) <= 1.22e-194) {
		tmp = b * (a * -0.25);
	} else if ((x * y) <= 6000.0) {
		tmp = c;
	} 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) :: tmp
    if ((x * y) <= (-7.2d+93)) then
        tmp = x * y
    else if ((x * y) <= (-2.35d-287)) then
        tmp = t * (z * 0.0625d0)
    else if ((x * y) <= 1.55d-245) then
        tmp = c
    else if ((x * y) <= 1.22d-194) then
        tmp = b * (a * (-0.25d0))
    else if ((x * y) <= 6000.0d0) then
        tmp = c
    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 tmp;
	if ((x * y) <= -7.2e+93) {
		tmp = x * y;
	} else if ((x * y) <= -2.35e-287) {
		tmp = t * (z * 0.0625);
	} else if ((x * y) <= 1.55e-245) {
		tmp = c;
	} else if ((x * y) <= 1.22e-194) {
		tmp = b * (a * -0.25);
	} else if ((x * y) <= 6000.0) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (x * y) <= -7.2e+93:
		tmp = x * y
	elif (x * y) <= -2.35e-287:
		tmp = t * (z * 0.0625)
	elif (x * y) <= 1.55e-245:
		tmp = c
	elif (x * y) <= 1.22e-194:
		tmp = b * (a * -0.25)
	elif (x * y) <= 6000.0:
		tmp = c
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(x * y) <= -7.2e+93)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -2.35e-287)
		tmp = Float64(t * Float64(z * 0.0625));
	elseif (Float64(x * y) <= 1.55e-245)
		tmp = c;
	elseif (Float64(x * y) <= 1.22e-194)
		tmp = Float64(b * Float64(a * -0.25));
	elseif (Float64(x * y) <= 6000.0)
		tmp = c;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((x * y) <= -7.2e+93)
		tmp = x * y;
	elseif ((x * y) <= -2.35e-287)
		tmp = t * (z * 0.0625);
	elseif ((x * y) <= 1.55e-245)
		tmp = c;
	elseif ((x * y) <= 1.22e-194)
		tmp = b * (a * -0.25);
	elseif ((x * y) <= 6000.0)
		tmp = c;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -7.2e+93], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.35e-287], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1.55e-245], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.22e-194], N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6000.0], c, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-287}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-245}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{-194}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;x \cdot y \leq 6000:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -7.1999999999999998e93 or 6e3 < (*.f64 x y)

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 63.5%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
    5. Taylor expanded in c around 0 62.4%

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

    if -7.1999999999999998e93 < (*.f64 x y) < -2.3499999999999999e-287

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(0.0625 \cdot z\right)} \]
    7. Simplified39.1%

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

    if -2.3499999999999999e-287 < (*.f64 x y) < 1.55000000000000001e-245 or 1.2200000000000001e-194 < (*.f64 x y) < 6e3

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

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

    if 1.55000000000000001e-245 < (*.f64 x y) < 1.2200000000000001e-194

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7.2 \cdot 10^{+93}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.35 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.55 \cdot 10^{-245}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.22 \cdot 10^{-194}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 6000:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.1% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;x \cdot y \leq 10:\\
\;\;\;\;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) < -9.9999999999999994e104

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

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

    if -9.9999999999999994e104 < (*.f64 x y) < 1.99999999999999992e-233 or 5.0000000000000001e-101 < (*.f64 x y) < 10

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

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

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

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

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

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

    if 1.99999999999999992e-233 < (*.f64 x y) < 5.0000000000000001e-101

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

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

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

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

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

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

    if 10 < (*.f64 x y)

    1. Initial program 94.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 79.8%

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

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

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

Alternative 5: 98.6% 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 \cdot \left(x \cdot \frac{y}{c}\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 (* x (/ y 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 * (x * (y / c));
	}
	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 * (x * (y / c));
	}
	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 * (x * (y / c))
	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(x * Float64(y / c)));
	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 * (x * (y / c));
	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[(x * N[(y / c), $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 \cdot \left(x \cdot \frac{y}{c}\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 99.7%

      \[\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 x around inf 47.0%

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 47.0%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
    5. Taylor expanded in x around inf 46.5%

      \[\leadsto c \cdot \color{blue}{\frac{x \cdot y}{c}} \]
    6. Step-by-step derivation
      1. associate-*r/55.3%

        \[\leadsto c \cdot \color{blue}{\left(x \cdot \frac{y}{c}\right)} \]
    7. Simplified55.3%

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

    \[\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 \cdot \left(x \cdot \frac{y}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.0% accurate, 0.5× speedup?

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

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

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

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

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

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


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

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

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

    if -9.9999999999999994e104 < (*.f64 x y) < 1.99999999999999992e-233 or 5.0000000000000001e-101 < (*.f64 x y) < 5e17

    1. Initial program 97.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 inf 72.0%

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

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

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

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

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

    if 1.99999999999999992e-233 < (*.f64 x y) < 5.0000000000000001e-101

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

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

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

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

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

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

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

Alternative 7: 62.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;c \leq -5.3 \cdot 10^{+111}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;c \leq 7 \cdot 10^{-227}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 6.9 \cdot 10^{-93}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{+79}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(1 + \frac{x \cdot y}{c}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* a b) 0.25))))
   (if (<= c -5.3e+111)
     (+ c (* t (* z 0.0625)))
     (if (<= c 7e-227)
       t_1
       (if (<= c 6.9e-93)
         (+ (* x y) (* 0.0625 (* z t)))
         (if (<= c 4.2e+79) t_1 (* c (+ 1.0 (/ (* x y) c)))))))))
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 tmp;
	if (c <= -5.3e+111) {
		tmp = c + (t * (z * 0.0625));
	} else if (c <= 7e-227) {
		tmp = t_1;
	} else if (c <= 6.9e-93) {
		tmp = (x * y) + (0.0625 * (z * t));
	} else if (c <= 4.2e+79) {
		tmp = t_1;
	} else {
		tmp = c * (1.0 + ((x * y) / 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) :: t_1
    real(8) :: tmp
    t_1 = (x * y) - ((a * b) * 0.25d0)
    if (c <= (-5.3d+111)) then
        tmp = c + (t * (z * 0.0625d0))
    else if (c <= 7d-227) then
        tmp = t_1
    else if (c <= 6.9d-93) then
        tmp = (x * y) + (0.0625d0 * (z * t))
    else if (c <= 4.2d+79) then
        tmp = t_1
    else
        tmp = c * (1.0d0 + ((x * y) / 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 t_1 = (x * y) - ((a * b) * 0.25);
	double tmp;
	if (c <= -5.3e+111) {
		tmp = c + (t * (z * 0.0625));
	} else if (c <= 7e-227) {
		tmp = t_1;
	} else if (c <= 6.9e-93) {
		tmp = (x * y) + (0.0625 * (z * t));
	} else if (c <= 4.2e+79) {
		tmp = t_1;
	} else {
		tmp = c * (1.0 + ((x * y) / c));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	tmp = 0
	if c <= -5.3e+111:
		tmp = c + (t * (z * 0.0625))
	elif c <= 7e-227:
		tmp = t_1
	elif c <= 6.9e-93:
		tmp = (x * y) + (0.0625 * (z * t))
	elif c <= 4.2e+79:
		tmp = t_1
	else:
		tmp = c * (1.0 + ((x * y) / c))
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))
	tmp = 0.0
	if (c <= -5.3e+111)
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	elseif (c <= 7e-227)
		tmp = t_1;
	elseif (c <= 6.9e-93)
		tmp = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)));
	elseif (c <= 4.2e+79)
		tmp = t_1;
	else
		tmp = Float64(c * Float64(1.0 + Float64(Float64(x * y) / c)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) - ((a * b) * 0.25);
	tmp = 0.0;
	if (c <= -5.3e+111)
		tmp = c + (t * (z * 0.0625));
	elseif (c <= 7e-227)
		tmp = t_1;
	elseif (c <= 6.9e-93)
		tmp = (x * y) + (0.0625 * (z * t));
	elseif (c <= 4.2e+79)
		tmp = t_1;
	else
		tmp = c * (1.0 + ((x * y) / c));
	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]}, If[LessEqual[c, -5.3e+111], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 7e-227], t$95$1, If[LessEqual[c, 6.9e-93], N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e+79], t$95$1, N[(c * N[(1.0 + N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;c \leq 4.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -5.2999999999999998e111

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

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

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

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

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

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

    if -5.2999999999999998e111 < c < 7.0000000000000002e-227 or 6.90000000000000031e-93 < c < 4.20000000000000016e79

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

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

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

    if 7.0000000000000002e-227 < c < 6.90000000000000031e-93

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

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

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

    if 4.20000000000000016e79 < c

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 73.6%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification75.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.3 \cdot 10^{+111}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;c \leq 7 \cdot 10^{-227}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;c \leq 6.9 \cdot 10^{-93}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{+79}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(1 + \frac{x \cdot y}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 50.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-276}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000007e184 or 1.4499999999999999e-40 < z

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

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

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} \]
    6. Step-by-step derivation
      1. *-commutative47.2%

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

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

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

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

    if -4.00000000000000007e184 < z < -3.5e-287 or 1.29999999999999992e-276 < z < 1.4499999999999999e-40

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

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

    if -3.5e-287 < z < 1.29999999999999992e-276

    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 100.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 71.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+184}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-287}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-276}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-40}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 88.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+139} \lor \neg \left(a \cdot b \leq 10^{+150}\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) -5e+139) (not (<= (* a b) 1e+150)))
   (- (+ 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) <= -5e+139) || !((a * b) <= 1e+150)) {
		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) <= (-5d+139)) .or. (.not. ((a * b) <= 1d+150))) 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) <= -5e+139) || !((a * b) <= 1e+150)) {
		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) <= -5e+139) or not ((a * b) <= 1e+150):
		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) <= -5e+139) || !(Float64(a * b) <= 1e+150))
		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) <= -5e+139) || ~(((a * b) <= 1e+150)))
		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], -5e+139], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+150]], $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 -5 \cdot 10^{+139} \lor \neg \left(a \cdot b \leq 10^{+150}\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) < -5.0000000000000003e139 or 9.99999999999999981e149 < (*.f64 a b)

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

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

    if -5.0000000000000003e139 < (*.f64 a b) < 9.99999999999999981e149

    1. Initial program 98.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 0 94.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+139} \lor \neg \left(a \cdot b \leq 10^{+150}\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 10: 86.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+139}:\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

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

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


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

    1. Initial program 89.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 inf 78.8%

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

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

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

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

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

    if -5.0000000000000003e139 < (*.f64 a b) < 9.99999999999999981e149

    1. Initial program 98.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 0 94.0%

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

    if 9.99999999999999981e149 < (*.f64 a b)

    1. Initial program 84.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 89.7%

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

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

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

Alternative 11: 42.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1.3 \cdot 10^{-287}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;x \cdot y \leq 4200000:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -3.00000000000000013e92 or 4.2e6 < (*.f64 x y)

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 63.5%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
    5. Taylor expanded in c around 0 62.4%

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

    if -3.00000000000000013e92 < (*.f64 x y) < -1.3e-287

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(0.0625 \cdot z\right)} \]
    7. Simplified39.1%

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

    if -1.3e-287 < (*.f64 x y) < 4.2e6

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -3 \cdot 10^{+92}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.3 \cdot 10^{-287}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 4200000:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 65.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+123} \lor \neg \left(x \cdot y \leq 400000000\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) < -4.99999999999999974e123 or 4e8 < (*.f64 x y)

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

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

    if -4.99999999999999974e123 < (*.f64 x y) < 4e8

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

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

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

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

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

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

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

Alternative 13: 41.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.15 \cdot 10^{+104} \lor \neg \left(x \cdot y \leq 4100000\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.14999999999999992e104 or 4.1e6 < (*.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 x around inf 70.7%

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in c around inf 63.2%

      \[\leadsto \color{blue}{c \cdot \left(1 + \frac{x \cdot y}{c}\right)} \]
    5. Taylor expanded in c around 0 62.9%

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

    if -1.14999999999999992e104 < (*.f64 x y) < 4.1e6

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

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

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

Alternative 14: 21.7% 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 95.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 c around inf 25.3%

    \[\leadsto \color{blue}{c} \]
  4. Final simplification25.3%

    \[\leadsto c \]
  5. Add Preprocessing

Reproduce

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