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

Percentage Accurate: 97.8% → 98.9%
Time: 8.8s
Alternatives: 15
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 15 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(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.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-98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 67.1% accurate, 0.7× speedup?

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

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

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

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

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+116}:\\
\;\;\;\;c + t \cdot \frac{z}{16}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -2.0000000000000002e54 or 2.00000000000000003e116 < (*.f64 a b)

    1. Initial program 97.0%

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

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

    if -2.0000000000000002e54 < (*.f64 a b) < -4

    1. Initial program 100.0%

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

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

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

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

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

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

    if -4 < (*.f64 a b) < 5.0000000000000002e-85

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

      \[\leadsto \color{blue}{\left(y \cdot x + 0.0625 \cdot \left(t \cdot z\right)\right)} + c \]
    3. Taylor expanded in c around 0 76.9%

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

    if 5.0000000000000002e-85 < (*.f64 a b) < 2.00000000000000003e116

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. metadata-eval76.1%

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/76.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/76.0%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative76.0%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity76.0%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/76.1%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified76.1%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.9%

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

Alternative 3: 89.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;b \cdot a \leq -4 \lor \neg \left(b \cdot a \leq 5 \cdot 10^{+102}\right):\\
\;\;\;\;\left(c + x \cdot y\right) - t_2\\

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


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

    1. Initial program 96.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 92.3%

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

    if -5.0000000000000002e151 < (*.f64 a b) < -4 or 5e102 < (*.f64 a b)

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

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

    if -4 < (*.f64 a b) < 5e102

    1. Initial program 99.3%

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

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

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

Alternative 4: 59.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + b \cdot \left(a \cdot -0.25\right)\\ t_2 := c + x \cdot y\\ \mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-301}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+36}:\\ \;\;\;\;c + t \cdot \frac{z}{16}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+60} \lor \neg \left(y \leq 5.9 \cdot 10^{+125}\right) \land y \leq 7.8 \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 (* b (* a -0.25)))) (t_2 (+ c (* x y))))
   (if (<= y -2.1e-29)
     t_2
     (if (<= y -2.1e-301)
       t_1
       (if (<= y 5.1e+36)
         (+ c (* t (/ z 16.0)))
         (if (or (<= y 2.9e+60) (and (not (<= y 5.9e+125)) (<= y 7.8e+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 + (b * (a * -0.25));
	double t_2 = c + (x * y);
	double tmp;
	if (y <= -2.1e-29) {
		tmp = t_2;
	} else if (y <= -2.1e-301) {
		tmp = t_1;
	} else if (y <= 5.1e+36) {
		tmp = c + (t * (z / 16.0));
	} else if ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+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 + (b * (a * (-0.25d0)))
    t_2 = c + (x * y)
    if (y <= (-2.1d-29)) then
        tmp = t_2
    else if (y <= (-2.1d-301)) then
        tmp = t_1
    else if (y <= 5.1d+36) then
        tmp = c + (t * (z / 16.0d0))
    else if ((y <= 2.9d+60) .or. (.not. (y <= 5.9d+125)) .and. (y <= 7.8d+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 + (b * (a * -0.25));
	double t_2 = c + (x * y);
	double tmp;
	if (y <= -2.1e-29) {
		tmp = t_2;
	} else if (y <= -2.1e-301) {
		tmp = t_1;
	} else if (y <= 5.1e+36) {
		tmp = c + (t * (z / 16.0));
	} else if ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+180))) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (b * (a * -0.25))
	t_2 = c + (x * y)
	tmp = 0
	if y <= -2.1e-29:
		tmp = t_2
	elif y <= -2.1e-301:
		tmp = t_1
	elif y <= 5.1e+36:
		tmp = c + (t * (z / 16.0))
	elif (y <= 2.9e+60) or (not (y <= 5.9e+125) and (y <= 7.8e+180)):
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(b * Float64(a * -0.25)))
	t_2 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (y <= -2.1e-29)
		tmp = t_2;
	elseif (y <= -2.1e-301)
		tmp = t_1;
	elseif (y <= 5.1e+36)
		tmp = Float64(c + Float64(t * Float64(z / 16.0)));
	elseif ((y <= 2.9e+60) || (!(y <= 5.9e+125) && (y <= 7.8e+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 + (b * (a * -0.25));
	t_2 = c + (x * y);
	tmp = 0.0;
	if (y <= -2.1e-29)
		tmp = t_2;
	elseif (y <= -2.1e-301)
		tmp = t_1;
	elseif (y <= 5.1e+36)
		tmp = c + (t * (z / 16.0));
	elseif ((y <= 2.9e+60) || (~((y <= 5.9e+125)) && (y <= 7.8e+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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-29], t$95$2, If[LessEqual[y, -2.1e-301], t$95$1, If[LessEqual[y, 5.1e+36], N[(c + N[(t * N[(z / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 2.9e+60], And[N[Not[LessEqual[y, 5.9e+125]], $MachinePrecision], LessEqual[y, 7.8e+180]]], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.1 \cdot 10^{-301}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{+36}:\\
\;\;\;\;c + t \cdot \frac{z}{16}\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+60} \lor \neg \left(y \leq 5.9 \cdot 10^{+125}\right) \land y \leq 7.8 \cdot 10^{+180}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.09999999999999989e-29 or 2.9e60 < y < 5.9000000000000001e125 or 7.8000000000000002e180 < y

    1. Initial program 97.1%

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

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

    if -2.09999999999999989e-29 < y < -2.0999999999999999e-301 or 5.09999999999999973e36 < y < 2.9e60 or 5.9000000000000001e125 < y < 7.8000000000000002e180

    1. Initial program 98.7%

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

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

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

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

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

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

    if -2.0999999999999999e-301 < y < 5.09999999999999973e36

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

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

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. metadata-eval66.7%

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/66.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/66.6%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative66.6%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity66.6%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/66.7%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified66.7%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-29}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-301}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+36}:\\ \;\;\;\;c + t \cdot \frac{z}{16}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+60} \lor \neg \left(y \leq 5.9 \cdot 10^{+125}\right) \land y \leq 7.8 \cdot 10^{+180}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 5: 87.4% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1e176 or 2.00000000000000003e116 < (*.f64 a b)

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

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

    if -1e176 < (*.f64 a b) < 2.00000000000000003e116

    1. Initial program 99.4%

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

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

Alternative 6: 89.4% accurate, 0.9× speedup?

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

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

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


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

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

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

    if -4 < (*.f64 a b) < 5e102

    1. Initial program 99.3%

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

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

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

Alternative 7: 87.4% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{+116}:\\
\;\;\;\;c + \left(t_2 + x \cdot y\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.0000000000000001e167

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

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

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

    if -2.0000000000000001e167 < (*.f64 a b) < 2.00000000000000003e116

    1. Initial program 99.4%

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

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

    if 2.00000000000000003e116 < (*.f64 a b)

    1. Initial program 96.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 100.0%

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

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

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

Alternative 8: 36.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;y \leq -6.5 \cdot 10^{-139}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-288}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+36}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+57} \lor \neg \left(y \leq 3.9 \cdot 10^{+127}\right) \land y \leq 4.8 \cdot 10^{+181}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))))
   (if (<= y -6.5e-139)
     (* x y)
     (if (<= y -5e-288)
       t_1
       (if (<= y 2.15e+36)
         (* 0.0625 (* t z))
         (if (or (<= y 1.5e+57) (and (not (<= y 3.9e+127)) (<= y 4.8e+181)))
           t_1
           (* x y)))))))
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 (y <= -6.5e-139) {
		tmp = x * y;
	} else if (y <= -5e-288) {
		tmp = t_1;
	} else if (y <= 2.15e+36) {
		tmp = 0.0625 * (t * z);
	} else if ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181))) {
		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 = b * (a * (-0.25d0))
    if (y <= (-6.5d-139)) then
        tmp = x * y
    else if (y <= (-5d-288)) then
        tmp = t_1
    else if (y <= 2.15d+36) then
        tmp = 0.0625d0 * (t * z)
    else if ((y <= 1.5d+57) .or. (.not. (y <= 3.9d+127)) .and. (y <= 4.8d+181)) 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 = b * (a * -0.25);
	double tmp;
	if (y <= -6.5e-139) {
		tmp = x * y;
	} else if (y <= -5e-288) {
		tmp = t_1;
	} else if (y <= 2.15e+36) {
		tmp = 0.0625 * (t * z);
	} else if ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181))) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	tmp = 0
	if y <= -6.5e-139:
		tmp = x * y
	elif y <= -5e-288:
		tmp = t_1
	elif y <= 2.15e+36:
		tmp = 0.0625 * (t * z)
	elif (y <= 1.5e+57) or (not (y <= 3.9e+127) and (y <= 4.8e+181)):
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	tmp = 0.0
	if (y <= -6.5e-139)
		tmp = Float64(x * y);
	elseif (y <= -5e-288)
		tmp = t_1;
	elseif (y <= 2.15e+36)
		tmp = Float64(0.0625 * Float64(t * z));
	elseif ((y <= 1.5e+57) || (!(y <= 3.9e+127) && (y <= 4.8e+181)))
		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 = b * (a * -0.25);
	tmp = 0.0;
	if (y <= -6.5e-139)
		tmp = x * y;
	elseif (y <= -5e-288)
		tmp = t_1;
	elseif (y <= 2.15e+36)
		tmp = 0.0625 * (t * z);
	elseif ((y <= 1.5e+57) || (~((y <= 3.9e+127)) && (y <= 4.8e+181)))
		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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e-139], N[(x * y), $MachinePrecision], If[LessEqual[y, -5e-288], t$95$1, If[LessEqual[y, 2.15e+36], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.5e+57], And[N[Not[LessEqual[y, 3.9e+127]], $MachinePrecision], LessEqual[y, 4.8e+181]]], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -5 \cdot 10^{-288}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.15 \cdot 10^{+36}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+57} \lor \neg \left(y \leq 3.9 \cdot 10^{+127}\right) \land y \leq 4.8 \cdot 10^{+181}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.5e-139 or 1.5e57 < y < 3.89999999999999981e127 or 4.80000000000000004e181 < y

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

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

    if -6.5e-139 < y < -5.00000000000000011e-288 or 2.15000000000000002e36 < y < 1.5e57 or 3.89999999999999981e127 < y < 4.80000000000000004e181

    1. Initial program 98.3%

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

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

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

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

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

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

    if -5.00000000000000011e-288 < y < 2.15000000000000002e36

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

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

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. metadata-eval68.5%

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/68.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/68.4%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative68.4%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity68.4%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/68.5%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified68.5%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    5. Taylor expanded in z around inf 47.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.5 \cdot 10^{-139}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-288}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 2.15 \cdot 10^{+36}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+57} \lor \neg \left(y \leq 3.9 \cdot 10^{+127}\right) \land y \leq 4.8 \cdot 10^{+181}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 9: 97.8% 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.4%

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

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

Alternative 10: 52.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;a \leq -5.7 \cdot 10^{+156}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-239}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-124}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+27}:\\ \;\;\;\;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 (<= a -5.7e+156)
     t_2
     (if (<= a 9.5e-239)
       t_1
       (if (<= a 8.5e-124) (* 0.0625 (* t z)) (if (<= a 1.05e+27) 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 (a <= -5.7e+156) {
		tmp = t_2;
	} else if (a <= 9.5e-239) {
		tmp = t_1;
	} else if (a <= 8.5e-124) {
		tmp = 0.0625 * (t * z);
	} else if (a <= 1.05e+27) {
		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 (a <= (-5.7d+156)) then
        tmp = t_2
    else if (a <= 9.5d-239) then
        tmp = t_1
    else if (a <= 8.5d-124) then
        tmp = 0.0625d0 * (t * z)
    else if (a <= 1.05d+27) 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 (a <= -5.7e+156) {
		tmp = t_2;
	} else if (a <= 9.5e-239) {
		tmp = t_1;
	} else if (a <= 8.5e-124) {
		tmp = 0.0625 * (t * z);
	} else if (a <= 1.05e+27) {
		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 a <= -5.7e+156:
		tmp = t_2
	elif a <= 9.5e-239:
		tmp = t_1
	elif a <= 8.5e-124:
		tmp = 0.0625 * (t * z)
	elif a <= 1.05e+27:
		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(b * Float64(a * -0.25))
	tmp = 0.0
	if (a <= -5.7e+156)
		tmp = t_2;
	elseif (a <= 9.5e-239)
		tmp = t_1;
	elseif (a <= 8.5e-124)
		tmp = Float64(0.0625 * Float64(t * z));
	elseif (a <= 1.05e+27)
		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 (a <= -5.7e+156)
		tmp = t_2;
	elseif (a <= 9.5e-239)
		tmp = t_1;
	elseif (a <= 8.5e-124)
		tmp = 0.0625 * (t * z);
	elseif (a <= 1.05e+27)
		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[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.7e+156], t$95$2, If[LessEqual[a, 9.5e-239], t$95$1, If[LessEqual[a, 8.5e-124], N[(0.0625 * N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+27], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-239}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 1.05 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.69999999999999998e156 or 1.04999999999999997e27 < a

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

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

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

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

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

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

    if -5.69999999999999998e156 < a < 9.4999999999999992e-239 or 8.5000000000000002e-124 < a < 1.04999999999999997e27

    1. Initial program 98.6%

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

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

    if 9.4999999999999992e-239 < a < 8.5000000000000002e-124

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/61.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/62.0%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative62.0%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity62.0%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/62.2%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified62.2%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    5. Taylor expanded in z around inf 47.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.7 \cdot 10^{+156}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-239}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq 8.5 \cdot 10^{-124}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+27}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]

Alternative 11: 56.3% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;a \leq 4.3 \cdot 10^{-239}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;a \leq 3.15 \cdot 10^{-180}:\\
\;\;\;\;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 a < -2.2000000000000001e97 or 3.1499999999999998e-180 < a

    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 a around inf 63.2%

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

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

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

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

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

    if -2.2000000000000001e97 < a < 4.3e-239

    1. Initial program 98.1%

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

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

    if 4.3e-239 < a < 3.1499999999999998e-180

    1. Initial program 99.9%

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

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

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

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/63.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/63.2%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative63.2%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity63.2%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/63.3%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified63.3%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    5. Taylor expanded in z around inf 50.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{+97}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq 4.3 \cdot 10^{-239}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq 3.15 \cdot 10^{-180}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]

Alternative 12: 58.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-123} \lor \neg \left(b \leq 8.5 \cdot 10^{+76}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.29999999999999998e-123 or 8.49999999999999992e76 < b

    1. Initial program 97.9%

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

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

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

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

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

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

    if -1.29999999999999998e-123 < b < 8.49999999999999992e76

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

      \[\leadsto \color{blue}{\left(y \cdot x + 0.0625 \cdot \left(t \cdot z\right)\right)} + c \]
    3. Taylor expanded in c around 0 65.4%

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

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

Alternative 13: 37.9% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+52}:\\
\;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.7000000000000001e-167 or 2.4e52 < y

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

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

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

    if -2.7000000000000001e-167 < y < 2.4e52

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

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

        \[\leadsto \color{blue}{\left(0.0625 \cdot t\right) \cdot z} + c \]
      2. metadata-eval60.6%

        \[\leadsto \left(\color{blue}{\frac{1}{16}} \cdot t\right) \cdot z + c \]
      3. associate-/r/60.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{16}{t}}} \cdot z + c \]
      4. associate-*l/60.5%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{16}{t}}} + c \]
      5. *-commutative60.5%

        \[\leadsto \frac{\color{blue}{z \cdot 1}}{\frac{16}{t}} + c \]
      6. *-rgt-identity60.5%

        \[\leadsto \frac{\color{blue}{z}}{\frac{16}{t}} + c \]
      7. associate-/r/60.6%

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    4. Simplified60.6%

      \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
    5. Taylor expanded in z around inf 39.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-167}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+52}:\\ \;\;\;\;0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 14: 37.9% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.75 \cdot 10^{+177}:\\
\;\;\;\;c\\

\mathbf{elif}\;c \leq 1.7 \cdot 10^{+128}:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.7500000000000002e177 or 1.6999999999999999e128 < c

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

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

    if -3.7500000000000002e177 < c < 1.6999999999999999e128

    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 z around 0 70.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 34.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.75 \cdot 10^{+177}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 1.7 \cdot 10^{+128}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 15: 22.8% 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.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 20.8%

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

    \[\leadsto c \]

Reproduce

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