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

Percentage Accurate: 97.7% → 98.9%
Time: 14.8s
Alternatives: 16
Speedup: 1.0×

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 16 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: 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.7%

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

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

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

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

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

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

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

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

Alternative 2: 98.1% 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.7%

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

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

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

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

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

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

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

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

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+80}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-266}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-214}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 0.01:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* 0.0625 (* z t)))) (t_2 (+ c (* a (* b -0.25)))))
   (if (<= (* a b) -2e+80)
     t_2
     (if (<= (* a b) -5e-266)
       t_1
       (if (<= (* a b) 2e-214)
         (+ c (* x y))
         (if (<= (* a b) 0.01) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (0.0625 * (z * t));
	double t_2 = c + (a * (b * -0.25));
	double tmp;
	if ((a * b) <= -2e+80) {
		tmp = t_2;
	} else if ((a * b) <= -5e-266) {
		tmp = t_1;
	} else if ((a * b) <= 2e-214) {
		tmp = c + (x * y);
	} else if ((a * b) <= 0.01) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = c + (0.0625d0 * (z * t))
    t_2 = c + (a * (b * (-0.25d0)))
    if ((a * b) <= (-2d+80)) then
        tmp = t_2
    else if ((a * b) <= (-5d-266)) then
        tmp = t_1
    else if ((a * b) <= 2d-214) then
        tmp = c + (x * y)
    else if ((a * b) <= 0.01d0) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (0.0625 * (z * t));
	double t_2 = c + (a * (b * -0.25));
	double tmp;
	if ((a * b) <= -2e+80) {
		tmp = t_2;
	} else if ((a * b) <= -5e-266) {
		tmp = t_1;
	} else if ((a * b) <= 2e-214) {
		tmp = c + (x * y);
	} else if ((a * b) <= 0.01) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (0.0625 * (z * t))
	t_2 = c + (a * (b * -0.25))
	tmp = 0
	if (a * b) <= -2e+80:
		tmp = t_2
	elif (a * b) <= -5e-266:
		tmp = t_1
	elif (a * b) <= 2e-214:
		tmp = c + (x * y)
	elif (a * b) <= 0.01:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(0.0625 * Float64(z * t)))
	t_2 = Float64(c + Float64(a * Float64(b * -0.25)))
	tmp = 0.0
	if (Float64(a * b) <= -2e+80)
		tmp = t_2;
	elseif (Float64(a * b) <= -5e-266)
		tmp = t_1;
	elseif (Float64(a * b) <= 2e-214)
		tmp = Float64(c + Float64(x * y));
	elseif (Float64(a * b) <= 0.01)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (0.0625 * (z * t));
	t_2 = c + (a * (b * -0.25));
	tmp = 0.0;
	if ((a * b) <= -2e+80)
		tmp = t_2;
	elseif ((a * b) <= -5e-266)
		tmp = t_1;
	elseif ((a * b) <= 2e-214)
		tmp = c + (x * y);
	elseif ((a * b) <= 0.01)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+80], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -5e-266], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2e-214], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 0.01], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 0.01:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 94.8%

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

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

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{z \cdot \frac{t}{16}} - \frac{a \cdot b}{4}\right) + c \]
      4. fma-neg97.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-frac297.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-eval97.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. Simplified97.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. Taylor expanded in a around inf 77.0%

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

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

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

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

    if -2e80 < (*.f64 a b) < -4.99999999999999992e-266 or 1.99999999999999983e-214 < (*.f64 a b) < 0.0100000000000000002

    1. Initial program 98.9%

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

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

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

    if -4.99999999999999992e-266 < (*.f64 a b) < 1.99999999999999983e-214

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative72.3%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified72.3%

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

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

Alternative 4: 44.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+68}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-274}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-95}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{+100}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))))
   (if (<= (* x y) -9e+68)
     (* x y)
     (if (<= (* x y) -3.8e-274)
       t_1
       (if (<= (* x y) 8.5e-95) c (if (<= (* x y) 1.3e+100) t_1 (* x y)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double tmp;
	if ((x * y) <= -9e+68) {
		tmp = x * y;
	} else if ((x * y) <= -3.8e-274) {
		tmp = t_1;
	} else if ((x * y) <= 8.5e-95) {
		tmp = c;
	} else if ((x * y) <= 1.3e+100) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = b * (a * (-0.25d0))
    if ((x * y) <= (-9d+68)) then
        tmp = x * y
    else if ((x * y) <= (-3.8d-274)) then
        tmp = t_1
    else if ((x * y) <= 8.5d-95) then
        tmp = c
    else if ((x * y) <= 1.3d+100) then
        tmp = t_1
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double tmp;
	if ((x * y) <= -9e+68) {
		tmp = x * y;
	} else if ((x * y) <= -3.8e-274) {
		tmp = t_1;
	} else if ((x * y) <= 8.5e-95) {
		tmp = c;
	} else if ((x * y) <= 1.3e+100) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	tmp = 0
	if (x * y) <= -9e+68:
		tmp = x * y
	elif (x * y) <= -3.8e-274:
		tmp = t_1
	elif (x * y) <= 8.5e-95:
		tmp = c
	elif (x * y) <= 1.3e+100:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	tmp = 0.0
	if (Float64(x * y) <= -9e+68)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -3.8e-274)
		tmp = t_1;
	elseif (Float64(x * y) <= 8.5e-95)
		tmp = c;
	elseif (Float64(x * y) <= 1.3e+100)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = b * (a * -0.25);
	tmp = 0.0;
	if ((x * y) <= -9e+68)
		tmp = x * y;
	elseif ((x * y) <= -3.8e-274)
		tmp = t_1;
	elseif ((x * y) <= 8.5e-95)
		tmp = c;
	elseif ((x * y) <= 1.3e+100)
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -9e+68], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.8e-274], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 8.5e-95], c, If[LessEqual[N[(x * y), $MachinePrecision], 1.3e+100], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-95}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.0000000000000007e68 or 1.3000000000000001e100 < (*.f64 x y)

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative72.5%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified72.5%

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

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

    if -9.0000000000000007e68 < (*.f64 x y) < -3.79999999999999985e-274 or 8.4999999999999995e-95 < (*.f64 x y) < 1.3000000000000001e100

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

      \[\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 t around 0 54.6%

      \[\leadsto \color{blue}{c - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Taylor expanded in c around 0 37.8%

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

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

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

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

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

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

    if -3.79999999999999985e-274 < (*.f64 x y) < 8.4999999999999995e-95

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9 \cdot 10^{+68}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.8 \cdot 10^{-274}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 8.5 \cdot 10^{-95}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.3 \cdot 10^{+100}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 88.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+18} \lor \neg \left(a \cdot b \leq 10^{+22}\right):\\ \;\;\;\;c + \left(z \cdot \left(t \cdot 0.0625\right) - \left(a \cdot b\right) \cdot 0.25\right)\\ \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) -4e+18) (not (<= (* a b) 1e+22)))
   (+ c (- (* z (* t 0.0625)) (* (* 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) <= -4e+18) || !((a * b) <= 1e+22)) {
		tmp = c + ((z * (t * 0.0625)) - ((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) <= (-4d+18)) .or. (.not. ((a * b) <= 1d+22))) then
        tmp = c + ((z * (t * 0.0625d0)) - ((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) <= -4e+18) || !((a * b) <= 1e+22)) {
		tmp = c + ((z * (t * 0.0625)) - ((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) <= -4e+18) or not ((a * b) <= 1e+22):
		tmp = c + ((z * (t * 0.0625)) - ((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) <= -4e+18) || !(Float64(a * b) <= 1e+22))
		tmp = Float64(c + Float64(Float64(z * Float64(t * 0.0625)) - 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) <= -4e+18) || ~(((a * b) <= 1e+22)))
		tmp = c + ((z * (t * 0.0625)) - ((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], -4e+18], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e+22]], $MachinePrecision]], N[(c + N[(N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $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 -4 \cdot 10^{+18} \lor \neg \left(a \cdot b \leq 10^{+22}\right):\\
\;\;\;\;c + \left(z \cdot \left(t \cdot 0.0625\right) - \left(a \cdot b\right) \cdot 0.25\right)\\

\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) < -4e18 or 1e22 < (*.f64 a b)

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. associate--l+86.1%

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

        \[\leadsto c + \left(\color{blue}{\left(0.0625 \cdot t\right) \cdot z} - 0.25 \cdot \left(a \cdot b\right)\right) \]
      3. *-commutative87.8%

        \[\leadsto c + \left(\color{blue}{\left(t \cdot 0.0625\right)} \cdot z - 0.25 \cdot \left(a \cdot b\right)\right) \]
      4. *-commutative87.8%

        \[\leadsto c + \left(\color{blue}{z \cdot \left(t \cdot 0.0625\right)} - 0.25 \cdot \left(a \cdot b\right)\right) \]
    5. Applied egg-rr87.8%

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

    if -4e18 < (*.f64 a b) < 1e22

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

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

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

Alternative 6: 88.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+68} \lor \neg \left(a \cdot b \leq 0.01\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+68) (not (<= (* a b) 0.01)))
   (- (+ 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+68) || !((a * b) <= 0.01)) {
		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+68)) .or. (.not. ((a * b) <= 0.01d0))) 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+68) || !((a * b) <= 0.01)) {
		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+68) or not ((a * b) <= 0.01):
		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+68) || !(Float64(a * b) <= 0.01))
		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+68) || ~(((a * b) <= 0.01)))
		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+68], N[Not[LessEqual[N[(a * b), $MachinePrecision], 0.01]], $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^{+68} \lor \neg \left(a \cdot b \leq 0.01\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) < -1.99999999999999991e68 or 0.0100000000000000002 < (*.f64 a b)

    1. Initial program 93.9%

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

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

    if -1.99999999999999991e68 < (*.f64 a b) < 0.0100000000000000002

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

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

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

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

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

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

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


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999991e68 < (*.f64 a b) < 5.00000000000000041e217

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

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

    if 5.00000000000000041e217 < (*.f64 a b)

    1. Initial program 96.9%

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

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

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

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

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

Alternative 8: 66.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+54} \lor \neg \left(a \cdot b \leq 10^{+22}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.0000000000000001e54 or 1e22 < (*.f64 a b)

    1. Initial program 93.9%

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

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

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

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

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

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

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

      \[\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. Taylor expanded in a around inf 76.5%

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

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

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

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

    if -1.0000000000000001e54 < (*.f64 a b) < 1e22

    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}{c + \left(0.0625 \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
    4. Taylor expanded in c around inf 80.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+54} \lor \neg \left(a \cdot b \leq 10^{+22}\right):\\ \;\;\;\;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 9: 66.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 88.9%

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

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

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

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

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

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

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

      \[\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. Taylor expanded in a around inf 80.4%

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

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

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

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

    if -1.0000000000000001e54 < (*.f64 a b) < 0.0100000000000000002

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

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

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

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

    if 0.0100000000000000002 < (*.f64 a b)

    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 z around 0 85.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 73.3%

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

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

Alternative 10: 66.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.7 \cdot 10^{+70} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+59}\right):\\
\;\;\;\;c + x \cdot y\\

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


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

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative70.9%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified70.9%

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

    if -3.69999999999999989e70 < (*.f64 x y) < 1.1e59

    1. Initial program 99.5%

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

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

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

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

Alternative 11: 38.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 1.42 \cdot 10^{+38}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.80000000000000069e-117 or 1.4200000000000001e38 < t

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

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

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

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

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

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

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

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

    if -6.80000000000000069e-117 < t < 3.79999999999999998e-140

    1. Initial program 98.6%

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative65.6%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified65.6%

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

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

    if 3.79999999999999998e-140 < t < 1.4200000000000001e38

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

      \[\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 t around 0 66.1%

      \[\leadsto \color{blue}{c - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Taylor expanded in c around 0 41.7%

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

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

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

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

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

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

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

Alternative 12: 41.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{-20} \lor \neg \left(x \cdot y \leq 3.2 \cdot 10^{-43}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -3.1999999999999997e-20 or 3.19999999999999985e-43 < (*.f64 x y)

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative56.7%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified56.7%

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

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

    if -3.1999999999999997e-20 < (*.f64 x y) < 3.19999999999999985e-43

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

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

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

Alternative 13: 97.8% accurate, 1.0× speedup?

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

\\
c + \left(\left(z \cdot \left(t \cdot 0.0625\right) + x \cdot y\right) - a \cdot \frac{b}{4}\right)
\end{array}
Derivation
  1. Initial program 97.7%

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

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

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

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

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

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

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

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

    \[\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. Step-by-step derivation
    1. fma-undefine98.4%

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

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

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

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

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

      \[\leadsto \left(\left(z \cdot \left(t \cdot \color{blue}{0.0625}\right) + x \cdot y\right) - a \cdot \frac{b}{4}\right) + c \]
  6. Applied egg-rr98.4%

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

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

Alternative 14: 97.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 15: 53.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{-34} \lor \neg \left(t \leq 1.65 \cdot 10^{+120}\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 -8e-34) (not (<= t 1.65e+120)))
   (* 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 <= -8e-34) || !(t <= 1.65e+120)) {
		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 <= (-8d-34)) .or. (.not. (t <= 1.65d+120))) 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 <= -8e-34) || !(t <= 1.65e+120)) {
		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 <= -8e-34) or not (t <= 1.65e+120):
		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 <= -8e-34) || !(t <= 1.65e+120))
		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 <= -8e-34) || ~((t <= 1.65e+120)))
		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, -8e-34], N[Not[LessEqual[t, 1.65e+120]], $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 -8 \cdot 10^{-34} \lor \neg \left(t \leq 1.65 \cdot 10^{+120}\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 < -7.99999999999999942e-34 or 1.64999999999999995e120 < t

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

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

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

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

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

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

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

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

    if -7.99999999999999942e-34 < t < 1.64999999999999995e120

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    5. Step-by-step derivation
      1. +-commutative60.0%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    6. Simplified60.0%

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

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

Alternative 16: 22.6% 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.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 20.5%

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

Reproduce

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