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

Percentage Accurate: 97.5% → 99.0%
Time: 9.3s
Alternatives: 14
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 97.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.9% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot 0.0625, t, a \cdot \left(b \cdot -0.25\right)\right)\\


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto 0.0625 \cdot \color{blue}{\left(z \cdot t\right)} - 0.25 \cdot \left(a \cdot b\right) \]
      2. associate-*r*16.7%

        \[\leadsto \color{blue}{\left(0.0625 \cdot z\right) \cdot t} - 0.25 \cdot \left(a \cdot b\right) \]
      3. fma-neg66.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625 \cdot z, t, -0.25 \cdot \left(a \cdot b\right)\right)} \]
      4. *-commutative66.7%

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot 0.0625}, t, -0.25 \cdot \left(a \cdot b\right)\right) \]
      5. *-commutative66.7%

        \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, -\color{blue}{\left(a \cdot b\right) \cdot 0.25}\right) \]
      6. distribute-rgt-neg-in66.7%

        \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, \color{blue}{\left(a \cdot b\right) \cdot \left(-0.25\right)}\right) \]
      7. metadata-eval66.7%

        \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, \left(a \cdot b\right) \cdot \color{blue}{-0.25}\right) \]
      8. associate-*r*66.7%

        \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, \color{blue}{a \cdot \left(b \cdot -0.25\right)}\right) \]
      9. *-commutative66.7%

        \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, a \cdot \color{blue}{\left(-0.25 \cdot b\right)}\right) \]
    5. Applied egg-rr66.7%

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

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

Alternative 3: 98.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 4: 43.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-46}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-142}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-261}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+52}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -2.25e108 or 6.4e52 < (*.f64 x y)

    1. Initial program 95.0%

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

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

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

    if -2.25e108 < (*.f64 x y) < -3.1000000000000001e-46

    1. Initial program 100.0%

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

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

    if -3.1000000000000001e-46 < (*.f64 x y) < -4.50000000000000019e-142 or -1.5e-261 < (*.f64 x y) < 6.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 a around 0 73.5%

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

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

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

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

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

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

    if -4.50000000000000019e-142 < (*.f64 x y) < -1.5e-261

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+108}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-46}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq -4.5 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq -1.5 \cdot 10^{-261}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{+52}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 5: 65.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + a \cdot \left(b \cdot -0.25\right)\\ t_2 := c + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+140}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-121}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{+55}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* a (* b -0.25)))) (t_2 (+ c (* x y))))
   (if (<= (* x y) -2.7e+140)
     t_2
     (if (<= (* x y) -9.5e-91)
       t_1
       (if (<= (* x y) -8.5e-121)
         (* t (* z 0.0625))
         (if (<= (* x y) 2.9e+55) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (a * (b * -0.25));
	double t_2 = c + (x * y);
	double tmp;
	if ((x * y) <= -2.7e+140) {
		tmp = t_2;
	} else if ((x * y) <= -9.5e-91) {
		tmp = t_1;
	} else if ((x * y) <= -8.5e-121) {
		tmp = t * (z * 0.0625);
	} else if ((x * y) <= 2.9e+55) {
		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 + (a * (b * (-0.25d0)))
    t_2 = c + (x * y)
    if ((x * y) <= (-2.7d+140)) then
        tmp = t_2
    else if ((x * y) <= (-9.5d-91)) then
        tmp = t_1
    else if ((x * y) <= (-8.5d-121)) then
        tmp = t * (z * 0.0625d0)
    else if ((x * y) <= 2.9d+55) 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 + (a * (b * -0.25));
	double t_2 = c + (x * y);
	double tmp;
	if ((x * y) <= -2.7e+140) {
		tmp = t_2;
	} else if ((x * y) <= -9.5e-91) {
		tmp = t_1;
	} else if ((x * y) <= -8.5e-121) {
		tmp = t * (z * 0.0625);
	} else if ((x * y) <= 2.9e+55) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (a * (b * -0.25))
	t_2 = c + (x * y)
	tmp = 0
	if (x * y) <= -2.7e+140:
		tmp = t_2
	elif (x * y) <= -9.5e-91:
		tmp = t_1
	elif (x * y) <= -8.5e-121:
		tmp = t * (z * 0.0625)
	elif (x * y) <= 2.9e+55:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(a * Float64(b * -0.25)))
	t_2 = Float64(c + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -2.7e+140)
		tmp = t_2;
	elseif (Float64(x * y) <= -9.5e-91)
		tmp = t_1;
	elseif (Float64(x * y) <= -8.5e-121)
		tmp = Float64(t * Float64(z * 0.0625));
	elseif (Float64(x * y) <= 2.9e+55)
		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 + (a * (b * -0.25));
	t_2 = c + (x * y);
	tmp = 0.0;
	if ((x * y) <= -2.7e+140)
		tmp = t_2;
	elseif ((x * y) <= -9.5e-91)
		tmp = t_1;
	elseif ((x * y) <= -8.5e-121)
		tmp = t * (z * 0.0625);
	elseif ((x * y) <= 2.9e+55)
		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[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.7e+140], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -9.5e-91], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e-121], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.9e+55], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{+55}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.70000000000000018e140 or 2.8999999999999999e55 < (*.f64 x y)

    1. Initial program 95.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 73.9%

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

    if -2.70000000000000018e140 < (*.f64 x y) < -9.5e-91 or -8.50000000000000025e-121 < (*.f64 x y) < 2.8999999999999999e55

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

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

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

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

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

    if -9.5e-91 < (*.f64 x y) < -8.50000000000000025e-121

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+140}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9.5 \cdot 10^{-91}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-121}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 2.9 \cdot 10^{+55}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 6: 64.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-136}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.49999999999999993e58 or 4.5999999999999997e47 < (*.f64 x y)

    1. Initial program 95.5%

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

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

    if -2.49999999999999993e58 < (*.f64 x y) < -2.5000000000000001e-136 or -9.99999999999999961e-261 < (*.f64 x y) < 4.5999999999999997e47

    1. Initial program 99.2%

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

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

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

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

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

    if -2.5000000000000001e-136 < (*.f64 x y) < -9.99999999999999961e-261

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

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

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

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

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

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

Alternative 7: 88.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 94.5%

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

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

    if -4.9999999999999999e119 < (*.f64 a b) < 1e-22

    1. Initial program 100.0%

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

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

Alternative 8: 87.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.99999999999999921e133 or 5.0000000000000002e160 < (*.f64 a b)

    1. Initial program 91.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 0 85.1%

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

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

    if -9.99999999999999921e133 < (*.f64 a b) < 5.0000000000000002e160

    1. Initial program 100.0%

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

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

Alternative 9: 60.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-98}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.8999999999999998e-116 or 1.30000000000000002e47 < z

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

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

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

    if -2.8999999999999998e-116 < z < 1.8999999999999999e-190 or 2.14999999999999994e-98 < z < 1.30000000000000002e47

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

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

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

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

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

    if 1.8999999999999999e-190 < z < 2.14999999999999994e-98

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

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

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

Alternative 10: 44.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2.7 \cdot 10^{-125}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -7.0000000000000005e108 or 1.4499999999999999e55 < (*.f64 x y)

    1. Initial program 94.9%

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

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

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

    if -7.0000000000000005e108 < (*.f64 x y) < -2.6999999999999998e-125

    1. Initial program 100.0%

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

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

    if -2.6999999999999998e-125 < (*.f64 x y) < 1.4499999999999999e55

    1. Initial program 99.1%

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

      \[\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 a around inf 34.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+108}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.7 \cdot 10^{-125}:\\ \;\;\;\;c\\ \mathbf{elif}\;x \cdot y \leq 1.45 \cdot 10^{+55}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 78.0% accurate, 1.1× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.2000000000000001e147

    1. Initial program 93.0%

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

      \[\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 a around inf 56.8%

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

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

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

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

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

    if -6.2000000000000001e147 < b < 3.80000000000000002e217

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

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

    if 3.80000000000000002e217 < b

    1. Initial program 91.3%

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

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

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

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

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

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

Alternative 12: 54.3% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-298}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.56 \cdot 10^{-277}:\\
\;\;\;\;b \cdot \left(a \cdot -0.25\right)\\

\mathbf{elif}\;z \leq 10^{+46}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.7000000000000001e114 or 9.9999999999999999e45 < z

    1. Initial program 95.6%

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

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

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

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

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

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

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

    if -3.7000000000000001e114 < z < 1.45000000000000007e-298 or 1.56e-277 < z < 9.9999999999999999e45

    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 x around inf 61.5%

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

    if 1.45000000000000007e-298 < z < 1.56e-277

    1. Initial program 100.0%

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

      \[\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 a around inf 70.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+114}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-298}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq 1.56 \cdot 10^{-277}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;z \leq 10^{+46}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \end{array} \]

Alternative 13: 41.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+109} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+34}\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) -2.9e+109) (not (<= (* x y) 1.25e+34))) (* x y) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if (((x * y) <= -2.9e+109) || !((x * y) <= 1.25e+34)) {
		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) <= (-2.9d+109)) .or. (.not. ((x * y) <= 1.25d+34))) 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) <= -2.9e+109) || !((x * y) <= 1.25e+34)) {
		tmp = x * y;
	} else {
		tmp = c;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if ((x * y) <= -2.9e+109) or not ((x * y) <= 1.25e+34):
		tmp = x * y
	else:
		tmp = c
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if ((Float64(x * y) <= -2.9e+109) || !(Float64(x * y) <= 1.25e+34))
		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) <= -2.9e+109) || ~(((x * y) <= 1.25e+34)))
		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], -2.9e+109], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.25e+34]], $MachinePrecision]], N[(x * y), $MachinePrecision], c]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+109} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+34}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.9e109 or 1.25e34 < (*.f64 x y)

    1. Initial program 95.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 82.1%

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

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

    if -2.9e109 < (*.f64 x y) < 1.25e34

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+109} \lor \neg \left(x \cdot y \leq 1.25 \cdot 10^{+34}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 14: 22.2% accurate, 17.0× speedup?

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

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

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

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

    \[\leadsto c \]

Reproduce

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