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

Percentage Accurate: 97.5% → 98.8%
Time: 8.2s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 97.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Derivation
  1. Initial program 98.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-98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 44.3% accurate, 0.7× speedup?

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -1.08000000000000002e102 or 8.80000000000000001e191 < (*.f64 a b)

    1. Initial program 93.5%

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

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

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

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

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

    if -1.08000000000000002e102 < (*.f64 a b) < -8.50000000000000023e-195 or 2.2500000000000001e-184 < (*.f64 a b) < 8.80000000000000001e191

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -8.50000000000000023e-195 < (*.f64 a b) < -8.20000000000000087e-292

    1. Initial program 100.0%

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

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

    if -8.20000000000000087e-292 < (*.f64 a b) < 2.2500000000000001e-184

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1.08 \cdot 10^{+102}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -8.5 \cdot 10^{-195}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq -8.2 \cdot 10^{-292}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq 2.25 \cdot 10^{-184}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 8.8 \cdot 10^{+191}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 3: 66.5% accurate, 0.7× speedup?

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

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

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

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

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

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


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

    1. Initial program 95.2%

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

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

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

    if -2.8000000000000001e98 < (*.f64 a b) < -2.49999999999999999e-56 or 5.99999999999999982e-184 < (*.f64 a b) < 1.79999999999999998e31

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

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

    if -2.49999999999999999e-56 < (*.f64 a b) < 5.99999999999999982e-184

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -2.8 \cdot 10^{+98}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \mathbf{elif}\;b \cdot a \leq -2.5 \cdot 10^{-56}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;b \cdot a \leq 6 \cdot 10^{-184}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 1.8 \cdot 10^{+31}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\ \end{array} \]

Alternative 4: 61.5% accurate, 0.8× speedup?

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

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

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

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

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

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


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

    1. Initial program 93.2%

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

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

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

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

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

    if -8.4999999999999998e143 < (*.f64 a b) < 3.10000000000000018e-177 or 5.5000000000000004e-87 < (*.f64 a b) < 2.2999999999999999e180

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

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

    if 3.10000000000000018e-177 < (*.f64 a b) < 5.5000000000000004e-87

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -8.5 \cdot 10^{+143}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq 3.1 \cdot 10^{-177}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-87}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;b \cdot a \leq 2.3 \cdot 10^{+180}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 5: 63.2% accurate, 0.9× speedup?

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

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

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

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

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


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

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

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

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

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

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

    if -7.80000000000000022e152 < (*.f64 a b) < 1.19999999999999996e-183

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

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

    if 1.19999999999999996e-183 < (*.f64 a b) < 8.9999999999999997e194

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

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

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

Alternative 6: 63.9% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -9.4000000000000006e147

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

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

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

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

    if -9.4000000000000006e147 < (*.f64 a b) < 5.5000000000000003e-179

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

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

    if 5.5000000000000003e-179 < (*.f64 a b) < 6.2999999999999999e199

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

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

    if 6.2999999999999999e199 < (*.f64 a b)

    1. Initial program 93.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -9.4 \cdot 10^{+147}:\\ \;\;\;\;c + \left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq 5.5 \cdot 10^{-179}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 6.3 \cdot 10^{+199}:\\ \;\;\;\;c + 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 7: 86.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1.05 \cdot 10^{+104} \lor \neg \left(b \cdot a \leq 2.3 \cdot 10^{+198}\right):\\
\;\;\;\;x \cdot y - \left(b \cdot a\right) \cdot 0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.0499999999999999e104 or 2.3000000000000001e198 < (*.f64 a b)

    1. Initial program 93.5%

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

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

    if -1.0499999999999999e104 < (*.f64 a b) < 2.3000000000000001e198

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

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

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

Alternative 8: 87.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 93.5%

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

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

    if -2.30000000000000019e99 < (*.f64 a b) < 6.80000000000000018e191

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

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

    if 6.80000000000000018e191 < (*.f64 a b)

    1. Initial program 93.5%

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

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

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

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

Alternative 9: 38.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(z \cdot 0.0625\right)\\
\mathbf{if}\;y \leq -3.15 \cdot 10^{-83}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-268}:\\
\;\;\;\;c\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+105}:\\
\;\;\;\;c\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+131}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.14999999999999983e-83 or 4.7999999999999999e131 < y

    1. Initial program 97.5%

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

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

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

    if -3.14999999999999983e-83 < y < -9.4999999999999997e-285 or 1.35e-268 < y < 2.5000000000000001e70 or 6.50000000000000049e105 < y < 4.7999999999999999e131

    1. Initial program 99.1%

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

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

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

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

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

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

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

    if -9.4999999999999997e-285 < y < 1.35e-268 or 2.5000000000000001e70 < y < 6.50000000000000049e105

    1. Initial program 94.4%

      \[\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} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.15 \cdot 10^{-83}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-285}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-268}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+70}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+105}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+131}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 10: 97.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 11: 34.6% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;y \leq 6.8 \cdot 10^{+114}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.79999999999999995e-158 or 6.8000000000000001e114 < y

    1. Initial program 97.3%

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

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

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

    if -1.79999999999999995e-158 < y < 6.8000000000000001e114

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{-158}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{+114}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 12: 22.0% accurate, 17.0× speedup?

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

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

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

    \[\leadsto \color{blue}{c} \]
  3. Final simplification18.9%

    \[\leadsto c \]

Reproduce

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