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

Percentage Accurate: 97.5% → 98.9%
Time: 12.8s
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.5% 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.9% 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 97.2%

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

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

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

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

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

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

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

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

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

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

\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{4}\right)
\end{array}
Derivation
  1. Initial program 97.2%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 65.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+172}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{+40}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+19} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+144}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\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 (<= (* a b) -1e+172)
     t_1
     (if (<= (* a b) -1e+40)
       (+ c (* x y))
       (if (or (<= (* a b) -2e+19) (not (<= (* a b) 4e+144)))
         t_1
         (+ c (* t (* z 0.0625))))))))
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 ((a * b) <= -1e+172) {
		tmp = t_1;
	} else if ((a * b) <= -1e+40) {
		tmp = c + (x * y);
	} else if (((a * b) <= -2e+19) || !((a * b) <= 4e+144)) {
		tmp = t_1;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	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 ((a * b) <= (-1d+172)) then
        tmp = t_1
    else if ((a * b) <= (-1d+40)) then
        tmp = c + (x * y)
    else if (((a * b) <= (-2d+19)) .or. (.not. ((a * b) <= 4d+144))) then
        tmp = t_1
    else
        tmp = c + (t * (z * 0.0625d0))
    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 ((a * b) <= -1e+172) {
		tmp = t_1;
	} else if ((a * b) <= -1e+40) {
		tmp = c + (x * y);
	} else if (((a * b) <= -2e+19) || !((a * b) <= 4e+144)) {
		tmp = t_1;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	tmp = 0
	if (a * b) <= -1e+172:
		tmp = t_1
	elif (a * b) <= -1e+40:
		tmp = c + (x * y)
	elif ((a * b) <= -2e+19) or not ((a * b) <= 4e+144):
		tmp = t_1
	else:
		tmp = c + (t * (z * 0.0625))
	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 (Float64(a * b) <= -1e+172)
		tmp = t_1;
	elseif (Float64(a * b) <= -1e+40)
		tmp = Float64(c + Float64(x * y));
	elseif ((Float64(a * b) <= -2e+19) || !(Float64(a * b) <= 4e+144))
		tmp = t_1;
	else
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	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 ((a * b) <= -1e+172)
		tmp = t_1;
	elseif ((a * b) <= -1e+40)
		tmp = c + (x * y);
	elseif (((a * b) <= -2e+19) || ~(((a * b) <= 4e+144)))
		tmp = t_1;
	else
		tmp = c + (t * (z * 0.0625));
	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[N[(a * b), $MachinePrecision], -1e+172], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1e+40], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -2e+19], N[Not[LessEqual[N[(a * b), $MachinePrecision], 4e+144]], $MachinePrecision]], t$95$1, N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{+40}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+19} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+144}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.0000000000000001e172 or -1.00000000000000003e40 < (*.f64 a b) < -2e19 or 4.00000000000000009e144 < (*.f64 a b)

    1. Initial program 93.5%

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

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

    if -1.0000000000000001e172 < (*.f64 a b) < -1.00000000000000003e40

    1. Initial program 100.0%

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

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

    if -2e19 < (*.f64 a b) < 4.00000000000000009e144

    1. Initial program 99.3%

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

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

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

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

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

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

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

Alternative 4: 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 + y \cdot \left(x + 0.0625 \cdot \frac{z \cdot t}{y}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0))))
   (if (<= t_1 INFINITY)
     (+ c t_1)
     (+ c (* y (+ x (* 0.0625 (/ (* z t) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = c + t_1;
	} else {
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)
	tmp = 0
	if t_1 <= math.inf:
		tmp = c + t_1
	else:
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))))
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = Float64(c + Float64(y * Float64(x + Float64(0.0625 * Float64(Float64(z * t) / y)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = ((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = c + t_1;
	else
		tmp = c + (y * (x + (0.0625 * ((z * t) / y))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(c + N[(y * N[(x + N[(0.0625 * N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

Alternative 5: 58.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;t \leq -3 \cdot 10^{-35}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-189}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-54}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+130}:\\ \;\;\;\;t\_3\\ \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) (/ c t))))
        (t_3 (+ c (* b (* a -0.25)))))
   (if (<= t -3e-35)
     t_2
     (if (<= t 5.8e-189)
       t_1
       (if (<= t 2.3e-54)
         t_3
         (if (<= t 8.2e-30) t_1 (if (<= t 5e+130) t_3 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) + (c / t));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (t <= -3e-35) {
		tmp = t_2;
	} else if (t <= 5.8e-189) {
		tmp = t_1;
	} else if (t <= 2.3e-54) {
		tmp = t_3;
	} else if (t <= 8.2e-30) {
		tmp = t_1;
	} else if (t <= 5e+130) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = t * ((z * 0.0625d0) + (c / t))
    t_3 = c + (b * (a * (-0.25d0)))
    if (t <= (-3d-35)) then
        tmp = t_2
    else if (t <= 5.8d-189) then
        tmp = t_1
    else if (t <= 2.3d-54) then
        tmp = t_3
    else if (t <= 8.2d-30) then
        tmp = t_1
    else if (t <= 5d+130) then
        tmp = t_3
    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) + (c / t));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (t <= -3e-35) {
		tmp = t_2;
	} else if (t <= 5.8e-189) {
		tmp = t_1;
	} else if (t <= 2.3e-54) {
		tmp = t_3;
	} else if (t <= 8.2e-30) {
		tmp = t_1;
	} else if (t <= 5e+130) {
		tmp = t_3;
	} 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) + (c / t))
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if t <= -3e-35:
		tmp = t_2
	elif t <= 5.8e-189:
		tmp = t_1
	elif t <= 2.3e-54:
		tmp = t_3
	elif t <= 8.2e-30:
		tmp = t_1
	elif t <= 5e+130:
		tmp = t_3
	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(Float64(z * 0.0625) + Float64(c / t)))
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (t <= -3e-35)
		tmp = t_2;
	elseif (t <= 5.8e-189)
		tmp = t_1;
	elseif (t <= 2.3e-54)
		tmp = t_3;
	elseif (t <= 8.2e-30)
		tmp = t_1;
	elseif (t <= 5e+130)
		tmp = t_3;
	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) + (c / t));
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (t <= -3e-35)
		tmp = t_2;
	elseif (t <= 5.8e-189)
		tmp = t_1;
	elseif (t <= 2.3e-54)
		tmp = t_3;
	elseif (t <= 8.2e-30)
		tmp = t_1;
	elseif (t <= 5e+130)
		tmp = t_3;
	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[(N[(z * 0.0625), $MachinePrecision] + N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e-35], t$95$2, If[LessEqual[t, 5.8e-189], t$95$1, If[LessEqual[t, 2.3e-54], t$95$3, If[LessEqual[t, 8.2e-30], t$95$1, If[LessEqual[t, 5e+130], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 5.8 \cdot 10^{-189}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-54}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq 8.2 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 5 \cdot 10^{+130}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.99999999999999989e-35 or 4.9999999999999996e130 < t

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

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

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

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

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

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

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

    if -2.99999999999999989e-35 < t < 5.8e-189 or 2.2999999999999999e-54 < t < 8.2000000000000007e-30

    1. Initial program 100.0%

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

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

    if 5.8e-189 < t < 2.2999999999999999e-54 or 8.2000000000000007e-30 < t < 4.9999999999999996e130

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-35}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{-189}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-54}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-30}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 5 \cdot 10^{+130}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625 + \frac{c}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := c + t \cdot \left(z \cdot 0.0625\right)\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;t \leq -2 \cdot 10^{-34}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-54}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+130}:\\ \;\;\;\;t\_3\\ \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 (+ c (* t (* z 0.0625))))
        (t_3 (+ c (* b (* a -0.25)))))
   (if (<= t -2e-34)
     t_2
     (if (<= t 2.1e-188)
       t_1
       (if (<= t 2.8e-54)
         t_3
         (if (<= t 2.3e-30) t_1 (if (<= t 6.2e+130) t_3 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 = c + (t * (z * 0.0625));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (t <= -2e-34) {
		tmp = t_2;
	} else if (t <= 2.1e-188) {
		tmp = t_1;
	} else if (t <= 2.8e-54) {
		tmp = t_3;
	} else if (t <= 2.3e-30) {
		tmp = t_1;
	} else if (t <= 6.2e+130) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = c + (t * (z * 0.0625d0))
    t_3 = c + (b * (a * (-0.25d0)))
    if (t <= (-2d-34)) then
        tmp = t_2
    else if (t <= 2.1d-188) then
        tmp = t_1
    else if (t <= 2.8d-54) then
        tmp = t_3
    else if (t <= 2.3d-30) then
        tmp = t_1
    else if (t <= 6.2d+130) then
        tmp = t_3
    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 = c + (t * (z * 0.0625));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (t <= -2e-34) {
		tmp = t_2;
	} else if (t <= 2.1e-188) {
		tmp = t_1;
	} else if (t <= 2.8e-54) {
		tmp = t_3;
	} else if (t <= 2.3e-30) {
		tmp = t_1;
	} else if (t <= 6.2e+130) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = c + (t * (z * 0.0625))
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if t <= -2e-34:
		tmp = t_2
	elif t <= 2.1e-188:
		tmp = t_1
	elif t <= 2.8e-54:
		tmp = t_3
	elif t <= 2.3e-30:
		tmp = t_1
	elif t <= 6.2e+130:
		tmp = t_3
	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(c + Float64(t * Float64(z * 0.0625)))
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (t <= -2e-34)
		tmp = t_2;
	elseif (t <= 2.1e-188)
		tmp = t_1;
	elseif (t <= 2.8e-54)
		tmp = t_3;
	elseif (t <= 2.3e-30)
		tmp = t_1;
	elseif (t <= 6.2e+130)
		tmp = t_3;
	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 = c + (t * (z * 0.0625));
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (t <= -2e-34)
		tmp = t_2;
	elseif (t <= 2.1e-188)
		tmp = t_1;
	elseif (t <= 2.8e-54)
		tmp = t_3;
	elseif (t <= 2.3e-30)
		tmp = t_1;
	elseif (t <= 6.2e+130)
		tmp = t_3;
	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[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e-34], t$95$2, If[LessEqual[t, 2.1e-188], t$95$1, If[LessEqual[t, 2.8e-54], t$95$3, If[LessEqual[t, 2.3e-30], t$95$1, If[LessEqual[t, 6.2e+130], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-188}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.8 \cdot 10^{-54}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq 2.3 \cdot 10^{-30}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+130}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.99999999999999986e-34 or 6.1999999999999999e130 < t

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

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

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

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

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

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

    if -1.99999999999999986e-34 < t < 2.0999999999999999e-188 or 2.8000000000000002e-54 < t < 2.29999999999999984e-30

    1. Initial program 100.0%

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

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

    if 2.0999999999999999e-188 < t < 2.8000000000000002e-54 or 2.29999999999999984e-30 < t < 6.1999999999999999e130

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{-34}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-188}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{-54}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-30}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+130}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 88.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+178} \lor \neg \left(x \cdot y \leq 100000000000\right):\\ \;\;\;\;\left(c + x \cdot y\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(c + 0.0625 \cdot \left(z \cdot t\right)\right) - t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)))
   (if (or (<= (* x y) -1e+178) (not (<= (* x y) 100000000000.0)))
     (- (+ c (* x y)) t_1)
     (- (+ c (* 0.0625 (* z t))) 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 tmp;
	if (((x * y) <= -1e+178) || !((x * y) <= 100000000000.0)) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = (c + (0.0625 * (z * t))) - 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 = (a * b) * 0.25d0
    if (((x * y) <= (-1d+178)) .or. (.not. ((x * y) <= 100000000000.0d0))) then
        tmp = (c + (x * y)) - t_1
    else
        tmp = (c + (0.0625d0 * (z * t))) - 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 tmp;
	if (((x * y) <= -1e+178) || !((x * y) <= 100000000000.0)) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = (c + (0.0625 * (z * t))) - t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	tmp = 0
	if ((x * y) <= -1e+178) or not ((x * y) <= 100000000000.0):
		tmp = (c + (x * y)) - t_1
	else:
		tmp = (c + (0.0625 * (z * t))) - t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	tmp = 0.0
	if ((Float64(x * y) <= -1e+178) || !(Float64(x * y) <= 100000000000.0))
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	else
		tmp = Float64(Float64(c + Float64(0.0625 * Float64(z * t))) - t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	tmp = 0.0;
	if (((x * y) <= -1e+178) || ~(((x * y) <= 100000000000.0)))
		tmp = (c + (x * y)) - t_1;
	else
		tmp = (c + (0.0625 * (z * t))) - 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]}, If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+178], N[Not[LessEqual[N[(x * y), $MachinePrecision], 100000000000.0]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+178} \lor \neg \left(x \cdot y \leq 100000000000\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.0000000000000001e178 or 1e11 < (*.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 z around 0 89.1%

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

    if -1.0000000000000001e178 < (*.f64 x y) < 1e11

    1. Initial program 100.0%

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

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

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

Alternative 8: 87.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+172} \lor \neg \left(a \cdot b \leq 4 \cdot 10^{+144}\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) < -1.0000000000000001e172 or 4.00000000000000009e144 < (*.f64 a b)

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

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

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

    if -1.0000000000000001e172 < (*.f64 a b) < 4.00000000000000009e144

    1. Initial program 99.4%

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

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

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

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

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

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

    if -2e30 < (*.f64 a b) < 5.00000000000000025e116

    1. Initial program 99.3%

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

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.1 \cdot 10^{-77} \lor \neg \left(b \leq 1.65 \cdot 10^{+95}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -6.1000000000000002e-77 or 1.6499999999999999e95 < b

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

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

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

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

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

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

    if -6.1000000000000002e-77 < b < 1.6499999999999999e95

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

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

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

Alternative 11: 36.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{-14} \lor \neg \left(t \leq 4.5 \cdot 10^{+57}\right):\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.14999999999999999e-14 or 4.49999999999999996e57 < t

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.14999999999999999e-14 < t < 4.49999999999999996e57

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{-14} \lor \neg \left(t \leq 4.5 \cdot 10^{+57}\right):\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 54.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+56} \lor \neg \left(t \leq 6.8 \cdot 10^{+122}\right):\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.50000000000000003e56 or 6.8e122 < t

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000003e56 < t < 6.8e122

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+56} \lor \neg \left(t \leq 6.8 \cdot 10^{+122}\right):\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 21.8% 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.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 c around inf 21.4%

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

    \[\leadsto c \]
  5. Add Preprocessing

Reproduce

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