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

Percentage Accurate: 97.7% → 99.3%
Time: 10.6s
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.3% 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:\\ \;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\right) + c\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\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)
   (+ (fma x y (fma z (* t 0.0625) (* b (* a -0.25)))) c)
   (* x (- y (* -0.0625 (* t (/ z x)))))))
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 = fma(x, y, fma(z, (t * 0.0625), (b * (a * -0.25)))) + c;
	} else {
		tmp = x * (y - (-0.0625 * (t * (z / x))));
	}
	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(fma(x, y, fma(z, Float64(t * 0.0625), Float64(b * Float64(a * -0.25)))) + c);
	else
		tmp = Float64(x * Float64(y - Float64(-0.0625 * Float64(t * Float64(z / x)))));
	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[(N[(x * y + N[(z * N[(t * 0.0625), $MachinePrecision] + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision], N[(x * N[(y - N[(-0.0625 * N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $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:\\
\;\;\;\;\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\right) + c\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\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. Step-by-step derivation
      1. associate--l+100.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t \cdot 0.0625, b \cdot \left(a \cdot -0.25\right)\right)\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 a around 0 83.3%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)} \]
      2. mul-1-neg100.0%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right) \]
      3. neg-mul-1100.0%

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} + \left(-y\right)\right)} \]
      5. unsub-neg100.0%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} - y\right)} \]
      6. associate-/l*100.0%

        \[\leadsto \left(-x\right) \cdot \left(-0.0625 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} - y\right) \]
    7. Simplified100.0%

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

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

Alternative 2: 63.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + t\_1\\ t_3 := c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+204}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+184}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+146}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-144}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-287}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-147}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+157}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* z t))) (t_2 (+ c t_1)) (t_3 (+ c (* a (* b -0.25)))))
   (if (<= (* x y) -8.5e+204)
     (* x y)
     (if (<= (* x y) -1.46e+184)
       t_1
       (if (<= (* x y) -2.2e+146)
         (* x y)
         (if (<= (* x y) -1.25e-144)
           t_2
           (if (<= (* x y) -3.8e-287)
             t_3
             (if (<= (* x y) 2e-147)
               t_2
               (if (<= (* x y) 6e+157) t_3 (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (z * t);
	double t_2 = c + t_1;
	double t_3 = c + (a * (b * -0.25));
	double tmp;
	if ((x * y) <= -8.5e+204) {
		tmp = x * y;
	} else if ((x * y) <= -1.46e+184) {
		tmp = t_1;
	} else if ((x * y) <= -2.2e+146) {
		tmp = x * y;
	} else if ((x * y) <= -1.25e-144) {
		tmp = t_2;
	} else if ((x * y) <= -3.8e-287) {
		tmp = t_3;
	} else if ((x * y) <= 2e-147) {
		tmp = t_2;
	} else if ((x * y) <= 6e+157) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = 0.0625d0 * (z * t)
    t_2 = c + t_1
    t_3 = c + (a * (b * (-0.25d0)))
    if ((x * y) <= (-8.5d+204)) then
        tmp = x * y
    else if ((x * y) <= (-1.46d+184)) then
        tmp = t_1
    else if ((x * y) <= (-2.2d+146)) then
        tmp = x * y
    else if ((x * y) <= (-1.25d-144)) then
        tmp = t_2
    else if ((x * y) <= (-3.8d-287)) then
        tmp = t_3
    else if ((x * y) <= 2d-147) then
        tmp = t_2
    else if ((x * y) <= 6d+157) then
        tmp = t_3
    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 = 0.0625 * (z * t);
	double t_2 = c + t_1;
	double t_3 = c + (a * (b * -0.25));
	double tmp;
	if ((x * y) <= -8.5e+204) {
		tmp = x * y;
	} else if ((x * y) <= -1.46e+184) {
		tmp = t_1;
	} else if ((x * y) <= -2.2e+146) {
		tmp = x * y;
	} else if ((x * y) <= -1.25e-144) {
		tmp = t_2;
	} else if ((x * y) <= -3.8e-287) {
		tmp = t_3;
	} else if ((x * y) <= 2e-147) {
		tmp = t_2;
	} else if ((x * y) <= 6e+157) {
		tmp = t_3;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (z * t)
	t_2 = c + t_1
	t_3 = c + (a * (b * -0.25))
	tmp = 0
	if (x * y) <= -8.5e+204:
		tmp = x * y
	elif (x * y) <= -1.46e+184:
		tmp = t_1
	elif (x * y) <= -2.2e+146:
		tmp = x * y
	elif (x * y) <= -1.25e-144:
		tmp = t_2
	elif (x * y) <= -3.8e-287:
		tmp = t_3
	elif (x * y) <= 2e-147:
		tmp = t_2
	elif (x * y) <= 6e+157:
		tmp = t_3
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(z * t))
	t_2 = Float64(c + t_1)
	t_3 = Float64(c + Float64(a * Float64(b * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -8.5e+204)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.46e+184)
		tmp = t_1;
	elseif (Float64(x * y) <= -2.2e+146)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.25e-144)
		tmp = t_2;
	elseif (Float64(x * y) <= -3.8e-287)
		tmp = t_3;
	elseif (Float64(x * y) <= 2e-147)
		tmp = t_2;
	elseif (Float64(x * y) <= 6e+157)
		tmp = t_3;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (z * t);
	t_2 = c + t_1;
	t_3 = c + (a * (b * -0.25));
	tmp = 0.0;
	if ((x * y) <= -8.5e+204)
		tmp = x * y;
	elseif ((x * y) <= -1.46e+184)
		tmp = t_1;
	elseif ((x * y) <= -2.2e+146)
		tmp = x * y;
	elseif ((x * y) <= -1.25e-144)
		tmp = t_2;
	elseif ((x * y) <= -3.8e-287)
		tmp = t_3;
	elseif ((x * y) <= 2e-147)
		tmp = t_2;
	elseif ((x * y) <= 6e+157)
		tmp = t_3;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e+204], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.46e+184], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.2e+146], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.25e-144], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.8e-287], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 2e-147], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 6e+157], t$95$3, N[(x * y), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+146}:\\
\;\;\;\;x \cdot y\\

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

\mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-287}:\\
\;\;\;\;t\_3\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -8.5e204 or -1.46e184 < (*.f64 x y) < -2.1999999999999998e146 or 6.00000000000000021e157 < (*.f64 x y)

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

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

    if -8.5e204 < (*.f64 x y) < -1.46e184

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

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

    if -2.1999999999999998e146 < (*.f64 x y) < -1.2499999999999999e-144 or -3.79999999999999982e-287 < (*.f64 x y) < 1.9999999999999999e-147

    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 z around inf 68.2%

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

    if -1.2499999999999999e-144 < (*.f64 x y) < -3.79999999999999982e-287 or 1.9999999999999999e-147 < (*.f64 x y) < 6.00000000000000021e157

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

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

        \[\leadsto \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right) + c \]
      2. distribute-lft-neg-in68.9%

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

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

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

        \[\leadsto \left(-a \cdot \color{blue}{\left(0.25 \cdot b\right)}\right) + c \]
      6. distribute-rgt-neg-in68.9%

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

        \[\leadsto a \cdot \left(-\color{blue}{b \cdot 0.25}\right) + c \]
      8. distribute-rgt-neg-in68.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+204}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.46 \cdot 10^{+184}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -2.2 \cdot 10^{+146}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.25 \cdot 10^{-144}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-287}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-147}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+157}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-144}:\\
\;\;\;\;t\_3\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.00000000000000002e144 or 4.99999999999999992e156 < (*.f64 x y)

    1. Initial program 95.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 91.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 91.7%

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

    if -1.00000000000000002e144 < (*.f64 x y) < -9.9999999999999995e-145 or -5.00000000000000025e-287 < (*.f64 x y) < 2.00000000000000013e-158

    1. Initial program 98.0%

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

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

    if -9.9999999999999995e-145 < (*.f64 x y) < -5.00000000000000025e-287 or 2.00000000000000013e-158 < (*.f64 x y) < 4.99999999999999992e156

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

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

        \[\leadsto \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right) + c \]
      2. distribute-lft-neg-in68.9%

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

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

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

        \[\leadsto \left(-a \cdot \color{blue}{\left(0.25 \cdot b\right)}\right) + c \]
      6. distribute-rgt-neg-in68.9%

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

        \[\leadsto a \cdot \left(-\color{blue}{b \cdot 0.25}\right) + c \]
      8. distribute-rgt-neg-in68.9%

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

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

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

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

Alternative 4: 44.1% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -2.95 \cdot 10^{+54}:\\
\;\;\;\;x \cdot y\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -8.5e204 or -1.4499999999999999e184 < (*.f64 x y) < -2.9499999999999999e54 or 8.39999999999999962e130 < (*.f64 x y)

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

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

    if -8.5e204 < (*.f64 x y) < -1.4499999999999999e184 or -2.9499999999999999e54 < (*.f64 x y) < -3.59999999999999978e-146

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

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

    if -3.59999999999999978e-146 < (*.f64 x y) < 8.39999999999999962e130

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8.5 \cdot 10^{+204}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{+184}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -2.95 \cdot 10^{+54}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.6 \cdot 10^{-146}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 8.4 \cdot 10^{+130}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.2% 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:\\ \;\;\;\;t\_1 + c\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y - -0.0625 \cdot \left(t \cdot \frac{z}{x}\right)\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) (+ t_1 c) (* x (- y (* -0.0625 (* t (/ z x))))))))
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 = t_1 + c;
	} else {
		tmp = x * (y - (-0.0625 * (t * (z / x))));
	}
	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 = t_1 + c;
	} else {
		tmp = x * (y - (-0.0625 * (t * (z / x))));
	}
	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 = t_1 + c
	else:
		tmp = x * (y - (-0.0625 * (t * (z / x))))
	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(t_1 + c);
	else
		tmp = Float64(x * Float64(y - Float64(-0.0625 * Float64(t * Float64(z / x)))));
	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 = t_1 + c;
	else
		tmp = x * (y - (-0.0625 * (t * (z / x))));
	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[(t$95$1 + c), $MachinePrecision], N[(x * N[(y - N[(-0.0625 * N[(t * N[(z / x), $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:\\
\;\;\;\;t\_1 + c\\

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*100.0%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)} \]
      2. mul-1-neg100.0%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right) \]
      3. neg-mul-1100.0%

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

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} + \left(-y\right)\right)} \]
      5. unsub-neg100.0%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} - y\right)} \]
      6. associate-/l*100.0%

        \[\leadsto \left(-x\right) \cdot \left(-0.0625 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} - y\right) \]
    7. Simplified100.0%

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

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

Alternative 6: 63.6% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+146} \lor \neg \left(x \cdot y \leq 4.8 \cdot 10^{+158}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.4000000000000003e204 or -4.8000000000000003e183 < (*.f64 x y) < -3.30000000000000016e146 or 4.80000000000000016e158 < (*.f64 x y)

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

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

    if -9.4000000000000003e204 < (*.f64 x y) < -4.8000000000000003e183

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

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

    if -3.30000000000000016e146 < (*.f64 x y) < 4.80000000000000016e158

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.4 \cdot 10^{+204}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -4.8 \cdot 10^{+183}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+146} \lor \neg \left(x \cdot y \leq 4.8 \cdot 10^{+158}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 88.7% accurate, 0.6× speedup?

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

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

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

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


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

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

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

    if -2.0000000000000001e71 < (*.f64 x y) < 4.99999999999999992e156

    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 0 94.8%

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

    if 4.99999999999999992e156 < (*.f64 x y)

    1. Initial program 93.0%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 88.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 88.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. associate-*r*91.1%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right)} \]
      2. mul-1-neg91.1%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(-1 \cdot y + -0.0625 \cdot \frac{t \cdot z}{x}\right) \]
      3. neg-mul-191.1%

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\left(-y\right)} + -0.0625 \cdot \frac{t \cdot z}{x}\right) \]
      4. +-commutative91.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} + \left(-y\right)\right)} \]
      5. unsub-neg91.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(-0.0625 \cdot \frac{t \cdot z}{x} - y\right)} \]
      6. associate-/l*91.1%

        \[\leadsto \left(-x\right) \cdot \left(-0.0625 \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)} - y\right) \]
    7. Simplified91.1%

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

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

Alternative 8: 87.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+132} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+147}\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) -5e+132) (not (<= (* a b) 2e+147)))
   (- (* 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+132) || !((a * b) <= 2e+147)) {
		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) <= (-5d+132)) .or. (.not. ((a * b) <= 2d+147))) 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) <= -5e+132) || !((a * b) <= 2e+147)) {
		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) <= -5e+132) or not ((a * b) <= 2e+147):
		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) <= -5e+132) || !(Float64(a * b) <= 2e+147))
		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) <= -5e+132) || ~(((a * b) <= 2e+147)))
		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], -5e+132], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2e+147]], $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 -5 \cdot 10^{+132} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+147}\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) < -5.0000000000000001e132 or 2e147 < (*.f64 a b)

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

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

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

    if -5.0000000000000001e132 < (*.f64 a b) < 2e147

    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 0 94.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.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+132} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+147}\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 9: 88.5% accurate, 0.7× 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 -5 \cdot 10^{+76}:\\ \;\;\;\;\left(x \cdot y + c\right) - t\_1\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+148}:\\ \;\;\;\;c + \left(x \cdot y + t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 - 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) -5e+76)
     (- (+ (* x y) c) t_1)
     (if (<= (* a b) 5e+148) (+ c (+ (* x y) t_2)) (- 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) <= -5e+76) {
		tmp = ((x * y) + c) - t_1;
	} else if ((a * b) <= 5e+148) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = 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) <= (-5d+76)) then
        tmp = ((x * y) + c) - t_1
    else if ((a * b) <= 5d+148) then
        tmp = c + ((x * y) + t_2)
    else
        tmp = 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) <= -5e+76) {
		tmp = ((x * y) + c) - t_1;
	} else if ((a * b) <= 5e+148) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = 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) <= -5e+76:
		tmp = ((x * y) + c) - t_1
	elif (a * b) <= 5e+148:
		tmp = c + ((x * y) + t_2)
	else:
		tmp = 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) <= -5e+76)
		tmp = Float64(Float64(Float64(x * y) + c) - t_1);
	elseif (Float64(a * b) <= 5e+148)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	else
		tmp = Float64(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) <= -5e+76)
		tmp = ((x * y) + c) - t_1;
	elseif ((a * b) <= 5e+148)
		tmp = c + ((x * y) + t_2);
	else
		tmp = 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], -5e+76], N[(N[(N[(x * y), $MachinePrecision] + c), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+148], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - 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 -5 \cdot 10^{+76}:\\
\;\;\;\;\left(x \cdot y + c\right) - t\_1\\

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

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


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

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

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

    if -4.99999999999999991e76 < (*.f64 a b) < 5.00000000000000024e148

    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 0 95.1%

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

    if 5.00000000000000024e148 < (*.f64 a b)

    1. Initial program 94.2%

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

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

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

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

Alternative 10: 87.4% accurate, 0.7× 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 -5 \cdot 10^{+132}:\\ \;\;\;\;x \cdot y - t\_1\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+148}:\\ \;\;\;\;c + \left(x \cdot y + t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2 - 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) -5e+132)
     (- (* x y) t_1)
     (if (<= (* a b) 5e+148) (+ c (+ (* x y) t_2)) (- 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) <= -5e+132) {
		tmp = (x * y) - t_1;
	} else if ((a * b) <= 5e+148) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = 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) <= (-5d+132)) then
        tmp = (x * y) - t_1
    else if ((a * b) <= 5d+148) then
        tmp = c + ((x * y) + t_2)
    else
        tmp = 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) <= -5e+132) {
		tmp = (x * y) - t_1;
	} else if ((a * b) <= 5e+148) {
		tmp = c + ((x * y) + t_2);
	} else {
		tmp = 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) <= -5e+132:
		tmp = (x * y) - t_1
	elif (a * b) <= 5e+148:
		tmp = c + ((x * y) + t_2)
	else:
		tmp = 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) <= -5e+132)
		tmp = Float64(Float64(x * y) - t_1);
	elseif (Float64(a * b) <= 5e+148)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	else
		tmp = Float64(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) <= -5e+132)
		tmp = (x * y) - t_1;
	elseif ((a * b) <= 5e+148)
		tmp = c + ((x * y) + t_2);
	else
		tmp = 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], -5e+132], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+148], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - 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 -5 \cdot 10^{+132}:\\
\;\;\;\;x \cdot y - t\_1\\

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

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


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

    1. Initial program 91.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 78.1%

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

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

    if -5.0000000000000001e132 < (*.f64 a b) < 5.00000000000000024e148

    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 0 94.1%

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

    if 5.00000000000000024e148 < (*.f64 a b)

    1. Initial program 94.2%

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

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

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

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

Alternative 11: 43.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 4.5 \cdot 10^{+129}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.10000000000000008e70 or 4.5000000000000001e129 < (*.f64 x y)

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

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

    if -2.10000000000000008e70 < (*.f64 x y) < 4.5000000000000001e129

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

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

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

Alternative 12: 41.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.02 \cdot 10^{+145} \lor \neg \left(x \cdot y \leq 5.2 \cdot 10^{+84}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.01999999999999996e145 or 5.2000000000000002e84 < (*.f64 x y)

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

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

    if -2.01999999999999996e145 < (*.f64 x y) < 5.2000000000000002e84

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

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

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

Alternative 13: 22.9% 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 20.7%

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

Reproduce

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