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

Percentage Accurate: 97.5% → 98.8%
Time: 9.7s
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.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.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 3: 61.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(t \cdot z\right)\\ t_2 := c + t_1\\ t_3 := c + x \cdot y\\ t_4 := t_1 + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{-15}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-227}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-223}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-197}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-30}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+81}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+163}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* t z)))
        (t_2 (+ c t_1))
        (t_3 (+ c (* x y)))
        (t_4 (+ t_1 (* (* b a) -0.25))))
   (if (<= y -4.8e-15)
     t_3
     (if (<= y -3.4e-227)
       t_2
       (if (<= y 4.8e-223)
         t_4
         (if (<= y 2.45e-197)
           t_2
           (if (<= y 1.2e-30)
             t_4
             (if (<= y 1.25e+81)
               t_2
               (if (<= y 8.4e+105)
                 (+ c (* b (* a -0.25)))
                 (if (<= y 5.4e+163) t_3 (- (* x y) (* (* b a) 0.25))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (t * z);
	double t_2 = c + t_1;
	double t_3 = c + (x * y);
	double t_4 = t_1 + ((b * a) * -0.25);
	double tmp;
	if (y <= -4.8e-15) {
		tmp = t_3;
	} else if (y <= -3.4e-227) {
		tmp = t_2;
	} else if (y <= 4.8e-223) {
		tmp = t_4;
	} else if (y <= 2.45e-197) {
		tmp = t_2;
	} else if (y <= 1.2e-30) {
		tmp = t_4;
	} else if (y <= 1.25e+81) {
		tmp = t_2;
	} else if (y <= 8.4e+105) {
		tmp = c + (b * (a * -0.25));
	} else if (y <= 5.4e+163) {
		tmp = t_3;
	} else {
		tmp = (x * y) - ((b * a) * 0.25);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = 0.0625d0 * (t * z)
    t_2 = c + t_1
    t_3 = c + (x * y)
    t_4 = t_1 + ((b * a) * (-0.25d0))
    if (y <= (-4.8d-15)) then
        tmp = t_3
    else if (y <= (-3.4d-227)) then
        tmp = t_2
    else if (y <= 4.8d-223) then
        tmp = t_4
    else if (y <= 2.45d-197) then
        tmp = t_2
    else if (y <= 1.2d-30) then
        tmp = t_4
    else if (y <= 1.25d+81) then
        tmp = t_2
    else if (y <= 8.4d+105) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (y <= 5.4d+163) then
        tmp = t_3
    else
        tmp = (x * y) - ((b * a) * 0.25d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (t * z);
	double t_2 = c + t_1;
	double t_3 = c + (x * y);
	double t_4 = t_1 + ((b * a) * -0.25);
	double tmp;
	if (y <= -4.8e-15) {
		tmp = t_3;
	} else if (y <= -3.4e-227) {
		tmp = t_2;
	} else if (y <= 4.8e-223) {
		tmp = t_4;
	} else if (y <= 2.45e-197) {
		tmp = t_2;
	} else if (y <= 1.2e-30) {
		tmp = t_4;
	} else if (y <= 1.25e+81) {
		tmp = t_2;
	} else if (y <= 8.4e+105) {
		tmp = c + (b * (a * -0.25));
	} else if (y <= 5.4e+163) {
		tmp = t_3;
	} else {
		tmp = (x * y) - ((b * a) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (t * z)
	t_2 = c + t_1
	t_3 = c + (x * y)
	t_4 = t_1 + ((b * a) * -0.25)
	tmp = 0
	if y <= -4.8e-15:
		tmp = t_3
	elif y <= -3.4e-227:
		tmp = t_2
	elif y <= 4.8e-223:
		tmp = t_4
	elif y <= 2.45e-197:
		tmp = t_2
	elif y <= 1.2e-30:
		tmp = t_4
	elif y <= 1.25e+81:
		tmp = t_2
	elif y <= 8.4e+105:
		tmp = c + (b * (a * -0.25))
	elif y <= 5.4e+163:
		tmp = t_3
	else:
		tmp = (x * y) - ((b * a) * 0.25)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(t * z))
	t_2 = Float64(c + t_1)
	t_3 = Float64(c + Float64(x * y))
	t_4 = Float64(t_1 + Float64(Float64(b * a) * -0.25))
	tmp = 0.0
	if (y <= -4.8e-15)
		tmp = t_3;
	elseif (y <= -3.4e-227)
		tmp = t_2;
	elseif (y <= 4.8e-223)
		tmp = t_4;
	elseif (y <= 2.45e-197)
		tmp = t_2;
	elseif (y <= 1.2e-30)
		tmp = t_4;
	elseif (y <= 1.25e+81)
		tmp = t_2;
	elseif (y <= 8.4e+105)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (y <= 5.4e+163)
		tmp = t_3;
	else
		tmp = Float64(Float64(x * y) - Float64(Float64(b * a) * 0.25));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = 0.0625 * (t * z);
	t_2 = c + t_1;
	t_3 = c + (x * y);
	t_4 = t_1 + ((b * a) * -0.25);
	tmp = 0.0;
	if (y <= -4.8e-15)
		tmp = t_3;
	elseif (y <= -3.4e-227)
		tmp = t_2;
	elseif (y <= 4.8e-223)
		tmp = t_4;
	elseif (y <= 2.45e-197)
		tmp = t_2;
	elseif (y <= 1.2e-30)
		tmp = t_4;
	elseif (y <= 1.25e+81)
		tmp = t_2;
	elseif (y <= 8.4e+105)
		tmp = c + (b * (a * -0.25));
	elseif (y <= 5.4e+163)
		tmp = t_3;
	else
		tmp = (x * y) - ((b * a) * 0.25);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-15], t$95$3, If[LessEqual[y, -3.4e-227], t$95$2, If[LessEqual[y, 4.8e-223], t$95$4, If[LessEqual[y, 2.45e-197], t$95$2, If[LessEqual[y, 1.2e-30], t$95$4, If[LessEqual[y, 1.25e+81], t$95$2, If[LessEqual[y, 8.4e+105], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+163], t$95$3, N[(N[(x * y), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.4 \cdot 10^{-227}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-223}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;y \leq 2.45 \cdot 10^{-197}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-30}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+81}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{+163}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -4.7999999999999999e-15 or 8.4000000000000004e105 < y < 5.39999999999999998e163

    1. Initial program 94.7%

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

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

    if -4.7999999999999999e-15 < y < -3.39999999999999979e-227 or 4.79999999999999971e-223 < y < 2.4500000000000001e-197 or 1.19999999999999992e-30 < y < 1.25e81

    1. Initial program 100.0%

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

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

    if -3.39999999999999979e-227 < y < 4.79999999999999971e-223 or 2.4500000000000001e-197 < y < 1.19999999999999992e-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. Step-by-step derivation
      1. associate-+l-100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv95.5%

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

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

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

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

        \[\leadsto \left(\color{blue}{z \cdot \left(t \cdot 0.0625\right)} + c\right) + \left(-0.25\right) \cdot \left(a \cdot b\right) \]
      6. fma-udef95.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t \cdot 0.0625, c\right)} + \left(-0.25\right) \cdot \left(a \cdot b\right) \]
      7. metadata-eval95.5%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{-0.25} \cdot \left(a \cdot b\right) \]
      8. associate-*r*95.5%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(-0.25 \cdot a\right) \cdot b} \]
      9. *-commutative95.5%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(a \cdot -0.25\right)} \cdot b \]
      10. *-commutative95.5%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      11. +-commutative95.5%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right) + \mathsf{fma}\left(z, t \cdot 0.0625, c\right)} \]
      12. fma-def95.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, t \cdot 0.0625, c\right)\right)} \]
      13. *-commutative95.5%

        \[\leadsto \mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, \color{blue}{0.0625 \cdot t}, c\right)\right) \]
    6. Simplified95.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, 0.0625 \cdot t, c\right)\right)} \]
    7. Taylor expanded in c around 0 69.9%

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

    if 1.25e81 < y < 8.4000000000000004e105

    1. Initial program 66.7%

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

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

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

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

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

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

    if 5.39999999999999998e163 < y

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-15}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-227}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-223}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right) + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-197}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-30}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right) + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+81}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+105}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{+163}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 4: 66.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-270}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+132}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

    if -1.00000000000000004e62 < (*.f64 a b) < -2.0000000000000001e-270 or 4.9999999999999998e-82 < (*.f64 a b) < 1.99999999999999998e132

    1. Initial program 99.1%

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

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

    if -2.0000000000000001e-270 < (*.f64 a b) < 4.9999999999999998e-82

    1. Initial program 98.6%

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

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

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

Alternative 5: 88.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+131}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\

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


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

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

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

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

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

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

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

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

    if -3.99999999999999978e-20 < (*.f64 x y) < 4.99999999999999995e131

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

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

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

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

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

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

    if 4.99999999999999995e131 < (*.f64 x y)

    1. Initial program 95.1%

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

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

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

Alternative 6: 37.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(t \cdot z\right)\\ t_2 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;x \leq -3 \cdot 10^{+193}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{+96}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-94}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-248}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* 0.0625 (* t z))) (t_2 (* b (* a -0.25))))
   (if (<= x -3e+193)
     (* x y)
     (if (<= x -1.15e+143)
       t_1
       (if (<= x -1.2e+96)
         (* x y)
         (if (<= x -7.8e-94)
           t_2
           (if (<= x -1.05e-121)
             t_1
             (if (<= x -2.7e-248) t_2 (if (<= x 5.5e+39) t_1 (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = 0.0625 * (t * z);
	double t_2 = b * (a * -0.25);
	double tmp;
	if (x <= -3e+193) {
		tmp = x * y;
	} else if (x <= -1.15e+143) {
		tmp = t_1;
	} else if (x <= -1.2e+96) {
		tmp = x * y;
	} else if (x <= -7.8e-94) {
		tmp = t_2;
	} else if (x <= -1.05e-121) {
		tmp = t_1;
	} else if (x <= -2.7e-248) {
		tmp = t_2;
	} else if (x <= 5.5e+39) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 0.0625d0 * (t * z)
    t_2 = b * (a * (-0.25d0))
    if (x <= (-3d+193)) then
        tmp = x * y
    else if (x <= (-1.15d+143)) then
        tmp = t_1
    else if (x <= (-1.2d+96)) then
        tmp = x * y
    else if (x <= (-7.8d-94)) then
        tmp = t_2
    else if (x <= (-1.05d-121)) then
        tmp = t_1
    else if (x <= (-2.7d-248)) then
        tmp = t_2
    else if (x <= 5.5d+39) 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 = 0.0625 * (t * z);
	double t_2 = b * (a * -0.25);
	double tmp;
	if (x <= -3e+193) {
		tmp = x * y;
	} else if (x <= -1.15e+143) {
		tmp = t_1;
	} else if (x <= -1.2e+96) {
		tmp = x * y;
	} else if (x <= -7.8e-94) {
		tmp = t_2;
	} else if (x <= -1.05e-121) {
		tmp = t_1;
	} else if (x <= -2.7e-248) {
		tmp = t_2;
	} else if (x <= 5.5e+39) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = 0.0625 * (t * z)
	t_2 = b * (a * -0.25)
	tmp = 0
	if x <= -3e+193:
		tmp = x * y
	elif x <= -1.15e+143:
		tmp = t_1
	elif x <= -1.2e+96:
		tmp = x * y
	elif x <= -7.8e-94:
		tmp = t_2
	elif x <= -1.05e-121:
		tmp = t_1
	elif x <= -2.7e-248:
		tmp = t_2
	elif x <= 5.5e+39:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(0.0625 * Float64(t * z))
	t_2 = Float64(b * Float64(a * -0.25))
	tmp = 0.0
	if (x <= -3e+193)
		tmp = Float64(x * y);
	elseif (x <= -1.15e+143)
		tmp = t_1;
	elseif (x <= -1.2e+96)
		tmp = Float64(x * y);
	elseif (x <= -7.8e-94)
		tmp = t_2;
	elseif (x <= -1.05e-121)
		tmp = t_1;
	elseif (x <= -2.7e-248)
		tmp = t_2;
	elseif (x <= 5.5e+39)
		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 = 0.0625 * (t * z);
	t_2 = b * (a * -0.25);
	tmp = 0.0;
	if (x <= -3e+193)
		tmp = x * y;
	elseif (x <= -1.15e+143)
		tmp = t_1;
	elseif (x <= -1.2e+96)
		tmp = x * y;
	elseif (x <= -7.8e-94)
		tmp = t_2;
	elseif (x <= -1.05e-121)
		tmp = t_1;
	elseif (x <= -2.7e-248)
		tmp = t_2;
	elseif (x <= 5.5e+39)
		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[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+193], N[(x * y), $MachinePrecision], If[LessEqual[x, -1.15e+143], t$95$1, If[LessEqual[x, -1.2e+96], N[(x * y), $MachinePrecision], If[LessEqual[x, -7.8e-94], t$95$2, If[LessEqual[x, -1.05e-121], t$95$1, If[LessEqual[x, -2.7e-248], t$95$2, If[LessEqual[x, 5.5e+39], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.15 \cdot 10^{+143}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -1.2 \cdot 10^{+96}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq -7.8 \cdot 10^{-94}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-121}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -2.7 \cdot 10^{-248}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 5.5 \cdot 10^{+39}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3e193 or -1.15e143 < x < -1.19999999999999996e96 or 5.4999999999999997e39 < x

    1. Initial program 93.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef93.0%

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

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

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

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

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

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

    if -3e193 < x < -1.15e143 or -7.8000000000000004e-94 < x < -1.0499999999999999e-121 or -2.7000000000000001e-248 < x < 5.4999999999999997e39

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

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

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

    if -1.19999999999999996e96 < x < -7.8000000000000004e-94 or -1.0499999999999999e-121 < x < -2.7000000000000001e-248

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+193}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+143}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{+96}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-94}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-121}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;x \leq -2.7 \cdot 10^{-248}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+39}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 60.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + 0.0625 \cdot \left(t \cdot z\right)\\ t_2 := c + x \cdot y\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;y \leq -9 \cdot 10^{-15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-244}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-303}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-241}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-102}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+60}:\\ \;\;\;\;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 (* t z))))
        (t_2 (+ c (* x y)))
        (t_3 (+ c (* b (* a -0.25)))))
   (if (<= y -9e-15)
     t_2
     (if (<= y -1.65e-244)
       t_1
       (if (<= y -5.6e-303)
         t_3
         (if (<= y 5.5e-241)
           t_1
           (if (<= y 1.65e-102) t_3 (if (<= y 1.55e+60) 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 * (t * z));
	double t_2 = c + (x * y);
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (y <= -9e-15) {
		tmp = t_2;
	} else if (y <= -1.65e-244) {
		tmp = t_1;
	} else if (y <= -5.6e-303) {
		tmp = t_3;
	} else if (y <= 5.5e-241) {
		tmp = t_1;
	} else if (y <= 1.65e-102) {
		tmp = t_3;
	} else if (y <= 1.55e+60) {
		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) :: t_3
    real(8) :: tmp
    t_1 = c + (0.0625d0 * (t * z))
    t_2 = c + (x * y)
    t_3 = c + (b * (a * (-0.25d0)))
    if (y <= (-9d-15)) then
        tmp = t_2
    else if (y <= (-1.65d-244)) then
        tmp = t_1
    else if (y <= (-5.6d-303)) then
        tmp = t_3
    else if (y <= 5.5d-241) then
        tmp = t_1
    else if (y <= 1.65d-102) then
        tmp = t_3
    else if (y <= 1.55d+60) 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 * (t * z));
	double t_2 = c + (x * y);
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (y <= -9e-15) {
		tmp = t_2;
	} else if (y <= -1.65e-244) {
		tmp = t_1;
	} else if (y <= -5.6e-303) {
		tmp = t_3;
	} else if (y <= 5.5e-241) {
		tmp = t_1;
	} else if (y <= 1.65e-102) {
		tmp = t_3;
	} else if (y <= 1.55e+60) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (0.0625 * (t * z))
	t_2 = c + (x * y)
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if y <= -9e-15:
		tmp = t_2
	elif y <= -1.65e-244:
		tmp = t_1
	elif y <= -5.6e-303:
		tmp = t_3
	elif y <= 5.5e-241:
		tmp = t_1
	elif y <= 1.65e-102:
		tmp = t_3
	elif y <= 1.55e+60:
		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(t * z)))
	t_2 = Float64(c + Float64(x * y))
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (y <= -9e-15)
		tmp = t_2;
	elseif (y <= -1.65e-244)
		tmp = t_1;
	elseif (y <= -5.6e-303)
		tmp = t_3;
	elseif (y <= 5.5e-241)
		tmp = t_1;
	elseif (y <= 1.65e-102)
		tmp = t_3;
	elseif (y <= 1.55e+60)
		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 * (t * z));
	t_2 = c + (x * y);
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (y <= -9e-15)
		tmp = t_2;
	elseif (y <= -1.65e-244)
		tmp = t_1;
	elseif (y <= -5.6e-303)
		tmp = t_3;
	elseif (y <= 5.5e-241)
		tmp = t_1;
	elseif (y <= 1.65e-102)
		tmp = t_3;
	elseif (y <= 1.55e+60)
		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[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e-15], t$95$2, If[LessEqual[y, -1.65e-244], t$95$1, If[LessEqual[y, -5.6e-303], t$95$3, If[LessEqual[y, 5.5e-241], t$95$1, If[LessEqual[y, 1.65e-102], t$95$3, If[LessEqual[y, 1.55e+60], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.65 \cdot 10^{-244}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{-303}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-241}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-102}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.9999999999999995e-15 or 1.55e60 < y

    1. Initial program 94.5%

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

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

    if -8.9999999999999995e-15 < y < -1.65000000000000013e-244 or -5.6e-303 < y < 5.4999999999999998e-241 or 1.65e-102 < y < 1.55e60

    1. Initial program 100.0%

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

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

    if -1.65000000000000013e-244 < y < -5.6e-303 or 5.4999999999999998e-241 < y < 1.65e-102

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-15}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq -1.65 \cdot 10^{-244}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{-303}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-241}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-102}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+60}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 8: 89.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+14} \lor \neg \left(b \cdot a \leq 2 \cdot 10^{+132}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - \left(b \cdot a\right) \cdot 0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5e14 or 1.99999999999999998e132 < (*.f64 a b)

    1. Initial program 95.0%

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

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

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

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

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

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

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

    if -5e14 < (*.f64 a b) < 1.99999999999999998e132

    1. Initial program 98.7%

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

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

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

Alternative 9: 86.3% accurate, 0.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

    if -1.10000000000000007e62 < (*.f64 a b) < 2.00000000000000003e141

    1. Initial program 98.9%

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

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

    if 2.00000000000000003e141 < (*.f64 a b)

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv95.8%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t \cdot 0.0625, c\right)} + \left(-0.25\right) \cdot \left(a \cdot b\right) \]
      7. metadata-eval95.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{-0.25} \cdot \left(a \cdot b\right) \]
      8. associate-*r*95.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(-0.25 \cdot a\right) \cdot b} \]
      9. *-commutative95.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(a \cdot -0.25\right)} \cdot b \]
      10. *-commutative95.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      11. +-commutative95.8%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right) + \mathsf{fma}\left(z, t \cdot 0.0625, c\right)} \]
      12. fma-def95.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, t \cdot 0.0625, c\right)\right)} \]
      13. *-commutative95.9%

        \[\leadsto \mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, \color{blue}{0.0625 \cdot t}, c\right)\right) \]
    6. Simplified95.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, 0.0625 \cdot t, c\right)\right)} \]
    7. Taylor expanded in c around 0 86.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1.1 \cdot 10^{+62}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+141}:\\ \;\;\;\;c + \left(x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right) + \left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 10: 97.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 97.6% accurate, 1.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
  4. Step-by-step derivation
    1. fma-udef97.7%

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

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

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

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

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

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

Alternative 12: 58.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(t \cdot z\right)\\ t_3 := c + t_2\\ \mathbf{if}\;t \leq -5.5 \cdot 10^{-108}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.1 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* t z))) (t_3 (+ c t_2)))
   (if (<= t -5.5e-108)
     t_3
     (if (<= t 2.1e-30)
       t_1
       (if (<= t 7.1e-9) t_2 (if (<= t 6.6e+24) t_1 t_3))))))
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 = 0.0625 * (t * z);
	double t_3 = c + t_2;
	double tmp;
	if (t <= -5.5e-108) {
		tmp = t_3;
	} else if (t <= 2.1e-30) {
		tmp = t_1;
	} else if (t <= 7.1e-9) {
		tmp = t_2;
	} else if (t <= 6.6e+24) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = 0.0625d0 * (t * z)
    t_3 = c + t_2
    if (t <= (-5.5d-108)) then
        tmp = t_3
    else if (t <= 2.1d-30) then
        tmp = t_1
    else if (t <= 7.1d-9) then
        tmp = t_2
    else if (t <= 6.6d+24) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = 0.0625 * (t * z);
	double t_3 = c + t_2;
	double tmp;
	if (t <= -5.5e-108) {
		tmp = t_3;
	} else if (t <= 2.1e-30) {
		tmp = t_1;
	} else if (t <= 7.1e-9) {
		tmp = t_2;
	} else if (t <= 6.6e+24) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = 0.0625 * (t * z)
	t_3 = c + t_2
	tmp = 0
	if t <= -5.5e-108:
		tmp = t_3
	elif t <= 2.1e-30:
		tmp = t_1
	elif t <= 7.1e-9:
		tmp = t_2
	elif t <= 6.6e+24:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(0.0625 * Float64(t * z))
	t_3 = Float64(c + t_2)
	tmp = 0.0
	if (t <= -5.5e-108)
		tmp = t_3;
	elseif (t <= 2.1e-30)
		tmp = t_1;
	elseif (t <= 7.1e-9)
		tmp = t_2;
	elseif (t <= 6.6e+24)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = 0.0625 * (t * z);
	t_3 = c + t_2;
	tmp = 0.0;
	if (t <= -5.5e-108)
		tmp = t_3;
	elseif (t <= 2.1e-30)
		tmp = t_1;
	elseif (t <= 7.1e-9)
		tmp = t_2;
	elseif (t <= 6.6e+24)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + t$95$2), $MachinePrecision]}, If[LessEqual[t, -5.5e-108], t$95$3, If[LessEqual[t, 2.1e-30], t$95$1, If[LessEqual[t, 7.1e-9], t$95$2, If[LessEqual[t, 6.6e+24], t$95$1, t$95$3]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7.1 \cdot 10^{-9}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 6.6 \cdot 10^{+24}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.50000000000000031e-108 or 6.5999999999999998e24 < t

    1. Initial program 97.4%

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

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

    if -5.50000000000000031e-108 < t < 2.1000000000000002e-30 or 7.09999999999999988e-9 < t < 6.5999999999999998e24

    1. Initial program 97.0%

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

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

    if 2.1000000000000002e-30 < t < 7.09999999999999988e-9

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-108}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 7.1 \cdot 10^{-9}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t \leq 6.6 \cdot 10^{+24}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \end{array} \]

Alternative 13: 37.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq -1.15 \cdot 10^{+143} \lor \neg \left(x \leq -7.4 \cdot 10^{+82}\right) \land x \leq 2 \cdot 10^{+61}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.45000000000000007e193 or -1.15e143 < x < -7.4000000000000005e82 or 1.9999999999999999e61 < x

    1. Initial program 94.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef94.0%

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

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

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

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

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

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

    if -1.45000000000000007e193 < x < -1.15e143 or -7.4000000000000005e82 < x < 1.9999999999999999e61

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{+193}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+143} \lor \neg \left(x \leq -7.4 \cdot 10^{+82}\right) \land x \leq 2 \cdot 10^{+61}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 14: 50.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;t \leq -5.4 \cdot 10^{-105}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+115}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;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 (+ c (* x y))) (t_2 (* 0.0625 (* t z))))
   (if (<= t -5.4e-105)
     t_2
     (if (<= t 2.1e-30)
       t_1
       (if (<= t 7.4e-9) t_2 (if (<= t 9.5e+115) t_1 (* t (* z 0.0625))))))))
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 = 0.0625 * (t * z);
	double tmp;
	if (t <= -5.4e-105) {
		tmp = t_2;
	} else if (t <= 2.1e-30) {
		tmp = t_1;
	} else if (t <= 7.4e-9) {
		tmp = t_2;
	} else if (t <= 9.5e+115) {
		tmp = t_1;
	} else {
		tmp = 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) :: t_2
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = 0.0625d0 * (t * z)
    if (t <= (-5.4d-105)) then
        tmp = t_2
    else if (t <= 2.1d-30) then
        tmp = t_1
    else if (t <= 7.4d-9) then
        tmp = t_2
    else if (t <= 9.5d+115) then
        tmp = t_1
    else
        tmp = 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 = c + (x * y);
	double t_2 = 0.0625 * (t * z);
	double tmp;
	if (t <= -5.4e-105) {
		tmp = t_2;
	} else if (t <= 2.1e-30) {
		tmp = t_1;
	} else if (t <= 7.4e-9) {
		tmp = t_2;
	} else if (t <= 9.5e+115) {
		tmp = t_1;
	} else {
		tmp = t * (z * 0.0625);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = 0.0625 * (t * z)
	tmp = 0
	if t <= -5.4e-105:
		tmp = t_2
	elif t <= 2.1e-30:
		tmp = t_1
	elif t <= 7.4e-9:
		tmp = t_2
	elif t <= 9.5e+115:
		tmp = t_1
	else:
		tmp = t * (z * 0.0625)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(0.0625 * Float64(t * z))
	tmp = 0.0
	if (t <= -5.4e-105)
		tmp = t_2;
	elseif (t <= 2.1e-30)
		tmp = t_1;
	elseif (t <= 7.4e-9)
		tmp = t_2;
	elseif (t <= 9.5e+115)
		tmp = t_1;
	else
		tmp = Float64(t * Float64(z * 0.0625));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = 0.0625 * (t * z);
	tmp = 0.0;
	if (t <= -5.4e-105)
		tmp = t_2;
	elseif (t <= 2.1e-30)
		tmp = t_1;
	elseif (t <= 7.4e-9)
		tmp = t_2;
	elseif (t <= 9.5e+115)
		tmp = t_1;
	else
		tmp = t * (z * 0.0625);
	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[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e-105], t$95$2, If[LessEqual[t, 2.1e-30], t$95$1, If[LessEqual[t, 7.4e-9], t$95$2, If[LessEqual[t, 9.5e+115], t$95$1, N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 7.4 \cdot 10^{-9}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 9.5 \cdot 10^{+115}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.39999999999999985e-105 or 2.1000000000000002e-30 < t < 7.4e-9

    1. Initial program 99.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.0%

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

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

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

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

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

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

    if -5.39999999999999985e-105 < t < 2.1000000000000002e-30 or 7.4e-9 < t < 9.4999999999999997e115

    1. Initial program 97.5%

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

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

    if 9.4999999999999997e115 < t

    1. Initial program 90.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-90.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(c + 0.0625 \cdot \left(t \cdot z\right)\right) - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. cancel-sign-sub-inv72.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t \cdot 0.0625, c\right)} + \left(-0.25\right) \cdot \left(a \cdot b\right) \]
      7. metadata-eval74.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{-0.25} \cdot \left(a \cdot b\right) \]
      8. associate-*r*74.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(-0.25 \cdot a\right) \cdot b} \]
      9. *-commutative74.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{\left(a \cdot -0.25\right)} \cdot b \]
      10. *-commutative74.8%

        \[\leadsto \mathsf{fma}\left(z, t \cdot 0.0625, c\right) + \color{blue}{b \cdot \left(a \cdot -0.25\right)} \]
      11. +-commutative74.8%

        \[\leadsto \color{blue}{b \cdot \left(a \cdot -0.25\right) + \mathsf{fma}\left(z, t \cdot 0.0625, c\right)} \]
      12. fma-def74.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, t \cdot 0.0625, c\right)\right)} \]
      13. *-commutative74.8%

        \[\leadsto \mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, \color{blue}{0.0625 \cdot t}, c\right)\right) \]
    6. Simplified74.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a \cdot -0.25, \mathsf{fma}\left(z, 0.0625 \cdot t, c\right)\right)} \]
    7. Taylor expanded in c around 0 65.5%

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right) + -0.25 \cdot \left(a \cdot b\right)} \]
    8. Taylor expanded in t around inf 52.8%

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

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

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

        \[\leadsto \color{blue}{t \cdot \left(0.0625 \cdot z\right)} \]
    10. Simplified55.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{-105}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{-30}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 7.4 \cdot 10^{-9}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{+115}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]

Alternative 15: 37.4% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-25}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;y \leq 9 \cdot 10^{+41}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.79999999999999988e-25 or 9.0000000000000002e41 < y

    1. Initial program 94.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{16} \cdot t\right) - \left(\frac{a}{4} \cdot b - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef95.3%

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

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

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

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

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

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

    if -2.79999999999999988e-25 < y < 9.0000000000000002e41

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-25}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+41}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{c} \]
  5. Final simplification20.9%

    \[\leadsto c \]

Reproduce

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