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

Percentage Accurate: 97.7% → 98.8%
Time: 8.8s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 97.7% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.1× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4} \leq \infty:\\ \;\;\;\;\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot b\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0)) INFINITY)
   (+ (fma x y (/ t (/ 16.0 z))) (- c (/ a (/ 4.0 b))))
   (fma y x (* (* a b) -0.25))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0)) <= ((double) INFINITY)) {
		tmp = fma(x, y, (t / (16.0 / z))) + (c - (a / (4.0 / b)));
	} else {
		tmp = fma(y, x, ((a * b) * -0.25));
	}
	return tmp;
}
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) <= Inf)
		tmp = Float64(fma(x, y, Float64(t / Float64(16.0 / z))) + Float64(c - Float64(a / Float64(4.0 / b))));
	else
		tmp = fma(y, x, Float64(Float64(a * b) * -0.25));
	end
	return tmp
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x * y + N[(t / N[(16.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c - N[(a / N[(4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot b\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 99.6%

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

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

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

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

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

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

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

    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. Step-by-step derivation
      1. associate-+l-0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval62.5%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in62.5%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in62.5%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*62.5%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative62.5%

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

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

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

      \[\leadsto \color{blue}{y \cdot x + -0.25 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. fma-def62.5%

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

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

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

Alternative 2: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right) \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (fma x y (fma (/ z 16.0) t (fma (/ a -4.0) b c))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return fma(x, y, fma((z / 16.0), t, fma((a / -4.0), b, c)));
}
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	return fma(x, y, fma(Float64(z / 16.0), t, fma(Float64(a / -4.0), b, c)))
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + N[(N[(z / 16.0), $MachinePrecision] * t + N[(N[(a / -4.0), $MachinePrecision] * b + c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(\frac{z}{16}, t, \mathsf{fma}\left(\frac{a}{-4}, b, c\right)\right)\right)
\end{array}
Derivation
  1. Initial program 96.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-96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.8% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(a \cdot b\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 99.6%

      \[\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. Step-by-step derivation
      1. associate-+l-0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval62.5%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in62.5%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in62.5%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*62.5%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative62.5%

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

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

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

      \[\leadsto \color{blue}{y \cdot x + -0.25 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. fma-def62.5%

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

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

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

Alternative 4: 67.2% accurate, 0.6× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+78}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-69}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-141}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-241}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* (* z t) 0.0625))))
   (if (<= (* a b) -1e+78)
     (- (* x y) (* (* a b) 0.25))
     (if (<= (* a b) -4e-69)
       (+ c (* x y))
       (if (<= (* a b) -2e-141)
         t_1
         (if (<= (* a b) -5e-241)
           (+ c (* t (* z 0.0625)))
           (if (<= (* a b) 1e+47) t_1 (+ c (* b (* a -0.25))))))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) + ((z * t) * 0.0625);
	double tmp;
	if ((a * b) <= -1e+78) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((a * b) <= -4e-69) {
		tmp = c + (x * y);
	} else if ((a * b) <= -2e-141) {
		tmp = t_1;
	} else if ((a * b) <= -5e-241) {
		tmp = c + (t * (z * 0.0625));
	} else if ((a * b) <= 1e+47) {
		tmp = t_1;
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + ((z * t) * 0.0625d0)
    if ((a * b) <= (-1d+78)) then
        tmp = (x * y) - ((a * b) * 0.25d0)
    else if ((a * b) <= (-4d-69)) then
        tmp = c + (x * y)
    else if ((a * b) <= (-2d-141)) then
        tmp = t_1
    else if ((a * b) <= (-5d-241)) then
        tmp = c + (t * (z * 0.0625d0))
    else if ((a * b) <= 1d+47) then
        tmp = t_1
    else
        tmp = c + (b * (a * (-0.25d0)))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) + ((z * t) * 0.0625);
	double tmp;
	if ((a * b) <= -1e+78) {
		tmp = (x * y) - ((a * b) * 0.25);
	} else if ((a * b) <= -4e-69) {
		tmp = c + (x * y);
	} else if ((a * b) <= -2e-141) {
		tmp = t_1;
	} else if ((a * b) <= -5e-241) {
		tmp = c + (t * (z * 0.0625));
	} else if ((a * b) <= 1e+47) {
		tmp = t_1;
	} else {
		tmp = c + (b * (a * -0.25));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) + ((z * t) * 0.0625)
	tmp = 0
	if (a * b) <= -1e+78:
		tmp = (x * y) - ((a * b) * 0.25)
	elif (a * b) <= -4e-69:
		tmp = c + (x * y)
	elif (a * b) <= -2e-141:
		tmp = t_1
	elif (a * b) <= -5e-241:
		tmp = c + (t * (z * 0.0625))
	elif (a * b) <= 1e+47:
		tmp = t_1
	else:
		tmp = c + (b * (a * -0.25))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625))
	tmp = 0.0
	if (Float64(a * b) <= -1e+78)
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	elseif (Float64(a * b) <= -4e-69)
		tmp = Float64(c + Float64(x * y));
	elseif (Float64(a * b) <= -2e-141)
		tmp = t_1;
	elseif (Float64(a * b) <= -5e-241)
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	elseif (Float64(a * b) <= 1e+47)
		tmp = t_1;
	else
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) + ((z * t) * 0.0625);
	tmp = 0.0;
	if ((a * b) <= -1e+78)
		tmp = (x * y) - ((a * b) * 0.25);
	elseif ((a * b) <= -4e-69)
		tmp = c + (x * y);
	elseif ((a * b) <= -2e-141)
		tmp = t_1;
	elseif ((a * b) <= -5e-241)
		tmp = c + (t * (z * 0.0625));
	elseif ((a * b) <= 1e+47)
		tmp = t_1;
	else
		tmp = c + (b * (a * -0.25));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+78], N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4e-69], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2e-141], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e-241], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], t$95$1, N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\

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

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

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

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

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


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

    1. Initial program 93.6%

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

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

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

    if -1.00000000000000001e78 < (*.f64 a b) < -3.9999999999999999e-69

    1. Initial program 96.2%

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

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

    if -3.9999999999999999e-69 < (*.f64 a b) < -2.0000000000000001e-141 or -4.9999999999999998e-241 < (*.f64 a b) < 1e47

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e-141 < (*.f64 a b) < -4.9999999999999998e-241

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

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

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

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

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

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

    if 1e47 < (*.f64 a b)

    1. Initial program 95.7%

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

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

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

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

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

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

Alternative 5: 84.6% accurate, 0.6× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+47}:\\ \;\;\;\;c + \left(x \cdot y + \left(z \cdot t\right) \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+99}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+134}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+198}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (- (* x y) (* (* a b) 0.25))))
   (if (<= (* a b) -5e+158)
     t_1
     (if (<= (* a b) 1e+47)
       (+ c (+ (* x y) (* (* z t) 0.0625)))
       (if (<= (* a b) 5e+99)
         (+ c (* b (* a -0.25)))
         (if (<= (* a b) 1e+134)
           (+ c (* x y))
           (if (<= (* a b) 5e+198) t_1 (* (* a b) -0.25))))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double tmp;
	if ((a * b) <= -5e+158) {
		tmp = t_1;
	} else if ((a * b) <= 1e+47) {
		tmp = c + ((x * y) + ((z * t) * 0.0625));
	} else if ((a * b) <= 5e+99) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+134) {
		tmp = c + (x * y);
	} else if ((a * b) <= 5e+198) {
		tmp = t_1;
	} else {
		tmp = (a * b) * -0.25;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) - ((a * b) * 0.25d0)
    if ((a * b) <= (-5d+158)) then
        tmp = t_1
    else if ((a * b) <= 1d+47) then
        tmp = c + ((x * y) + ((z * t) * 0.0625d0))
    else if ((a * b) <= 5d+99) then
        tmp = c + (b * (a * (-0.25d0)))
    else if ((a * b) <= 1d+134) then
        tmp = c + (x * y)
    else if ((a * b) <= 5d+198) then
        tmp = t_1
    else
        tmp = (a * b) * (-0.25d0)
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (x * y) - ((a * b) * 0.25);
	double tmp;
	if ((a * b) <= -5e+158) {
		tmp = t_1;
	} else if ((a * b) <= 1e+47) {
		tmp = c + ((x * y) + ((z * t) * 0.0625));
	} else if ((a * b) <= 5e+99) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+134) {
		tmp = c + (x * y);
	} else if ((a * b) <= 5e+198) {
		tmp = t_1;
	} else {
		tmp = (a * b) * -0.25;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (x * y) - ((a * b) * 0.25)
	tmp = 0
	if (a * b) <= -5e+158:
		tmp = t_1
	elif (a * b) <= 1e+47:
		tmp = c + ((x * y) + ((z * t) * 0.0625))
	elif (a * b) <= 5e+99:
		tmp = c + (b * (a * -0.25))
	elif (a * b) <= 1e+134:
		tmp = c + (x * y)
	elif (a * b) <= 5e+198:
		tmp = t_1
	else:
		tmp = (a * b) * -0.25
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25))
	tmp = 0.0
	if (Float64(a * b) <= -5e+158)
		tmp = t_1;
	elseif (Float64(a * b) <= 1e+47)
		tmp = Float64(c + Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625)));
	elseif (Float64(a * b) <= 5e+99)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (Float64(a * b) <= 1e+134)
		tmp = Float64(c + Float64(x * y));
	elseif (Float64(a * b) <= 5e+198)
		tmp = t_1;
	else
		tmp = Float64(Float64(a * b) * -0.25);
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (x * y) - ((a * b) * 0.25);
	tmp = 0.0;
	if ((a * b) <= -5e+158)
		tmp = t_1;
	elseif ((a * b) <= 1e+47)
		tmp = c + ((x * y) + ((z * t) * 0.0625));
	elseif ((a * b) <= 5e+99)
		tmp = c + (b * (a * -0.25));
	elseif ((a * b) <= 1e+134)
		tmp = c + (x * y);
	elseif ((a * b) <= 5e+198)
		tmp = t_1;
	else
		tmp = (a * b) * -0.25;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+158], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], N[(c + N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+99], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+198], t$95$1, N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := x \cdot y - \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\
\;\;\;\;t_1\\

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a b) < -4.9999999999999996e158 or 9.99999999999999921e133 < (*.f64 a b) < 5.00000000000000049e198

    1. Initial program 92.4%

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

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

    if -4.9999999999999996e158 < (*.f64 a b) < 1e47

    1. Initial program 98.2%

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

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

    if 1e47 < (*.f64 a b) < 5.00000000000000008e99

    1. Initial program 100.0%

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

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

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

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

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

    if 5.00000000000000008e99 < (*.f64 a b) < 9.99999999999999921e133

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

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

    if 5.00000000000000049e198 < (*.f64 a b)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval95.0%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in95.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in95.0%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*95.0%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative95.0%

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in a around inf 95.0%

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

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

Alternative 6: 85.5% accurate, 0.6× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ t_2 := \left(z \cdot t\right) \cdot 0.0625\\ \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\ \;\;\;\;x \cdot y - t_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+47}:\\ \;\;\;\;c + \left(x \cdot y + t_2\right)\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+99}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+134}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_2 - t_1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)) (t_2 (* (* z t) 0.0625)))
   (if (<= (* a b) -5e+158)
     (- (* x y) t_1)
     (if (<= (* a b) 1e+47)
       (+ c (+ (* x y) t_2))
       (if (<= (* a b) 5e+99)
         (+ c (* b (* a -0.25)))
         (if (<= (* a b) 1e+134) (+ c (* x y)) (- t_2 t_1)))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = (z * t) * 0.0625;
	double tmp;
	if ((a * b) <= -5e+158) {
		tmp = (x * y) - t_1;
	} else if ((a * b) <= 1e+47) {
		tmp = c + ((x * y) + t_2);
	} else if ((a * b) <= 5e+99) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+134) {
		tmp = c + (x * y);
	} else {
		tmp = t_2 - t_1;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 = (a * b) * 0.25d0
    t_2 = (z * t) * 0.0625d0
    if ((a * b) <= (-5d+158)) then
        tmp = (x * y) - t_1
    else if ((a * b) <= 1d+47) then
        tmp = c + ((x * y) + t_2)
    else if ((a * b) <= 5d+99) then
        tmp = c + (b * (a * (-0.25d0)))
    else if ((a * b) <= 1d+134) then
        tmp = c + (x * y)
    else
        tmp = t_2 - t_1
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double t_2 = (z * t) * 0.0625;
	double tmp;
	if ((a * b) <= -5e+158) {
		tmp = (x * y) - t_1;
	} else if ((a * b) <= 1e+47) {
		tmp = c + ((x * y) + t_2);
	} else if ((a * b) <= 5e+99) {
		tmp = c + (b * (a * -0.25));
	} else if ((a * b) <= 1e+134) {
		tmp = c + (x * y);
	} else {
		tmp = t_2 - t_1;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	t_2 = (z * t) * 0.0625
	tmp = 0
	if (a * b) <= -5e+158:
		tmp = (x * y) - t_1
	elif (a * b) <= 1e+47:
		tmp = c + ((x * y) + t_2)
	elif (a * b) <= 5e+99:
		tmp = c + (b * (a * -0.25))
	elif (a * b) <= 1e+134:
		tmp = c + (x * y)
	else:
		tmp = t_2 - t_1
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	t_2 = Float64(Float64(z * t) * 0.0625)
	tmp = 0.0
	if (Float64(a * b) <= -5e+158)
		tmp = Float64(Float64(x * y) - t_1);
	elseif (Float64(a * b) <= 1e+47)
		tmp = Float64(c + Float64(Float64(x * y) + t_2));
	elseif (Float64(a * b) <= 5e+99)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (Float64(a * b) <= 1e+134)
		tmp = Float64(c + Float64(x * y));
	else
		tmp = Float64(t_2 - t_1);
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	t_2 = (z * t) * 0.0625;
	tmp = 0.0;
	if ((a * b) <= -5e+158)
		tmp = (x * y) - t_1;
	elseif ((a * b) <= 1e+47)
		tmp = c + ((x * y) + t_2);
	elseif ((a * b) <= 5e+99)
		tmp = c + (b * (a * -0.25));
	elseif ((a * b) <= 1e+134)
		tmp = c + (x * y);
	else
		tmp = t_2 - t_1;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+158], N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+47], N[(c + N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+99], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+158}:\\
\;\;\;\;x \cdot y - t_1\\

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

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

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

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


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

    1. Initial program 91.1%

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

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

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

    if -4.9999999999999996e158 < (*.f64 a b) < 1e47

    1. Initial program 98.2%

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

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

    if 1e47 < (*.f64 a b) < 5.00000000000000008e99

    1. Initial program 100.0%

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

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

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

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

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

    if 5.00000000000000008e99 < (*.f64 a b) < 9.99999999999999921e133

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

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

    if 9.99999999999999921e133 < (*.f64 a b)

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

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

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

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

Alternative 7: 43.9% accurate, 0.7× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;a \cdot b \leq -5.6 \cdot 10^{+77}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-70}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-129}:\\ \;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\ \mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{-243}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 2.35 \cdot 10^{+55}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) -0.25)))
   (if (<= (* a b) -5.6e+77)
     t_1
     (if (<= (* a b) -2.3e-70)
       c
       (if (<= (* a b) -1e-129)
         (* (* z t) 0.0625)
         (if (<= (* a b) -2.9e-243)
           c
           (if (<= (* a b) 2.35e+55) (* x y) t_1)))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * -0.25;
	double tmp;
	if ((a * b) <= -5.6e+77) {
		tmp = t_1;
	} else if ((a * b) <= -2.3e-70) {
		tmp = c;
	} else if ((a * b) <= -1e-129) {
		tmp = (z * t) * 0.0625;
	} else if ((a * b) <= -2.9e-243) {
		tmp = c;
	} else if ((a * b) <= 2.35e+55) {
		tmp = x * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) * (-0.25d0)
    if ((a * b) <= (-5.6d+77)) then
        tmp = t_1
    else if ((a * b) <= (-2.3d-70)) then
        tmp = c
    else if ((a * b) <= (-1d-129)) then
        tmp = (z * t) * 0.0625d0
    else if ((a * b) <= (-2.9d-243)) then
        tmp = c
    else if ((a * b) <= 2.35d+55) then
        tmp = x * y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * -0.25;
	double tmp;
	if ((a * b) <= -5.6e+77) {
		tmp = t_1;
	} else if ((a * b) <= -2.3e-70) {
		tmp = c;
	} else if ((a * b) <= -1e-129) {
		tmp = (z * t) * 0.0625;
	} else if ((a * b) <= -2.9e-243) {
		tmp = c;
	} else if ((a * b) <= 2.35e+55) {
		tmp = x * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * -0.25
	tmp = 0
	if (a * b) <= -5.6e+77:
		tmp = t_1
	elif (a * b) <= -2.3e-70:
		tmp = c
	elif (a * b) <= -1e-129:
		tmp = (z * t) * 0.0625
	elif (a * b) <= -2.9e-243:
		tmp = c
	elif (a * b) <= 2.35e+55:
		tmp = x * y
	else:
		tmp = t_1
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * -0.25)
	tmp = 0.0
	if (Float64(a * b) <= -5.6e+77)
		tmp = t_1;
	elseif (Float64(a * b) <= -2.3e-70)
		tmp = c;
	elseif (Float64(a * b) <= -1e-129)
		tmp = Float64(Float64(z * t) * 0.0625);
	elseif (Float64(a * b) <= -2.9e-243)
		tmp = c;
	elseif (Float64(a * b) <= 2.35e+55)
		tmp = Float64(x * y);
	else
		tmp = t_1;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * -0.25;
	tmp = 0.0;
	if ((a * b) <= -5.6e+77)
		tmp = t_1;
	elseif ((a * b) <= -2.3e-70)
		tmp = c;
	elseif ((a * b) <= -1e-129)
		tmp = (z * t) * 0.0625;
	elseif ((a * b) <= -2.9e-243)
		tmp = c;
	elseif ((a * b) <= 2.35e+55)
		tmp = x * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5.6e+77], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.3e-70], c, If[LessEqual[N[(a * b), $MachinePrecision], -1e-129], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -2.9e-243], c, If[LessEqual[N[(a * b), $MachinePrecision], 2.35e+55], N[(x * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -5.6 \cdot 10^{+77}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-70}:\\
\;\;\;\;c\\

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

\mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{-243}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -5.60000000000000001e77 or 2.35e55 < (*.f64 a b)

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval85.7%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in85.7%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified85.7%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in a around inf 57.8%

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

    if -5.60000000000000001e77 < (*.f64 a b) < -2.30000000000000001e-70 or -9.9999999999999993e-130 < (*.f64 a b) < -2.89999999999999977e-243

    1. Initial program 97.7%

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

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

    if -2.30000000000000001e-70 < (*.f64 a b) < -9.9999999999999993e-130

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

      \[\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 t around inf 57.6%

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

    if -2.89999999999999977e-243 < (*.f64 a b) < 2.35e55

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval70.3%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in70.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*70.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified70.3%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in x around inf 43.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5.6 \cdot 10^{+77}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-70}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-129}:\\ \;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\ \mathbf{elif}\;a \cdot b \leq -2.9 \cdot 10^{-243}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 2.35 \cdot 10^{+55}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \end{array} \]

Alternative 8: 60.9% accurate, 0.9× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := \left(z \cdot t\right) \cdot 0.0625\\ \mathbf{if}\;t \leq -0.145:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-287}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-123}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+250}:\\ \;\;\;\;x \cdot y + t_2\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))) (t_2 (* (* z t) 0.0625)))
   (if (<= t -0.145)
     t_2
     (if (<= t -8e-287)
       t_1
       (if (<= t 2.9e-123)
         (+ c (* b (* a -0.25)))
         (if (<= t 1.35e+90)
           t_1
           (if (<= t 5.2e+250) (+ (* x y) t_2) (+ c (* t (* z 0.0625))))))))))
assert(z < t);
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 = (z * t) * 0.0625;
	double tmp;
	if (t <= -0.145) {
		tmp = t_2;
	} else if (t <= -8e-287) {
		tmp = t_1;
	} else if (t <= 2.9e-123) {
		tmp = c + (b * (a * -0.25));
	} else if (t <= 1.35e+90) {
		tmp = t_1;
	} else if (t <= 5.2e+250) {
		tmp = (x * y) + t_2;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 = (z * t) * 0.0625d0
    if (t <= (-0.145d0)) then
        tmp = t_2
    else if (t <= (-8d-287)) then
        tmp = t_1
    else if (t <= 2.9d-123) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (t <= 1.35d+90) then
        tmp = t_1
    else if (t <= 5.2d+250) then
        tmp = (x * y) + t_2
    else
        tmp = c + (t * (z * 0.0625d0))
    end if
    code = tmp
end function
assert z < t;
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 = (z * t) * 0.0625;
	double tmp;
	if (t <= -0.145) {
		tmp = t_2;
	} else if (t <= -8e-287) {
		tmp = t_1;
	} else if (t <= 2.9e-123) {
		tmp = c + (b * (a * -0.25));
	} else if (t <= 1.35e+90) {
		tmp = t_1;
	} else if (t <= 5.2e+250) {
		tmp = (x * y) + t_2;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = (z * t) * 0.0625
	tmp = 0
	if t <= -0.145:
		tmp = t_2
	elif t <= -8e-287:
		tmp = t_1
	elif t <= 2.9e-123:
		tmp = c + (b * (a * -0.25))
	elif t <= 1.35e+90:
		tmp = t_1
	elif t <= 5.2e+250:
		tmp = (x * y) + t_2
	else:
		tmp = c + (t * (z * 0.0625))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(Float64(z * t) * 0.0625)
	tmp = 0.0
	if (t <= -0.145)
		tmp = t_2;
	elseif (t <= -8e-287)
		tmp = t_1;
	elseif (t <= 2.9e-123)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (t <= 1.35e+90)
		tmp = t_1;
	elseif (t <= 5.2e+250)
		tmp = Float64(Float64(x * y) + t_2);
	else
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = (z * t) * 0.0625;
	tmp = 0.0;
	if (t <= -0.145)
		tmp = t_2;
	elseif (t <= -8e-287)
		tmp = t_1;
	elseif (t <= 2.9e-123)
		tmp = c + (b * (a * -0.25));
	elseif (t <= 1.35e+90)
		tmp = t_1;
	elseif (t <= 5.2e+250)
		tmp = (x * y) + t_2;
	else
		tmp = c + (t * (z * 0.0625));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
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[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]}, If[LessEqual[t, -0.145], t$95$2, If[LessEqual[t, -8e-287], t$95$1, If[LessEqual[t, 2.9e-123], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+90], t$95$1, If[LessEqual[t, 5.2e+250], N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
t_2 := \left(z \cdot t\right) \cdot 0.0625\\
\mathbf{if}\;t \leq -0.145:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -8 \cdot 10^{-287}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{+250}:\\
\;\;\;\;x \cdot y + t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -0.14499999999999999

    1. Initial program 96.7%

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

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

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

    if -0.14499999999999999 < t < -8.00000000000000017e-287 or 2.90000000000000004e-123 < t < 1.35e90

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

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

    if -8.00000000000000017e-287 < t < 2.90000000000000004e-123

    1. Initial program 98.2%

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

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

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

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

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

    if 1.35e90 < t < 5.20000000000000023e250

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000023e250 < t

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.145:\\ \;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\ \mathbf{elif}\;t \leq -8 \cdot 10^{-287}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{-123}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+90}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+250}:\\ \;\;\;\;x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]

Alternative 9: 87.9% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.9999999999999993e-41 or 1e8 < (*.f64 a b)

    1. Initial program 94.8%

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

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

    if -9.9999999999999993e-41 < (*.f64 a b) < 1e8

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

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

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

Alternative 10: 43.8% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-253}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+53}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) -0.25)))
   (if (<= (* a b) -9.5e+74)
     t_1
     (if (<= (* a b) -8.2e-253) c (if (<= (* a b) 5.2e+53) (* x y) t_1)))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * -0.25;
	double tmp;
	if ((a * b) <= -9.5e+74) {
		tmp = t_1;
	} else if ((a * b) <= -8.2e-253) {
		tmp = c;
	} else if ((a * b) <= 5.2e+53) {
		tmp = x * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) * (-0.25d0)
    if ((a * b) <= (-9.5d+74)) then
        tmp = t_1
    else if ((a * b) <= (-8.2d-253)) then
        tmp = c
    else if ((a * b) <= 5.2d+53) then
        tmp = x * y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * -0.25;
	double tmp;
	if ((a * b) <= -9.5e+74) {
		tmp = t_1;
	} else if ((a * b) <= -8.2e-253) {
		tmp = c;
	} else if ((a * b) <= 5.2e+53) {
		tmp = x * y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * -0.25
	tmp = 0
	if (a * b) <= -9.5e+74:
		tmp = t_1
	elif (a * b) <= -8.2e-253:
		tmp = c
	elif (a * b) <= 5.2e+53:
		tmp = x * y
	else:
		tmp = t_1
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * -0.25)
	tmp = 0.0
	if (Float64(a * b) <= -9.5e+74)
		tmp = t_1;
	elseif (Float64(a * b) <= -8.2e-253)
		tmp = c;
	elseif (Float64(a * b) <= 5.2e+53)
		tmp = Float64(x * y);
	else
		tmp = t_1;
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * -0.25;
	tmp = 0.0;
	if ((a * b) <= -9.5e+74)
		tmp = t_1;
	elseif ((a * b) <= -8.2e-253)
		tmp = c;
	elseif ((a * b) <= 5.2e+53)
		tmp = x * y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -9.5e+74], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -8.2e-253], c, If[LessEqual[N[(a * b), $MachinePrecision], 5.2e+53], N[(x * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot -0.25\\
\mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+74}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-253}:\\
\;\;\;\;c\\

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

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval85.7%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in85.7%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef85.7%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified85.7%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in a around inf 57.8%

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

    if -9.5000000000000006e74 < (*.f64 a b) < -8.20000000000000004e-253

    1. Initial program 98.2%

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

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

    if -8.20000000000000004e-253 < (*.f64 a b) < 5.19999999999999996e53

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval70.3%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in70.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*70.3%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef70.3%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified70.3%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in x around inf 43.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+74}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;a \cdot b \leq -8.2 \cdot 10^{-253}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 5.2 \cdot 10^{+53}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \end{array} \]

Alternative 11: 83.7% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot 0.25\\ \mathbf{if}\;x \leq -4.3 \cdot 10^{+48} \lor \neg \left(x \leq 2.45 \cdot 10^{-95}\right):\\ \;\;\;\;\left(c + x \cdot y\right) - t_1\\ \mathbf{else}:\\ \;\;\;\;\left(c + \left(z \cdot t\right) \cdot 0.0625\right) - t_1\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) 0.25)))
   (if (or (<= x -4.3e+48) (not (<= x 2.45e-95)))
     (- (+ c (* x y)) t_1)
     (- (+ c (* (* z t) 0.0625)) t_1))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double tmp;
	if ((x <= -4.3e+48) || !(x <= 2.45e-95)) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = (c + ((z * t) * 0.0625)) - t_1;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (a * b) * 0.25d0
    if ((x <= (-4.3d+48)) .or. (.not. (x <= 2.45d-95))) then
        tmp = (c + (x * y)) - t_1
    else
        tmp = (c + ((z * t) * 0.0625d0)) - t_1
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * 0.25;
	double tmp;
	if ((x <= -4.3e+48) || !(x <= 2.45e-95)) {
		tmp = (c + (x * y)) - t_1;
	} else {
		tmp = (c + ((z * t) * 0.0625)) - t_1;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * 0.25
	tmp = 0
	if (x <= -4.3e+48) or not (x <= 2.45e-95):
		tmp = (c + (x * y)) - t_1
	else:
		tmp = (c + ((z * t) * 0.0625)) - t_1
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * 0.25)
	tmp = 0.0
	if ((x <= -4.3e+48) || !(x <= 2.45e-95))
		tmp = Float64(Float64(c + Float64(x * y)) - t_1);
	else
		tmp = Float64(Float64(c + Float64(Float64(z * t) * 0.0625)) - t_1);
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * 0.25;
	tmp = 0.0;
	if ((x <= -4.3e+48) || ~((x <= 2.45e-95)))
		tmp = (c + (x * y)) - t_1;
	else
		tmp = (c + ((z * t) * 0.0625)) - t_1;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]}, If[Or[LessEqual[x, -4.3e+48], N[Not[LessEqual[x, 2.45e-95]], $MachinePrecision]], N[(N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(c + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot b\right) \cdot 0.25\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{+48} \lor \neg \left(x \leq 2.45 \cdot 10^{-95}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.29999999999999978e48 or 2.45e-95 < x

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

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

    if -4.29999999999999978e48 < x < 2.45e-95

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

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

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

Alternative 12: 97.7% accurate, 1.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right) \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (+ c (- (+ (/ (* z t) 16.0) (* x y)) (/ (* a b) 4.0))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c + ((((z * t) / 16.0d0) + (x * y)) - ((a * b) / 4.0d0))
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	return c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0))
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	return Float64(c + Float64(Float64(Float64(Float64(z * t) / 16.0) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)))
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a, b, c)
	tmp = c + ((((z * t) / 16.0) + (x * y)) - ((a * b) / 4.0));
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := N[(c + N[(N[(N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
c + \left(\left(\frac{z \cdot t}{16} + x \cdot y\right) - \frac{a \cdot b}{4}\right)
\end{array}
Derivation
  1. Initial program 96.5%

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

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

Alternative 13: 60.0% accurate, 1.1× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} t_1 := c + x \cdot y\\ \mathbf{if}\;t \leq -0.14:\\ \;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-287}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{-122}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))))
   (if (<= t -0.14)
     (* (* z t) 0.0625)
     (if (<= t -9.5e-287)
       t_1
       (if (<= t 1.08e-122)
         (+ c (* b (* a -0.25)))
         (if (<= t 6e+83) t_1 (+ c (* t (* z 0.0625)))))))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double tmp;
	if (t <= -0.14) {
		tmp = (z * t) * 0.0625;
	} else if (t <= -9.5e-287) {
		tmp = t_1;
	} else if (t <= 1.08e-122) {
		tmp = c + (b * (a * -0.25));
	} else if (t <= 6e+83) {
		tmp = t_1;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = c + (x * y)
    if (t <= (-0.14d0)) then
        tmp = (z * t) * 0.0625d0
    else if (t <= (-9.5d-287)) then
        tmp = t_1
    else if (t <= 1.08d-122) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (t <= 6d+83) then
        tmp = t_1
    else
        tmp = c + (t * (z * 0.0625d0))
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double tmp;
	if (t <= -0.14) {
		tmp = (z * t) * 0.0625;
	} else if (t <= -9.5e-287) {
		tmp = t_1;
	} else if (t <= 1.08e-122) {
		tmp = c + (b * (a * -0.25));
	} else if (t <= 6e+83) {
		tmp = t_1;
	} else {
		tmp = c + (t * (z * 0.0625));
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	tmp = 0
	if t <= -0.14:
		tmp = (z * t) * 0.0625
	elif t <= -9.5e-287:
		tmp = t_1
	elif t <= 1.08e-122:
		tmp = c + (b * (a * -0.25))
	elif t <= 6e+83:
		tmp = t_1
	else:
		tmp = c + (t * (z * 0.0625))
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (t <= -0.14)
		tmp = Float64(Float64(z * t) * 0.0625);
	elseif (t <= -9.5e-287)
		tmp = t_1;
	elseif (t <= 1.08e-122)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (t <= 6e+83)
		tmp = t_1;
	else
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	tmp = 0.0;
	if (t <= -0.14)
		tmp = (z * t) * 0.0625;
	elseif (t <= -9.5e-287)
		tmp = t_1;
	elseif (t <= 1.08e-122)
		tmp = c + (b * (a * -0.25));
	elseif (t <= 6e+83)
		tmp = t_1;
	else
		tmp = c + (t * (z * 0.0625));
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -0.14], N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[t, -9.5e-287], t$95$1, If[LessEqual[t, 1.08e-122], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e+83], t$95$1, N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
t_1 := c + x \cdot y\\
\mathbf{if}\;t \leq -0.14:\\
\;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\

\mathbf{elif}\;t \leq -9.5 \cdot 10^{-287}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -0.14000000000000001

    1. Initial program 96.7%

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

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

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

    if -0.14000000000000001 < t < -9.5000000000000004e-287 or 1.08e-122 < t < 5.9999999999999999e83

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

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

    if -9.5000000000000004e-287 < t < 1.08e-122

    1. Initial program 98.2%

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

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

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

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

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

    if 5.9999999999999999e83 < t

    1. Initial program 85.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.14:\\ \;\;\;\;\left(z \cdot t\right) \cdot 0.0625\\ \mathbf{elif}\;t \leq -9.5 \cdot 10^{-287}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;t \leq 1.08 \cdot 10^{-122}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;t \leq 6 \cdot 10^{+83}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]

Alternative 14: 63.1% accurate, 1.3× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.46 \cdot 10^{+181} \lor \neg \left(a \cdot b \leq 2.9 \cdot 10^{+138}\right):\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (or (<= (* a b) -1.46e+181) (not (<= (* a b) 2.9e+138)))
   (* (* a b) -0.25)
   (+ c (* x y))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((a * b) <= -1.46e+181) || !((a * b) <= 2.9e+138)) {
		tmp = (a * b) * -0.25;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (((a * b) <= (-1.46d+181)) .or. (.not. ((a * b) <= 2.9d+138))) then
        tmp = (a * b) * (-0.25d0)
    else
        tmp = c + (x * y)
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((a * b) <= -1.46e+181) || !((a * b) <= 2.9e+138)) {
		tmp = (a * b) * -0.25;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((a * b) <= -1.46e+181) or not ((a * b) <= 2.9e+138):
		tmp = (a * b) * -0.25
	else:
		tmp = c + (x * y)
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(a * b) <= -1.46e+181) || !(Float64(a * b) <= 2.9e+138))
		tmp = Float64(Float64(a * b) * -0.25);
	else
		tmp = Float64(c + Float64(x * y));
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (((a * b) <= -1.46e+181) || ~(((a * b) <= 2.9e+138)))
		tmp = (a * b) * -0.25;
	else
		tmp = c + (x * y);
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.46e+181], N[Not[LessEqual[N[(a * b), $MachinePrecision], 2.9e+138]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -1.46 \cdot 10^{+181} \lor \neg \left(a \cdot b \leq 2.9 \cdot 10^{+138}\right):\\
\;\;\;\;\left(a \cdot b\right) \cdot -0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.46000000000000008e181 or 2.9000000000000001e138 < (*.f64 a b)

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval86.1%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in86.1%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in86.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval86.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*86.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative86.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef86.1%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified86.1%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in a around inf 75.2%

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

    if -1.46000000000000008e181 < (*.f64 a b) < 2.9000000000000001e138

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.46 \cdot 10^{+181} \lor \neg \left(a \cdot b \leq 2.9 \cdot 10^{+138}\right):\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 15: 37.5% accurate, 2.4× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{+45}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-34}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= x -4.6e+45) (* x y) (if (<= x 2.8e-34) c (* x y))))
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (x <= -4.6e+45) {
		tmp = x * y;
	} else if (x <= 2.8e-34) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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 <= (-4.6d+45)) then
        tmp = x * y
    else if (x <= 2.8d-34) then
        tmp = c
    else
        tmp = x * y
    end if
    code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (x <= -4.6e+45) {
		tmp = x * y;
	} else if (x <= 2.8e-34) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	tmp = 0
	if x <= -4.6e+45:
		tmp = x * y
	elif x <= 2.8e-34:
		tmp = c
	else:
		tmp = x * y
	return tmp
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (x <= -4.6e+45)
		tmp = Float64(x * y);
	elseif (x <= 2.8e-34)
		tmp = c;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if (x <= -4.6e+45)
		tmp = x * y;
	elseif (x <= 2.8e-34)
		tmp = c;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[x, -4.6e+45], N[(x * y), $MachinePrecision], If[LessEqual[x, 2.8e-34], c, N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+45}:\\
\;\;\;\;x \cdot y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.60000000000000025e45 or 2.79999999999999997e-34 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{c + -0.25 \cdot \left(a \cdot b\right)}\right) \]
    5. Step-by-step derivation
      1. metadata-eval84.4%

        \[\leadsto \mathsf{fma}\left(x, y, c + \color{blue}{\left(-0.25\right)} \cdot \left(a \cdot b\right)\right) \]
      2. distribute-lft-neg-in84.4%

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

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot \left(a \cdot b\right)\right) + c}\right) \]
      4. distribute-lft-neg-in84.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25\right) \cdot \left(a \cdot b\right)} + c\right) \]
      5. metadata-eval84.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{-0.25} \cdot \left(a \cdot b\right) + c\right) \]
      6. associate-*r*84.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + c\right) \]
      7. *-commutative84.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\left(a \cdot -0.25\right)} \cdot b + c\right) \]
      8. fma-udef84.4%

        \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    6. Simplified84.4%

      \[\leadsto \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, c\right)}\right) \]
    7. Taylor expanded in x around inf 48.5%

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

    if -4.60000000000000025e45 < x < 2.79999999999999997e-34

    1. Initial program 98.6%

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

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

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

Alternative 16: 22.4% accurate, 17.0× speedup?

\[\begin{array}{l} [z, t] = \mathsf{sort}([z, t])\\ \\ c \end{array} \]
NOTE: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c) :precision binary64 c)
assert(z < t);
double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
NOTE: z and t should be sorted in increasing order before calling this function.
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
assert z < t;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return c;
}
[z, t] = sort([z, t])
def code(x, y, z, t, a, b, c):
	return c
z, t = sort([z, t])
function code(x, y, z, t, a, b, c)
	return c
end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t, a, b, c)
	tmp = c;
end
NOTE: z and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := c
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
c
\end{array}
Derivation
  1. Initial program 96.5%

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

    \[\leadsto \color{blue}{c} \]
  3. Final simplification23.7%

    \[\leadsto c \]

Reproduce

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