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

Percentage Accurate: 97.3% → 98.9%
Time: 12.5s
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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-43}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-79}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-46}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.25000000000000001e77

    1. Initial program 97.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 0 94.4%

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

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

    if -1.25000000000000001e77 < (*.f64 x y) < -1.4500000000000001e-43 or -5.4999999999999997e-79 < (*.f64 x y) < 0.0

    1. Initial program 100.0%

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

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

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

    if -1.4500000000000001e-43 < (*.f64 x y) < -5.4999999999999997e-79 or 0.0 < (*.f64 x y) < 2.7e-46

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

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

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

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

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

    if 2.7e-46 < (*.f64 x y)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.25 \cdot 10^{+77}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.45 \cdot 10^{-43}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -5.5 \cdot 10^{-79}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 2.7 \cdot 10^{-46}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 4: 87.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -8.2 \cdot 10^{+132}:\\
\;\;\;\;c + x \cdot y\\

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

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


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

    1. Initial program 96.3%

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

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

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

    if -8.19999999999999983e132 < (*.f64 x y) < 4.79999999999999966e137

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

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

    if 4.79999999999999966e137 < (*.f64 x y)

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y + \color{blue}{t \cdot \frac{z}{16}}\right) + \left(\frac{a}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{b}} + c\right) \]
    6. Taylor expanded in x around inf 93.2%

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

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

Alternative 5: 89.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+45} \lor \neg \left(a \cdot b \leq 10^{+30}\right):\\
\;\;\;\;\left(c + \frac{a}{\frac{-4}{b}}\right) + x \cdot y\\

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


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

    1. Initial program 98.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. sub-neg98.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y + \color{blue}{t \cdot \frac{z}{16}}\right) + \left(\frac{a}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{b}} + c\right) \]
    6. Taylor expanded in x around inf 88.7%

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

    if -5e45 < (*.f64 a b) < 1e30

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

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

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

Alternative 6: 85.2% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 97.3%

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

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

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

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

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

    if -4.99999999999999953e214 < (*.f64 a b) < 1e30

    1. Initial program 98.3%

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

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

    if 1e30 < (*.f64 a b)

    1. Initial program 97.8%

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

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

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

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

Alternative 7: 89.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+45}:\\
\;\;\;\;\left(c + \frac{a}{\frac{-4}{b}}\right) + x \cdot y\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e45 < (*.f64 a b) < 1e30

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

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

    if 1e30 < (*.f64 a b)

    1. Initial program 97.8%

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

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

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

Alternative 8: 43.6% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.9999999999999998e131 or 4.50000000000000018e206 < (*.f64 x y)

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

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

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

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

    if -1.9999999999999998e131 < (*.f64 x y) < -0.0029

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

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

    if -0.0029 < (*.f64 x y) < 4.50000000000000018e206

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+131}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -0.0029:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 4.5 \cdot 10^{+206}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 97.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 61.9% accurate, 1.1× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.99999999999999952e97 or 7.7999999999999995e-29 < x

    1. Initial program 95.6%

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

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

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

    if -8.99999999999999952e97 < x < -6.8000000000000003e-279

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

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

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

    if -6.8000000000000003e-279 < x < 7.7999999999999995e-29

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+97}:\\ \;\;\;\;x \cdot y - 0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-279}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{-29}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - 0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 11: 64.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+75} \lor \neg \left(x \cdot y \leq 3.1 \cdot 10^{+170}\right):\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -6.4999999999999998e75 or 3.1e170 < (*.f64 x y)

    1. Initial program 94.7%

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

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

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

    if -6.4999999999999998e75 < (*.f64 x y) < 3.1e170

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+75} \lor \neg \left(x \cdot y \leq 3.1 \cdot 10^{+170}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 12: 48.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;t \leq 6.5 \cdot 10^{-278}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 8.2 \cdot 10^{+222}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.79999999999999993e-114 or 8.19999999999999974e222 < t

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.79999999999999993e-114 < t < 6.5e-278 or 2.99999999999999991e-240 < t < 8.19999999999999974e222

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

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

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

    if 6.5e-278 < t < 2.99999999999999991e-240

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y + \color{blue}{t \cdot \frac{z}{16}}\right) + \left(\frac{a}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{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}{\frac{-4}{b}} + c\right) \]
    6. Taylor expanded in a around inf 80.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{-114}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-278}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-240}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{+222}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]

Alternative 13: 59.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+112}:\\
\;\;\;\;t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.1999999999999998e112 or 5.00000000000000024e-5 < x

    1. Initial program 96.2%

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

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

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

    if -4.1999999999999998e112 < x < -1.24999999999999996e-278

    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 x around 0 87.9%

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

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

    if -1.24999999999999996e-278 < x < 5.00000000000000024e-5

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

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

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

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

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

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

Alternative 14: 39.6% accurate, 1.5× speedup?

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

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

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

\mathbf{elif}\;x \leq 0.00011:\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.90000000000000004e112 or 1.10000000000000004e-4 < x

    1. Initial program 96.2%

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

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

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

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

    if -1.90000000000000004e112 < x < -5.10000000000000011e-256

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.10000000000000011e-256 < x < 1.10000000000000004e-4

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{+112}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -5.1 \cdot 10^{-256}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \leq 0.00011:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 15: 40.0% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 95.2%

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

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

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

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

    if -2.40000000000000024e130 < (*.f64 x y) < 6.00000000000000007e-43

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.4 \cdot 10^{+130} \lor \neg \left(x \cdot y \leq 6 \cdot 10^{-43}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 16: 21.6% accurate, 17.0× speedup?

\[\begin{array}{l} \\ c \end{array} \]
(FPCore (x y z t a b c) :precision binary64 c)
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
def code(x, y, z, t, a, b, c):
	return c
function code(x, y, z, t, a, b, c)
	return c
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = c;
end
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}

\\
c
\end{array}
Derivation
  1. Initial program 98.1%

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

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

    \[\leadsto c \]

Reproduce

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