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

Percentage Accurate: 97.4% → 98.8%
Time: 8.6s
Alternatives: 16
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\frac{t \cdot z}{16} + x \cdot y\right) - \frac{b \cdot a}{4}\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;c + t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(b \cdot a\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (+ (/ (* t z) 16.0) (* x y)) (/ (* b a) 4.0))))
   (if (<= t_1 INFINITY) (+ c t_1) (fma y x (* (* b a) -0.25)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (((t * z) / 16.0) + (x * y)) - ((b * a) / 4.0);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = c + t_1;
	} else {
		tmp = fma(y, x, ((b * a) * -0.25));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(Float64(t * z) / 16.0) + Float64(x * y)) - Float64(Float64(b * a) / 4.0))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(c + t_1);
	else
		tmp = fma(y, x, Float64(Float64(b * a) * -0.25));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(N[(t * z), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * a), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(c + t$95$1), $MachinePrecision], N[(y * x + N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

      \[\leadsto \color{blue}{y \cdot x - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv37.5%

        \[\leadsto \color{blue}{y \cdot x + \left(-0.25\right) \cdot \left(a \cdot b\right)} \]
      2. metadata-eval37.5%

        \[\leadsto y \cdot x + \color{blue}{-0.25} \cdot \left(a \cdot b\right) \]
      3. fma-def75.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, -0.25 \cdot \left(a \cdot b\right)\right)} \]
    5. Simplified75.0%

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

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

Alternative 3: 64.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-215}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;b \cdot a \leq 10^{-250}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-120}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;b \cdot a \leq 10^{+95}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+142}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{+233}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a b) < -9.99999999999999952e246 or 1.00000000000000002e95 < (*.f64 a b) < 2.0000000000000001e142

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

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

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

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

    if -9.99999999999999952e246 < (*.f64 a b) < -1.00000000000000004e-215 or 2.0000000000000001e-290 < (*.f64 a b) < 1.0000000000000001e-250 or 1.99999999999999996e-120 < (*.f64 a b) < 1.00000000000000002e95 or 2.0000000000000001e142 < (*.f64 a b) < 3.00000000000000014e233

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e-215 < (*.f64 a b) < 2.0000000000000001e-290 or 1.0000000000000001e-250 < (*.f64 a b) < 1.00000000000000003e-161

    1. Initial program 98.4%

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

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

    if 1.00000000000000003e-161 < (*.f64 a b) < 1.99999999999999996e-120

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(0.0625 \cdot z\right)} + c \]
    4. Simplified100.0%

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

    if 3.00000000000000014e233 < (*.f64 a b)

    1. Initial program 80.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 84.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1 \cdot 10^{+247}:\\ \;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-215}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-290}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 10^{-250}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 10^{-161}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-120}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq 10^{+95}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+142}:\\ \;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{+233}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 4: 62.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-215}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 10^{-161}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;b \cdot a \leq 10^{+26}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{+233}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 87.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 80.4%

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

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

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

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

    if -4.9999999999999999e185 < (*.f64 a b) < -1.00000000000000004e-215 or 1.00000000000000003e-161 < (*.f64 a b) < 1.99999999999999996e-120 or 1.00000000000000005e26 < (*.f64 a b) < 9.9999999999999993e158

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(0.0625 \cdot z\right)} + c \]
    4. Simplified64.1%

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

    if -1.00000000000000004e-215 < (*.f64 a b) < 1.00000000000000003e-161 or 1.99999999999999996e-120 < (*.f64 a b) < 1.00000000000000005e26 or 9.9999999999999993e158 < (*.f64 a b) < 3.00000000000000014e233

    1. Initial program 99.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+185}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-215}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq 10^{-161}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-120}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq 10^{+26}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 10^{+159}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{+233}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 5: 98.3% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 6: 64.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -1 \cdot 10^{-215}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 10^{-161}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;b \cdot a \leq 10^{+27}:\\
\;\;\;\;t_3\\

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


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

    1. Initial program 92.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 69.2%

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

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

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

    if -4.9999999999999999e185 < (*.f64 a b) < -1.00000000000000004e-215 or 1.00000000000000003e-161 < (*.f64 a b) < 1.99999999999999996e-120

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\left(0.0625 \cdot z\right)} + c \]
    4. Simplified66.6%

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

    if -1.00000000000000004e-215 < (*.f64 a b) < 1.00000000000000003e-161 or 1.99999999999999996e-120 < (*.f64 a b) < 1e27

    1. Initial program 99.0%

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

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

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

Alternative 7: 43.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-102}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;b \cdot a \leq 10^{+27}:\\
\;\;\;\;x \cdot y\\

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


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

    1. Initial program 92.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 69.2%

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

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

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

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

    if -4.9999999999999999e185 < (*.f64 a b) < -5.00000000000000026e-102 or 5.0000000000000002e-157 < (*.f64 a b) < 1.99999999999999996e-120

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000026e-102 < (*.f64 a b) < 5.0000000000000002e-157 or 1.99999999999999996e-120 < (*.f64 a b) < 1e27

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -5 \cdot 10^{+185}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-102}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-157}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-120}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 10^{+27}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 8: 62.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \leq -6.2 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -2.1 \cdot 10^{-60}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;a \leq -9.8 \cdot 10^{-210}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.6 \cdot 10^{-194}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;a \leq 9.6 \cdot 10^{-27}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.1499999999999999e74 or 9.60000000000000008e-27 < a

    1. Initial program 92.5%

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

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

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

    if -1.1499999999999999e74 < a < -6.1999999999999998e-15 or -2.09999999999999991e-60 < a < -9.7999999999999996e-210

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999998e-15 < a < -2.09999999999999991e-60 or -9.7999999999999996e-210 < a < 1.6000000000000001e-194

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

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

    if 1.6000000000000001e-194 < a < 9.60000000000000008e-27

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.15 \cdot 10^{+74}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{elif}\;a \leq -6.2 \cdot 10^{-15}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;a \leq -2.1 \cdot 10^{-60}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq -9.8 \cdot 10^{-210}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-194}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-27}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 9: 61.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -2000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -5 \cdot 10^{-23}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\

\mathbf{elif}\;b \cdot a \leq 3 \cdot 10^{+233}:\\
\;\;\;\;t_1\\

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


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

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

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

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

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

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

    if -5e258 < (*.f64 a b) < -2e12 or -5.0000000000000002e-23 < (*.f64 a b) < 3.00000000000000014e233

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

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

    if -2e12 < (*.f64 a b) < -5.0000000000000002e-23

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 88.7% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\


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

    1. Initial program 93.9%

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

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

    if -4.9999999999999999e185 < (*.f64 a b) < 5.00000000000000005e54

    1. Initial program 99.4%

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

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

    if 5.00000000000000005e54 < (*.f64 a b)

    1. Initial program 89.4%

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

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

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

Alternative 11: 84.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 92.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 86.3%

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

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

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

    if -9.99999999999999952e246 < (*.f64 a b) < 3.00000000000000014e233

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

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

    if 3.00000000000000014e233 < (*.f64 a b)

    1. Initial program 80.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 84.9%

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

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

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

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

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

Alternative 12: 84.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 92.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 92.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 c around 0 92.0%

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

    if -5e258 < (*.f64 a b) < 3.00000000000000014e233

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

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

    if 3.00000000000000014e233 < (*.f64 a b)

    1. Initial program 80.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 84.9%

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

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

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

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

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

Alternative 13: 86.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 93.9%

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

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

    if -4.9999999999999999e185 < (*.f64 a b) < 3.00000000000000014e233

    1. Initial program 99.4%

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

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

    if 3.00000000000000014e233 < (*.f64 a b)

    1. Initial program 80.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 84.9%

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

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

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

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

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

Alternative 14: 43.4% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -7.2 \cdot 10^{+243} \lor \neg \left(b \cdot a \leq 1.65 \cdot 10^{+28}\right):\\
\;\;\;\;\left(b \cdot a\right) \cdot -0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -7.1999999999999993e243 or 1.65e28 < (*.f64 a b)

    1. Initial program 91.5%

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

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

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

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

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

    if -7.1999999999999993e243 < (*.f64 a b) < 1.65e28

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -7.2 \cdot 10^{+243} \lor \neg \left(b \cdot a \leq 1.65 \cdot 10^{+28}\right):\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 15: 37.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq -1.9 \cdot 10^{-39}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \leq -1.65 \cdot 10^{-77}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq 10^{-10}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5e79 or -1.9000000000000001e-39 < x < -1.64999999999999996e-77 or 1.00000000000000004e-10 < x

    1. Initial program 95.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. associate-+l-95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e79 < x < -1.9000000000000001e-39 or -1.64999999999999996e-77 < x < 1.00000000000000004e-10

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+79}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-39}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-77}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 10^{-10}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 22.2% 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 96.8%

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

    \[\leadsto \color{blue}{c} \]
  3. Final simplification20.2%

    \[\leadsto c \]

Reproduce

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