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

Percentage Accurate: 97.8% → 98.1%
Time: 13.7s
Alternatives: 13
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 13 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.1% accurate, 0.1× speedup?

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

\\
\left(\mathsf{fma}\left(t \cdot 0.0625, z, x \cdot y\right) - \frac{a \cdot b}{4}\right) + 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. Add Preprocessing
  3. Step-by-step derivation
    1. +-commutative98.4%

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

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

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 0.1× speedup?

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

\\
c + \left(\mathsf{fma}\left(x, y, z \cdot \frac{t}{16}\right) - a \cdot \frac{b}{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. 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 \left(x \cdot y + \frac{\color{blue}{t \cdot z}}{16}\right) - \left(\frac{a \cdot b}{4} - c\right) \]
    3. associate-+l-98.4%

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

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

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

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

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

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

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

Alternative 3: 66.3% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 100.0%

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

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

    if -1.87999999999999988e102 < (*.f64 x y) < 3.6e6

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 3.6e6 < (*.f64 x y) < 1.07999999999999993e86

    1. Initial program 99.9%

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

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

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

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

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

    if 1.07999999999999993e86 < (*.f64 x y)

    1. Initial program 92.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.88 \cdot 10^{+102}:\\ \;\;\;\;x \cdot y + c\\ \mathbf{elif}\;x \cdot y \leq 3600000:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.08 \cdot 10^{+86}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(t \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot y + c\\
\mathbf{if}\;x \cdot y \leq -2.55 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.55e114 or 1.1499999999999999e84 < (*.f64 x y)

    1. Initial program 96.0%

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

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

    if -2.55e114 < (*.f64 x y) < 3.2e5

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 3.2e5 < (*.f64 x y) < 1.1499999999999999e84

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.55 \cdot 10^{+114}:\\ \;\;\;\;x \cdot y + c\\ \mathbf{elif}\;x \cdot y \leq 320000:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{+84}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + c\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 89.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;x \cdot y \leq -3.2 \cdot 10^{+47} \lor \neg \left(x \cdot y \leq 9.8 \cdot 10^{+85}\right):\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -3.2e47 or 9.7999999999999993e85 < (*.f64 x y)

    1. Initial program 96.1%

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

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

    if -3.2e47 < (*.f64 x y) < 9.7999999999999993e85

    1. Initial program 100.0%

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

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

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

Alternative 6: 89.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+79} \lor \neg \left(a \cdot b \leq 1\right):\\ \;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \cdot 0.25\right)\\ \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 (<= (* a b) -5e+79) (not (<= (* a b) 1.0)))
   (+ c (- (* x y) (* (* a b) 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 (((a * b) <= -5e+79) || !((a * b) <= 1.0)) {
		tmp = c + ((x * y) - ((a * b) * 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 (((a * b) <= (-5d+79)) .or. (.not. ((a * b) <= 1.0d0))) then
        tmp = c + ((x * y) - ((a * b) * 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 (((a * b) <= -5e+79) || !((a * b) <= 1.0)) {
		tmp = c + ((x * y) - ((a * b) * 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 ((a * b) <= -5e+79) or not ((a * b) <= 1.0):
		tmp = c + ((x * y) - ((a * b) * 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(a * b) <= -5e+79) || !(Float64(a * b) <= 1.0))
		tmp = Float64(c + Float64(Float64(x * y) - Float64(Float64(a * b) * 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 (((a * b) <= -5e+79) || ~(((a * b) <= 1.0)))
		tmp = c + ((x * y) - ((a * b) * 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[(a * b), $MachinePrecision], -5e+79], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.0]], $MachinePrecision]], N[(c + N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $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}\;a \cdot b \leq -5 \cdot 10^{+79} \lor \neg \left(a \cdot b \leq 1\right):\\
\;\;\;\;c + \left(x \cdot y - \left(a \cdot b\right) \cdot 0.25\right)\\

\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) < -5e79 or 1 < (*.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. Add Preprocessing
    3. Taylor expanded in z around 0 84.5%

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

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

    1. Initial program 99.3%

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

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

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

Alternative 7: 86.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 97.3%

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

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

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

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

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

    if -1.99999999999999998e132 < (*.f64 a b) < 1e262

    1. Initial program 99.5%

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

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

    if 1e262 < (*.f64 a b)

    1. Initial program 88.9%

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

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

      \[\leadsto \color{blue}{c - 0.25 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. metadata-eval94.4%

        \[\leadsto c - \color{blue}{\frac{1}{4}} \cdot \left(a \cdot b\right) \]
      2. associate-/r/94.4%

        \[\leadsto c - \color{blue}{\frac{1}{\frac{4}{a \cdot b}}} \]
    6. Applied egg-rr94.4%

      \[\leadsto c - \color{blue}{\frac{1}{\frac{4}{a \cdot b}}} \]
    7. Taylor expanded in c around 0 94.4%

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

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

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

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

Alternative 8: 44.6% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{+84}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.39999999999999996e106 or 2.94999999999999992e84 < (*.f64 x y)

    1. Initial program 96.0%

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

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

        \[\leadsto \left(\color{blue}{\left(0.0625 \cdot t\right) \cdot z} + x \cdot y\right) + c \]
      2. fma-define92.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625 \cdot t, z, x \cdot y\right)} + c \]
    5. Applied egg-rr92.1%

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

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

    if -1.39999999999999996e106 < (*.f64 x y) < 7.5999999999999999e-13

    1. Initial program 100.0%

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

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

        \[\leadsto \left(\color{blue}{\left(0.0625 \cdot t\right) \cdot z} + x \cdot y\right) + c \]
      2. fma-define67.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625 \cdot t, z, x \cdot y\right)} + c \]
    5. Applied egg-rr67.5%

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

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

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

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

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

    if 7.5999999999999999e-13 < (*.f64 x y) < 2.94999999999999992e84

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in x around 0 41.6%

      \[\leadsto \color{blue}{c} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification52.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+106}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 7.6 \cdot 10^{-13}:\\ \;\;\;\;t \cdot \left(0.0625 \cdot z\right)\\ \mathbf{elif}\;x \cdot y \leq 2.95 \cdot 10^{+84}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 65.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+103} \lor \neg \left(x \cdot y \leq 1.72 \cdot 10^{+84}\right):\\
\;\;\;\;x \cdot y + c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.1000000000000002e103 or 1.72e84 < (*.f64 x y)

    1. Initial program 96.0%

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

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

    if -2.1000000000000002e103 < (*.f64 x y) < 1.72e84

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.1 \cdot 10^{+103} \lor \neg \left(x \cdot y \leq 1.72 \cdot 10^{+84}\right):\\ \;\;\;\;x \cdot y + c\\ \mathbf{else}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 42.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.75 \cdot 10^{+39} \lor \neg \left(x \cdot y \leq 6.2 \cdot 10^{+83}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.7500000000000001e39 or 6.19999999999999984e83 < (*.f64 x y)

    1. Initial program 96.2%

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

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

        \[\leadsto \left(\color{blue}{\left(0.0625 \cdot t\right) \cdot z} + x \cdot y\right) + c \]
      2. fma-define90.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625 \cdot t, z, x \cdot y\right)} + c \]
    5. Applied egg-rr90.7%

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

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

    if -1.7500000000000001e39 < (*.f64 x y) < 6.19999999999999984e83

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot y} + c \]
    4. Taylor expanded in x around 0 30.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.75 \cdot 10^{+39} \lor \neg \left(x \cdot y \leq 6.2 \cdot 10^{+83}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 97.8% accurate, 1.0× speedup?

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

\\
c + \left(\left(x \cdot y + \frac{t \cdot z}{16}\right) - \frac{a \cdot b}{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. Add Preprocessing
  3. Final simplification98.4%

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

Alternative 12: 53.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-6} \lor \neg \left(t \leq 8 \cdot 10^{+193}\right):\\
\;\;\;\;t \cdot \left(0.0625 \cdot z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.0000000000000001e-6 or 8.00000000000000053e193 < t

    1. Initial program 97.6%

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

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

        \[\leadsto \left(\color{blue}{\left(0.0625 \cdot t\right) \cdot z} + x \cdot y\right) + c \]
      2. fma-define78.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625 \cdot t, z, x \cdot y\right)} + c \]
    5. Applied egg-rr78.6%

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

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

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

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

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

    if -3.0000000000000001e-6 < t < 8.00000000000000053e193

    1. Initial program 98.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3 \cdot 10^{-6} \lor \neg \left(t \leq 8 \cdot 10^{+193}\right):\\ \;\;\;\;t \cdot \left(0.0625 \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + c\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 22.6% accurate, 17.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x \cdot y} + c \]
  4. Taylor expanded in x around 0 22.6%

    \[\leadsto \color{blue}{c} \]
  5. Final simplification22.6%

    \[\leadsto c \]
  6. Add Preprocessing

Reproduce

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