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

Percentage Accurate: 97.8% → 98.9%
Time: 12.4s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 97.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 65.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+47}:\\
\;\;\;\;c + t\_2\\

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-311}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e299 < (*.f64 a b) < -1.9999999999999999e200 or -5.00000000000000022e47 < (*.f64 a b) < -1.9999999999999e-311 or 1.99999999999999991e-212 < (*.f64 a b) < 4.99999999999999977e36

    1. Initial program 100.0%

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

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

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

    if -1.9999999999999999e200 < (*.f64 a b) < -5.00000000000000022e47

    1. Initial program 99.9%

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

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

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

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

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

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

    if -1.9999999999999e-311 < (*.f64 a b) < 1.99999999999999991e-212

    1. Initial program 100.0%

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

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

    if 4.99999999999999977e36 < (*.f64 a b)

    1. Initial program 95.5%

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

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

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

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

Alternative 4: 44.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -8.5 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-305}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;c\\

\mathbf{elif}\;x \cdot y \leq 7.5 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 97.7%

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

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

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

    if -1.4499999999999999e154 < (*.f64 x y) < -8.4999999999999997e-146 or -3.99999999999999999e-305 < (*.f64 x y) < 2.80000000000000016e-130 or 1.2e15 < (*.f64 x y) < 7.49999999999999959e68

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999997e-146 < (*.f64 x y) < -3.99999999999999999e-305 or 2.80000000000000016e-130 < (*.f64 x y) < 1.2e15

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{c} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 68.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := x \cdot y + t\_2\\ \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+70}:\\ \;\;\;\;t\_2 + \left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-20}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-311}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-212}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+36}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* x y))) (t_2 (* 0.0625 (* z t))) (t_3 (+ (* x y) t_2)))
   (if (<= (* a b) -2e+70)
     (+ t_2 (* (* a b) -0.25))
     (if (<= (* a b) -4e-20)
       t_1
       (if (<= (* a b) -2e-311)
         t_3
         (if (<= (* a b) 2e-212)
           t_1
           (if (<= (* a b) 5e+36) t_3 (- (* x y) (* (* a b) 0.25)))))))))
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 = 0.0625 * (z * t);
	double t_3 = (x * y) + t_2;
	double tmp;
	if ((a * b) <= -2e+70) {
		tmp = t_2 + ((a * b) * -0.25);
	} else if ((a * b) <= -4e-20) {
		tmp = t_1;
	} else if ((a * b) <= -2e-311) {
		tmp = t_3;
	} else if ((a * b) <= 2e-212) {
		tmp = t_1;
	} else if ((a * b) <= 5e+36) {
		tmp = t_3;
	} else {
		tmp = (x * y) - ((a * b) * 0.25);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = c + (x * y)
    t_2 = 0.0625d0 * (z * t)
    t_3 = (x * y) + t_2
    if ((a * b) <= (-2d+70)) then
        tmp = t_2 + ((a * b) * (-0.25d0))
    else if ((a * b) <= (-4d-20)) then
        tmp = t_1
    else if ((a * b) <= (-2d-311)) then
        tmp = t_3
    else if ((a * b) <= 2d-212) then
        tmp = t_1
    else if ((a * b) <= 5d+36) then
        tmp = t_3
    else
        tmp = (x * y) - ((a * b) * 0.25d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (x * y);
	double t_2 = 0.0625 * (z * t);
	double t_3 = (x * y) + t_2;
	double tmp;
	if ((a * b) <= -2e+70) {
		tmp = t_2 + ((a * b) * -0.25);
	} else if ((a * b) <= -4e-20) {
		tmp = t_1;
	} else if ((a * b) <= -2e-311) {
		tmp = t_3;
	} else if ((a * b) <= 2e-212) {
		tmp = t_1;
	} else if ((a * b) <= 5e+36) {
		tmp = t_3;
	} else {
		tmp = (x * y) - ((a * b) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (x * y)
	t_2 = 0.0625 * (z * t)
	t_3 = (x * y) + t_2
	tmp = 0
	if (a * b) <= -2e+70:
		tmp = t_2 + ((a * b) * -0.25)
	elif (a * b) <= -4e-20:
		tmp = t_1
	elif (a * b) <= -2e-311:
		tmp = t_3
	elif (a * b) <= 2e-212:
		tmp = t_1
	elif (a * b) <= 5e+36:
		tmp = t_3
	else:
		tmp = (x * y) - ((a * b) * 0.25)
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(x * y))
	t_2 = Float64(0.0625 * Float64(z * t))
	t_3 = Float64(Float64(x * y) + t_2)
	tmp = 0.0
	if (Float64(a * b) <= -2e+70)
		tmp = Float64(t_2 + Float64(Float64(a * b) * -0.25));
	elseif (Float64(a * b) <= -4e-20)
		tmp = t_1;
	elseif (Float64(a * b) <= -2e-311)
		tmp = t_3;
	elseif (Float64(a * b) <= 2e-212)
		tmp = t_1;
	elseif (Float64(a * b) <= 5e+36)
		tmp = t_3;
	else
		tmp = Float64(Float64(x * y) - Float64(Float64(a * b) * 0.25));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (x * y);
	t_2 = 0.0625 * (z * t);
	t_3 = (x * y) + t_2;
	tmp = 0.0;
	if ((a * b) <= -2e+70)
		tmp = t_2 + ((a * b) * -0.25);
	elseif ((a * b) <= -4e-20)
		tmp = t_1;
	elseif ((a * b) <= -2e-311)
		tmp = t_3;
	elseif ((a * b) <= 2e-212)
		tmp = t_1;
	elseif ((a * b) <= 5e+36)
		tmp = t_3;
	else
		tmp = (x * y) - ((a * b) * 0.25);
	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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+70], N[(t$95$2 + N[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -4e-20], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2e-311], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 2e-212], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5e+36], t$95$3, N[(N[(x * y), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -4 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-311}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+36}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 97.7%

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t - 0.25 \cdot \frac{a \cdot b}{z}\right)} \]
    6. Taylor expanded in z around 0 80.6%

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

    if -2.00000000000000015e70 < (*.f64 a b) < -3.99999999999999978e-20 or -1.9999999999999e-311 < (*.f64 a b) < 1.99999999999999991e-212

    1. Initial program 100.0%

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

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

    if -3.99999999999999978e-20 < (*.f64 a b) < -1.9999999999999e-311 or 1.99999999999999991e-212 < (*.f64 a b) < 4.99999999999999977e36

    1. Initial program 100.0%

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

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

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

    if 4.99999999999999977e36 < (*.f64 a b)

    1. Initial program 95.5%

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

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

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

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

Alternative 6: 61.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + t \cdot \left(z \cdot 0.0625\right)\\ t_2 := x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;y \leq -400:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-184}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-267}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+87}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (+ c (* t (* z 0.0625))))
        (t_2 (+ (* x y) (* 0.0625 (* z t))))
        (t_3 (+ c (* b (* a -0.25)))))
   (if (<= y -400.0)
     t_2
     (if (<= y -1.9e-184)
       t_1
       (if (<= y 6e-267)
         t_3
         (if (<= y 1.4e-101) t_1 (if (<= y 6.4e+87) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = c + (t * (z * 0.0625));
	double t_2 = (x * y) + (0.0625 * (z * t));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (y <= -400.0) {
		tmp = t_2;
	} else if (y <= -1.9e-184) {
		tmp = t_1;
	} else if (y <= 6e-267) {
		tmp = t_3;
	} else if (y <= 1.4e-101) {
		tmp = t_1;
	} else if (y <= 6.4e+87) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = c + (t * (z * 0.0625d0))
    t_2 = (x * y) + (0.0625d0 * (z * t))
    t_3 = c + (b * (a * (-0.25d0)))
    if (y <= (-400.0d0)) then
        tmp = t_2
    else if (y <= (-1.9d-184)) then
        tmp = t_1
    else if (y <= 6d-267) then
        tmp = t_3
    else if (y <= 1.4d-101) then
        tmp = t_1
    else if (y <= 6.4d+87) then
        tmp = t_3
    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 + (t * (z * 0.0625));
	double t_2 = (x * y) + (0.0625 * (z * t));
	double t_3 = c + (b * (a * -0.25));
	double tmp;
	if (y <= -400.0) {
		tmp = t_2;
	} else if (y <= -1.9e-184) {
		tmp = t_1;
	} else if (y <= 6e-267) {
		tmp = t_3;
	} else if (y <= 1.4e-101) {
		tmp = t_1;
	} else if (y <= 6.4e+87) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (t * (z * 0.0625))
	t_2 = (x * y) + (0.0625 * (z * t))
	t_3 = c + (b * (a * -0.25))
	tmp = 0
	if y <= -400.0:
		tmp = t_2
	elif y <= -1.9e-184:
		tmp = t_1
	elif y <= 6e-267:
		tmp = t_3
	elif y <= 1.4e-101:
		tmp = t_1
	elif y <= 6.4e+87:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(c + Float64(t * Float64(z * 0.0625)))
	t_2 = Float64(Float64(x * y) + Float64(0.0625 * Float64(z * t)))
	t_3 = Float64(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (y <= -400.0)
		tmp = t_2;
	elseif (y <= -1.9e-184)
		tmp = t_1;
	elseif (y <= 6e-267)
		tmp = t_3;
	elseif (y <= 1.4e-101)
		tmp = t_1;
	elseif (y <= 6.4e+87)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = c + (t * (z * 0.0625));
	t_2 = (x * y) + (0.0625 * (z * t));
	t_3 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (y <= -400.0)
		tmp = t_2;
	elseif (y <= -1.9e-184)
		tmp = t_1;
	elseif (y <= 6e-267)
		tmp = t_3;
	elseif (y <= 1.4e-101)
		tmp = t_1;
	elseif (y <= 6.4e+87)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -400.0], t$95$2, If[LessEqual[y, -1.9e-184], t$95$1, If[LessEqual[y, 6e-267], t$95$3, If[LessEqual[y, 1.4e-101], t$95$1, If[LessEqual[y, 6.4e+87], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-267}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{-101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 6.4 \cdot 10^{+87}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -400 or 6.4000000000000001e87 < y

    1. Initial program 97.2%

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

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

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

    if -400 < y < -1.90000000000000008e-184 or 5.9999999999999999e-267 < y < 1.39999999999999995e-101

    1. Initial program 98.6%

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

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

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

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

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

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

    if -1.90000000000000008e-184 < y < 5.9999999999999999e-267 or 1.39999999999999995e-101 < y < 6.4000000000000001e87

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -400:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-184}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-267}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-101}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+87}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + 0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq -5 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1.55 \cdot 10^{-258}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;a \leq 3.75 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.52000000000000003e109

    1. Initial program 96.1%

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

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

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

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

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

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

    if -1.52000000000000003e109 < a < -4.99999999999999973e65 or -1.54999999999999999e-258 < a < 3.7500000000000001e-6

    1. Initial program 100.0%

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

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

    if -4.99999999999999973e65 < a < -1.54999999999999999e-258

    1. Initial program 100.0%

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

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

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

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

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

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

    if 3.7500000000000001e-6 < a

    1. Initial program 96.1%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.52 \cdot 10^{+109}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq -5 \cdot 10^{+65}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq -1.55 \cdot 10^{-258}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;a \leq 3.75 \cdot 10^{-6}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25 + \frac{c}{b}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 60.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;a \leq -1.7 \cdot 10^{+109}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -5.2 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-263}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;a \leq 0.19:\\ \;\;\;\;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 (+ c (* b (* a -0.25)))))
   (if (<= a -1.7e+109)
     t_2
     (if (<= a -5.2e+64)
       t_1
       (if (<= a -4e-263)
         (+ c (* t (* z 0.0625)))
         (if (<= a 0.19) 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 = c + (b * (a * -0.25));
	double tmp;
	if (a <= -1.7e+109) {
		tmp = t_2;
	} else if (a <= -5.2e+64) {
		tmp = t_1;
	} else if (a <= -4e-263) {
		tmp = c + (t * (z * 0.0625));
	} else if (a <= 0.19) {
		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 = c + (b * (a * (-0.25d0)))
    if (a <= (-1.7d+109)) then
        tmp = t_2
    else if (a <= (-5.2d+64)) then
        tmp = t_1
    else if (a <= (-4d-263)) then
        tmp = c + (t * (z * 0.0625d0))
    else if (a <= 0.19d0) 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 = c + (b * (a * -0.25));
	double tmp;
	if (a <= -1.7e+109) {
		tmp = t_2;
	} else if (a <= -5.2e+64) {
		tmp = t_1;
	} else if (a <= -4e-263) {
		tmp = c + (t * (z * 0.0625));
	} else if (a <= 0.19) {
		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 = c + (b * (a * -0.25))
	tmp = 0
	if a <= -1.7e+109:
		tmp = t_2
	elif a <= -5.2e+64:
		tmp = t_1
	elif a <= -4e-263:
		tmp = c + (t * (z * 0.0625))
	elif a <= 0.19:
		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(c + Float64(b * Float64(a * -0.25)))
	tmp = 0.0
	if (a <= -1.7e+109)
		tmp = t_2;
	elseif (a <= -5.2e+64)
		tmp = t_1;
	elseif (a <= -4e-263)
		tmp = Float64(c + Float64(t * Float64(z * 0.0625)));
	elseif (a <= 0.19)
		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 = c + (b * (a * -0.25));
	tmp = 0.0;
	if (a <= -1.7e+109)
		tmp = t_2;
	elseif (a <= -5.2e+64)
		tmp = t_1;
	elseif (a <= -4e-263)
		tmp = c + (t * (z * 0.0625));
	elseif (a <= 0.19)
		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[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e+109], t$95$2, If[LessEqual[a, -5.2e+64], t$95$1, If[LessEqual[a, -4e-263], N[(c + N[(t * N[(z * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.19], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -5.2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -4 \cdot 10^{-263}:\\
\;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\

\mathbf{elif}\;a \leq 0.19:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.70000000000000003e109 or 0.19 < a

    1. Initial program 96.1%

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

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

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

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

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

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

    if -1.70000000000000003e109 < a < -5.19999999999999994e64 or -4e-263 < a < 0.19

    1. Initial program 100.0%

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

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

    if -5.19999999999999994e64 < a < -4e-263

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.7 \cdot 10^{+109}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq -5.2 \cdot 10^{+64}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-263}:\\ \;\;\;\;c + t \cdot \left(z \cdot 0.0625\right)\\ \mathbf{elif}\;a \leq 0.19:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 53.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -2.8 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 6.8:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.2000000000000002e162 or 6.79999999999999982 < a

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000002e162 < a < -2.80000000000000024e64 or -8.50000000000000037e-11 < a < 6.79999999999999982

    1. Initial program 100.0%

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

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

    if -2.80000000000000024e64 < a < -8.50000000000000037e-11

    1. Initial program 99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.2 \cdot 10^{+162}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq -2.8 \cdot 10^{+64}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \leq 6.8:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 40.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \leq -1.85 \cdot 10^{+64}:\\
\;\;\;\;x \cdot y\\

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

\mathbf{elif}\;a \leq 1.04 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.52000000000000003e109 or 1.04e-7 < a

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

    if -1.52000000000000003e109 < a < -1.84999999999999992e64 or -4.10000000000000026e-262 < a < 1.04e-7

    1. Initial program 100.0%

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

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

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

    if -1.84999999999999992e64 < a < -4.10000000000000026e-262

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.52 \cdot 10^{+109}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;a \leq -1.85 \cdot 10^{+64}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \leq -4.1 \cdot 10^{-262}:\\ \;\;\;\;z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \leq 1.04 \cdot 10^{-7}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 89.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+36}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\

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


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

    1. Initial program 97.7%

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

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

    if -2.00000000000000015e70 < (*.f64 a b) < 4.99999999999999977e36

    1. Initial program 100.0%

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

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

    if 4.99999999999999977e36 < (*.f64 a b)

    1. Initial program 95.5%

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

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

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

Alternative 12: 88.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+36}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\

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


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

    1. Initial program 97.0%

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t - 0.25 \cdot \frac{a \cdot b}{z}\right)} \]
    6. Taylor expanded in z around 0 88.6%

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

    if -5.00000000000000025e141 < (*.f64 a b) < 4.99999999999999977e36

    1. Initial program 100.0%

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

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

    if 4.99999999999999977e36 < (*.f64 a b)

    1. Initial program 95.5%

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

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

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

Alternative 13: 87.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+66}:\\
\;\;\;\;c + \left(x \cdot y + t\_1\right)\\

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


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

    1. Initial program 97.0%

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(0.0625 \cdot t - 0.25 \cdot \frac{a \cdot b}{z}\right)} \]
    6. Taylor expanded in z around 0 88.6%

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

    if -5.00000000000000025e141 < (*.f64 a b) < 1.99999999999999989e66

    1. Initial program 100.0%

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

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

    if 1.99999999999999989e66 < (*.f64 a b)

    1. Initial program 95.0%

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

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

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

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

Alternative 14: 64.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+155} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+65}\right):\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.00000000000000001e155 or 2e65 < (*.f64 x y)

    1. Initial program 97.7%

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

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

    if -1.00000000000000001e155 < (*.f64 x y) < 2e65

    1. Initial program 98.8%

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

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

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

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

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

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

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

Alternative 15: 41.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1700 \lor \neg \left(x \cdot y \leq 7 \cdot 10^{+123}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1700 or 6.99999999999999999e123 < (*.f64 x y)

    1. Initial program 97.0%

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

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

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

    if -1700 < (*.f64 x y) < 6.99999999999999999e123

    1. Initial program 99.3%

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

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

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

Alternative 16: 97.8% 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 98.4%

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

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

Alternative 17: 22.4% accurate, 17.0× speedup?

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

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

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

    \[\leadsto \color{blue}{c} \]
  4. Add Preprocessing

Reproduce

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