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

Percentage Accurate: 97.4% → 98.9%
Time: 8.1s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 97.4% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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: 61.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{+138} \lor \neg \left(x \cdot y \leq -3.2 \cdot 10^{-80}\right) \land \left(x \cdot y \leq 7.2 \cdot 10^{-53} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+127}\right) \land x \cdot y \leq 1.95 \cdot 10^{+164}\right):\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + \left(z \cdot t\right) \cdot 0.0625\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* x y) -4.6e+236)
   (* x y)
   (if (or (<= (* x y) -9e+138)
           (and (not (<= (* x y) -3.2e-80))
                (or (<= (* x y) 7.2e-53)
                    (and (not (<= (* x y) 3.4e+127)) (<= (* x y) 1.95e+164)))))
     (+ c (* a (* b -0.25)))
     (+ (* x y) (* (* z t) 0.0625)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -4.6e+236) {
		tmp = x * y;
	} else if (((x * y) <= -9e+138) || (!((x * y) <= -3.2e-80) && (((x * y) <= 7.2e-53) || (!((x * y) <= 3.4e+127) && ((x * y) <= 1.95e+164))))) {
		tmp = c + (a * (b * -0.25));
	} else {
		tmp = (x * y) + ((z * t) * 0.0625);
	}
	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) <= (-4.6d+236)) then
        tmp = x * y
    else if (((x * y) <= (-9d+138)) .or. (.not. ((x * y) <= (-3.2d-80))) .and. ((x * y) <= 7.2d-53) .or. (.not. ((x * y) <= 3.4d+127)) .and. ((x * y) <= 1.95d+164)) then
        tmp = c + (a * (b * (-0.25d0)))
    else
        tmp = (x * y) + ((z * t) * 0.0625d0)
    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) <= -4.6e+236) {
		tmp = x * y;
	} else if (((x * y) <= -9e+138) || (!((x * y) <= -3.2e-80) && (((x * y) <= 7.2e-53) || (!((x * y) <= 3.4e+127) && ((x * y) <= 1.95e+164))))) {
		tmp = c + (a * (b * -0.25));
	} else {
		tmp = (x * y) + ((z * t) * 0.0625);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	tmp = 0
	if (x * y) <= -4.6e+236:
		tmp = x * y
	elif ((x * y) <= -9e+138) or (not ((x * y) <= -3.2e-80) and (((x * y) <= 7.2e-53) or (not ((x * y) <= 3.4e+127) and ((x * y) <= 1.95e+164)))):
		tmp = c + (a * (b * -0.25))
	else:
		tmp = (x * y) + ((z * t) * 0.0625)
	return tmp
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(x * y) <= -4.6e+236)
		tmp = Float64(x * y);
	elseif ((Float64(x * y) <= -9e+138) || (!(Float64(x * y) <= -3.2e-80) && ((Float64(x * y) <= 7.2e-53) || (!(Float64(x * y) <= 3.4e+127) && (Float64(x * y) <= 1.95e+164)))))
		tmp = Float64(c + Float64(a * Float64(b * -0.25)));
	else
		tmp = Float64(Float64(x * y) + Float64(Float64(z * t) * 0.0625));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	tmp = 0.0;
	if ((x * y) <= -4.6e+236)
		tmp = x * y;
	elseif (((x * y) <= -9e+138) || (~(((x * y) <= -3.2e-80)) && (((x * y) <= 7.2e-53) || (~(((x * y) <= 3.4e+127)) && ((x * y) <= 1.95e+164)))))
		tmp = c + (a * (b * -0.25));
	else
		tmp = (x * y) + ((z * t) * 0.0625);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -4.6e+236], N[(x * y), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -9e+138], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], -3.2e-80]], $MachinePrecision], Or[LessEqual[N[(x * y), $MachinePrecision], 7.2e-53], And[N[Not[LessEqual[N[(x * y), $MachinePrecision], 3.4e+127]], $MachinePrecision], LessEqual[N[(x * y), $MachinePrecision], 1.95e+164]]]]], N[(c + N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * 0.0625), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{+138} \lor \neg \left(x \cdot y \leq -3.2 \cdot 10^{-80}\right) \land \left(x \cdot y \leq 7.2 \cdot 10^{-53} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+127}\right) \land x \cdot y \leq 1.95 \cdot 10^{+164}\right):\\
\;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.5999999999999999e236

    1. Initial program 94.1%

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

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

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

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

    if -4.5999999999999999e236 < (*.f64 x y) < -8.99999999999999963e138 or -3.1999999999999999e-80 < (*.f64 x y) < 7.1999999999999998e-53 or 3.39999999999999977e127 < (*.f64 x y) < 1.94999999999999993e164

    1. Initial program 99.3%

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

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

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

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

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

    if -8.99999999999999963e138 < (*.f64 x y) < -3.1999999999999999e-80 or 7.1999999999999998e-53 < (*.f64 x y) < 3.39999999999999977e127 or 1.94999999999999993e164 < (*.f64 x y)

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -9 \cdot 10^{+138} \lor \neg \left(x \cdot y \leq -3.2 \cdot 10^{-80}\right) \land \left(x \cdot y \leq 7.2 \cdot 10^{-53} \lor \neg \left(x \cdot y \leq 3.4 \cdot 10^{+127}\right) \land x \cdot y \leq 1.95 \cdot 10^{+164}\right):\\ \;\;\;\;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 3: 61.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(b \cdot -0.25\right)\\ t_2 := c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.6 \cdot 10^{+147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-212}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-301}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+33}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* a (* b -0.25))) (t_2 (+ c (* t (* z 0.0625)))))
   (if (<= (* x y) -4.6e+236)
     (* x y)
     (if (<= (* x y) -1.6e+147)
       t_1
       (if (<= (* x y) -3.4e-212)
         t_2
         (if (<= (* x y) -8.5e-301)
           t_1
           (if (<= (* x y) 9.5e+33) t_2 (+ c (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = a * (b * -0.25);
	double t_2 = c + (t * (z * 0.0625));
	double tmp;
	if ((x * y) <= -4.6e+236) {
		tmp = x * y;
	} else if ((x * y) <= -1.6e+147) {
		tmp = t_1;
	} else if ((x * y) <= -3.4e-212) {
		tmp = t_2;
	} else if ((x * y) <= -8.5e-301) {
		tmp = t_1;
	} else if ((x * y) <= 9.5e+33) {
		tmp = t_2;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a * (b * (-0.25d0))
    t_2 = c + (t * (z * 0.0625d0))
    if ((x * y) <= (-4.6d+236)) then
        tmp = x * y
    else if ((x * y) <= (-1.6d+147)) then
        tmp = t_1
    else if ((x * y) <= (-3.4d-212)) then
        tmp = t_2
    else if ((x * y) <= (-8.5d-301)) then
        tmp = t_1
    else if ((x * y) <= 9.5d+33) then
        tmp = t_2
    else
        tmp = c + (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 = a * (b * -0.25);
	double t_2 = c + (t * (z * 0.0625));
	double tmp;
	if ((x * y) <= -4.6e+236) {
		tmp = x * y;
	} else if ((x * y) <= -1.6e+147) {
		tmp = t_1;
	} else if ((x * y) <= -3.4e-212) {
		tmp = t_2;
	} else if ((x * y) <= -8.5e-301) {
		tmp = t_1;
	} else if ((x * y) <= 9.5e+33) {
		tmp = t_2;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = a * (b * -0.25)
	t_2 = c + (t * (z * 0.0625))
	tmp = 0
	if (x * y) <= -4.6e+236:
		tmp = x * y
	elif (x * y) <= -1.6e+147:
		tmp = t_1
	elif (x * y) <= -3.4e-212:
		tmp = t_2
	elif (x * y) <= -8.5e-301:
		tmp = t_1
	elif (x * y) <= 9.5e+33:
		tmp = t_2
	else:
		tmp = c + (x * y)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(a * Float64(b * -0.25))
	t_2 = Float64(c + Float64(t * Float64(z * 0.0625)))
	tmp = 0.0
	if (Float64(x * y) <= -4.6e+236)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.6e+147)
		tmp = t_1;
	elseif (Float64(x * y) <= -3.4e-212)
		tmp = t_2;
	elseif (Float64(x * y) <= -8.5e-301)
		tmp = t_1;
	elseif (Float64(x * y) <= 9.5e+33)
		tmp = t_2;
	else
		tmp = Float64(c + Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = a * (b * -0.25);
	t_2 = c + (t * (z * 0.0625));
	tmp = 0.0;
	if ((x * y) <= -4.6e+236)
		tmp = x * y;
	elseif ((x * y) <= -1.6e+147)
		tmp = t_1;
	elseif ((x * y) <= -3.4e-212)
		tmp = t_2;
	elseif ((x * y) <= -8.5e-301)
		tmp = t_1;
	elseif ((x * y) <= 9.5e+33)
		tmp = t_2;
	else
		tmp = c + (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.6e+236], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.6e+147], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e-212], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -8.5e-301], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 9.5e+33], t$95$2, N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -1.6 \cdot 10^{+147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-212}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+33}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 94.1%

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

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

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

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

    if -4.5999999999999999e236 < (*.f64 x y) < -1.59999999999999989e147 or -3.39999999999999998e-212 < (*.f64 x y) < -8.50000000000000046e-301

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999989e147 < (*.f64 x y) < -3.39999999999999998e-212 or -8.50000000000000046e-301 < (*.f64 x y) < 9.5000000000000003e33

    1. Initial program 99.4%

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

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

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

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

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

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

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

    if 9.5000000000000003e33 < (*.f64 x y)

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    4. Step-by-step derivation
      1. +-commutative64.3%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    5. Simplified64.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.6 \cdot 10^{+236}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.6 \cdot 10^{+147}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq -3.4 \cdot 10^{-212}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-301}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+33}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 4: 62.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+243}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{+142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-168}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+29}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* a (* b -0.25)))))
   (if (<= (* x y) -2.7e+243)
     (* x y)
     (if (<= (* x y) -3.5e+142)
       t_1
       (if (<= (* x y) -1.7e-168)
         (+ c (* t (* z 0.0625)))
         (if (<= (* x y) 5e+29) t_1 (+ c (* x y))))))))
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 tmp;
	if ((x * y) <= -2.7e+243) {
		tmp = x * y;
	} else if ((x * y) <= -3.5e+142) {
		tmp = t_1;
	} else if ((x * y) <= -1.7e-168) {
		tmp = c + (t * (z * 0.0625));
	} else if ((x * y) <= 5e+29) {
		tmp = t_1;
	} else {
		tmp = c + (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 = c + (a * (b * (-0.25d0)))
    if ((x * y) <= (-2.7d+243)) then
        tmp = x * y
    else if ((x * y) <= (-3.5d+142)) then
        tmp = t_1
    else if ((x * y) <= (-1.7d-168)) then
        tmp = c + (t * (z * 0.0625d0))
    else if ((x * y) <= 5d+29) then
        tmp = t_1
    else
        tmp = c + (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 = c + (a * (b * -0.25));
	double tmp;
	if ((x * y) <= -2.7e+243) {
		tmp = x * y;
	} else if ((x * y) <= -3.5e+142) {
		tmp = t_1;
	} else if ((x * y) <= -1.7e-168) {
		tmp = c + (t * (z * 0.0625));
	} else if ((x * y) <= 5e+29) {
		tmp = t_1;
	} else {
		tmp = c + (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (a * (b * -0.25))
	tmp = 0
	if (x * y) <= -2.7e+243:
		tmp = x * y
	elif (x * y) <= -3.5e+142:
		tmp = t_1
	elif (x * y) <= -1.7e-168:
		tmp = c + (t * (z * 0.0625))
	elif (x * y) <= 5e+29:
		tmp = t_1
	else:
		tmp = c + (x * y)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(a * Float64(b * -0.25)))
	tmp = 0.0
	if (Float64(x * y) <= -2.7e+243)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -3.5e+142)
		tmp = t_1;
	elseif (Float64(x * y) <= -1.7e-168)
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	elseif (Float64(x * y) <= 5e+29)
		tmp = t_1;
	else
		tmp = Float64(c + Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (a * (b * -0.25));
	tmp = 0.0;
	if ((x * y) <= -2.7e+243)
		tmp = x * y;
	elseif ((x * y) <= -3.5e+142)
		tmp = t_1;
	elseif ((x * y) <= -1.7e-168)
		tmp = c + (t * (z * 0.0625));
	elseif ((x * y) <= 5e+29)
		tmp = t_1;
	else
		tmp = c + (x * y);
	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]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.7e+243], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3.5e+142], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-168], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+29], t$95$1, N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-168}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.1%

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

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

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

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

    if -2.7000000000000001e243 < (*.f64 x y) < -3.49999999999999997e142 or -1.70000000000000011e-168 < (*.f64 x y) < 5.0000000000000001e29

    1. Initial program 99.3%

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

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

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

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

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

    if -3.49999999999999997e142 < (*.f64 x y) < -1.70000000000000011e-168

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

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

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

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

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

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

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

    if 5.0000000000000001e29 < (*.f64 x y)

    1. Initial program 99.9%

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    4. Step-by-step derivation
      1. +-commutative64.3%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    5. Simplified64.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.7 \cdot 10^{+243}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3.5 \cdot 10^{+142}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-168}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+29}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 5: 86.6% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5.0000000000000001e188 or 4.99999999999999981e-81 < (*.f64 a b)

    1. Initial program 98.2%

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

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

    if -5.0000000000000001e188 < (*.f64 a b) < 4.99999999999999981e-81

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

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

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

Alternative 6: 97.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ c + \left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ c (- (+ (* 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 + (((x * y) + ((z * t) / 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) + ((z * t) / 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) + ((z * t) / 16.0)) - ((a * b) / 4.0));
}
def code(x, y, z, t, a, b, c):
	return c + (((x * y) + ((z * t) / 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(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)))
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = c + (((x * y) + ((z * t) / 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[(z * t), $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{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right)
\end{array}
Derivation
  1. Initial program 99.2%

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

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

Alternative 7: 36.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;b \leq -5 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-297}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-52}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{+21}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+101}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* a (* b -0.25))))
   (if (<= b -5e-65)
     t_1
     (if (<= b -2.3e-297)
       (* x y)
       (if (<= b 1.1e-52)
         c
         (if (<= b 2.05e+21) (* x y) (if (<= b 3.6e+101) c t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = a * (b * -0.25);
	double tmp;
	if (b <= -5e-65) {
		tmp = t_1;
	} else if (b <= -2.3e-297) {
		tmp = x * y;
	} else if (b <= 1.1e-52) {
		tmp = c;
	} else if (b <= 2.05e+21) {
		tmp = x * y;
	} else if (b <= 3.6e+101) {
		tmp = c;
	} 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 = a * (b * (-0.25d0))
    if (b <= (-5d-65)) then
        tmp = t_1
    else if (b <= (-2.3d-297)) then
        tmp = x * y
    else if (b <= 1.1d-52) then
        tmp = c
    else if (b <= 2.05d+21) then
        tmp = x * y
    else if (b <= 3.6d+101) then
        tmp = c
    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 = a * (b * -0.25);
	double tmp;
	if (b <= -5e-65) {
		tmp = t_1;
	} else if (b <= -2.3e-297) {
		tmp = x * y;
	} else if (b <= 1.1e-52) {
		tmp = c;
	} else if (b <= 2.05e+21) {
		tmp = x * y;
	} else if (b <= 3.6e+101) {
		tmp = c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = a * (b * -0.25)
	tmp = 0
	if b <= -5e-65:
		tmp = t_1
	elif b <= -2.3e-297:
		tmp = x * y
	elif b <= 1.1e-52:
		tmp = c
	elif b <= 2.05e+21:
		tmp = x * y
	elif b <= 3.6e+101:
		tmp = c
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(a * Float64(b * -0.25))
	tmp = 0.0
	if (b <= -5e-65)
		tmp = t_1;
	elseif (b <= -2.3e-297)
		tmp = Float64(x * y);
	elseif (b <= 1.1e-52)
		tmp = c;
	elseif (b <= 2.05e+21)
		tmp = Float64(x * y);
	elseif (b <= 3.6e+101)
		tmp = c;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = a * (b * -0.25);
	tmp = 0.0;
	if (b <= -5e-65)
		tmp = t_1;
	elseif (b <= -2.3e-297)
		tmp = x * y;
	elseif (b <= 1.1e-52)
		tmp = c;
	elseif (b <= 2.05e+21)
		tmp = x * y;
	elseif (b <= 3.6e+101)
		tmp = c;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5e-65], t$95$1, If[LessEqual[b, -2.3e-297], N[(x * y), $MachinePrecision], If[LessEqual[b, 1.1e-52], c, If[LessEqual[b, 2.05e+21], N[(x * y), $MachinePrecision], If[LessEqual[b, 3.6e+101], c, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -2.3 \cdot 10^{-297}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \leq 1.1 \cdot 10^{-52}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \leq 2.05 \cdot 10^{+21}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{+101}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.99999999999999983e-65 or 3.60000000000000029e101 < b

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999983e-65 < b < -2.2999999999999999e-297 or 1.10000000000000005e-52 < b < 2.05e21

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

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

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

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

    if -2.2999999999999999e-297 < b < 1.10000000000000005e-52 or 2.05e21 < b < 3.60000000000000029e101

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-65}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;b \leq -2.3 \cdot 10^{-297}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-52}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{+21}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{+101}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \end{array} \]

Alternative 8: 75.7% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -8.4000000000000003e-50 or 8.5000000000000001e165 < b

    1. Initial program 98.1%

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

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

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

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

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

    if -8.4000000000000003e-50 < b < 8.5000000000000001e165

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

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

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

Alternative 9: 37.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;b \leq -5.5 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-296}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-15}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{+41}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* a (* b -0.25))))
   (if (<= b -5.5e-65)
     t_1
     (if (<= b -1.3e-296)
       (* x y)
       (if (<= b 5.5e-15) c (if (<= b 3.1e+41) (* t (* z 0.0625)) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = a * (b * -0.25);
	double tmp;
	if (b <= -5.5e-65) {
		tmp = t_1;
	} else if (b <= -1.3e-296) {
		tmp = x * y;
	} else if (b <= 5.5e-15) {
		tmp = c;
	} else if (b <= 3.1e+41) {
		tmp = t * (z * 0.0625);
	} 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 = a * (b * (-0.25d0))
    if (b <= (-5.5d-65)) then
        tmp = t_1
    else if (b <= (-1.3d-296)) then
        tmp = x * y
    else if (b <= 5.5d-15) then
        tmp = c
    else if (b <= 3.1d+41) then
        tmp = t * (z * 0.0625d0)
    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 = a * (b * -0.25);
	double tmp;
	if (b <= -5.5e-65) {
		tmp = t_1;
	} else if (b <= -1.3e-296) {
		tmp = x * y;
	} else if (b <= 5.5e-15) {
		tmp = c;
	} else if (b <= 3.1e+41) {
		tmp = t * (z * 0.0625);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = a * (b * -0.25)
	tmp = 0
	if b <= -5.5e-65:
		tmp = t_1
	elif b <= -1.3e-296:
		tmp = x * y
	elif b <= 5.5e-15:
		tmp = c
	elif b <= 3.1e+41:
		tmp = t * (z * 0.0625)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(a * Float64(b * -0.25))
	tmp = 0.0
	if (b <= -5.5e-65)
		tmp = t_1;
	elseif (b <= -1.3e-296)
		tmp = Float64(x * y);
	elseif (b <= 5.5e-15)
		tmp = c;
	elseif (b <= 3.1e+41)
		tmp = Float64(t * Float64(z * 0.0625));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = a * (b * -0.25);
	tmp = 0.0;
	if (b <= -5.5e-65)
		tmp = t_1;
	elseif (b <= -1.3e-296)
		tmp = x * y;
	elseif (b <= 5.5e-15)
		tmp = c;
	elseif (b <= 3.1e+41)
		tmp = t * (z * 0.0625);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.5e-65], t$95$1, If[LessEqual[b, -1.3e-296], N[(x * y), $MachinePrecision], If[LessEqual[b, 5.5e-15], c, If[LessEqual[b, 3.1e+41], N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -1.3 \cdot 10^{-296}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \leq 5.5 \cdot 10^{-15}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{+41}:\\
\;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -5.4999999999999999e-65 or 3.1e41 < b

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999999e-65 < b < -1.3e-296

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

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

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

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

    if -1.3e-296 < b < 5.5000000000000002e-15

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

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

    if 5.5000000000000002e-15 < b < 3.1e41

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{-65}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-296}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-15}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{+41}:\\ \;\;\;\;t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot -0.25\right)\\ \end{array} \]

Alternative 10: 40.3% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{-79} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+42}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.5e-79 or 1.15e42 < (*.f64 x y)

    1. Initial program 99.1%

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

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

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

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

    if -1.5e-79 < (*.f64 x y) < 1.15e42

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{-79} \lor \neg \left(x \cdot y \leq 1.15 \cdot 10^{+42}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 11: 51.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+82} \lor \neg \left(a \leq 4 \cdot 10^{-52}\right):\\
\;\;\;\;a \cdot \left(b \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.9999999999999999e82 or 4e-52 < a

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e82 < a < 4e-52

    1. Initial program 99.3%

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

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

      \[\leadsto \color{blue}{c + x \cdot y} \]
    4. Step-by-step derivation
      1. +-commutative62.6%

        \[\leadsto \color{blue}{x \cdot y + c} \]
    5. Simplified62.6%

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

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

Alternative 12: 22.5% 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 99.2%

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

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

    \[\leadsto c \]

Reproduce

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