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

Percentage Accurate: 97.5% → 98.9%
Time: 7.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 97.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.9% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\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. sub-neg98.4%

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

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

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

      \[\leadsto \left(x \cdot y + \frac{z \cdot t}{16}\right) + \left(-\color{blue}{\left(--1\right)}\right) \cdot \left(\frac{a \cdot b}{4} - c\right) \]
    6. cancel-sign-sub-inv98.4%

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

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

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

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

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

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

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

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

Alternative 3: 42.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b \cdot a\right) \cdot -0.25\\ \mathbf{if}\;b \cdot a \leq -1.4 \cdot 10^{+162}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -4.7 \cdot 10^{+16}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -1.2 \cdot 10^{-45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-259}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 8.2 \cdot 10^{-114}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+14}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+131}:\\ \;\;\;\;c\\ \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 (<= (* b a) -1.4e+162)
     t_1
     (if (<= (* b a) -4.7e+16)
       c
       (if (<= (* b a) -1.2e-45)
         t_1
         (if (<= (* b a) -4.4e-259)
           (* x y)
           (if (<= (* b a) 8.2e-114)
             (* (* t z) 0.0625)
             (if (<= (* b a) 4.2e+14)
               (* x y)
               (if (<= (* b a) 4.2e+131) c 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 ((b * a) <= -1.4e+162) {
		tmp = t_1;
	} else if ((b * a) <= -4.7e+16) {
		tmp = c;
	} else if ((b * a) <= -1.2e-45) {
		tmp = t_1;
	} else if ((b * a) <= -4.4e-259) {
		tmp = x * y;
	} else if ((b * a) <= 8.2e-114) {
		tmp = (t * z) * 0.0625;
	} else if ((b * a) <= 4.2e+14) {
		tmp = x * y;
	} else if ((b * a) <= 4.2e+131) {
		tmp = c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (b * a) * (-0.25d0)
    if ((b * a) <= (-1.4d+162)) then
        tmp = t_1
    else if ((b * a) <= (-4.7d+16)) then
        tmp = c
    else if ((b * a) <= (-1.2d-45)) then
        tmp = t_1
    else if ((b * a) <= (-4.4d-259)) then
        tmp = x * y
    else if ((b * a) <= 8.2d-114) then
        tmp = (t * z) * 0.0625d0
    else if ((b * a) <= 4.2d+14) then
        tmp = x * y
    else if ((b * a) <= 4.2d+131) then
        tmp = c
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (b * a) * -0.25;
	double tmp;
	if ((b * a) <= -1.4e+162) {
		tmp = t_1;
	} else if ((b * a) <= -4.7e+16) {
		tmp = c;
	} else if ((b * a) <= -1.2e-45) {
		tmp = t_1;
	} else if ((b * a) <= -4.4e-259) {
		tmp = x * y;
	} else if ((b * a) <= 8.2e-114) {
		tmp = (t * z) * 0.0625;
	} else if ((b * a) <= 4.2e+14) {
		tmp = x * y;
	} else if ((b * a) <= 4.2e+131) {
		tmp = c;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (b * a) * -0.25
	tmp = 0
	if (b * a) <= -1.4e+162:
		tmp = t_1
	elif (b * a) <= -4.7e+16:
		tmp = c
	elif (b * a) <= -1.2e-45:
		tmp = t_1
	elif (b * a) <= -4.4e-259:
		tmp = x * y
	elif (b * a) <= 8.2e-114:
		tmp = (t * z) * 0.0625
	elif (b * a) <= 4.2e+14:
		tmp = x * y
	elif (b * a) <= 4.2e+131:
		tmp = c
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(b * a) * -0.25)
	tmp = 0.0
	if (Float64(b * a) <= -1.4e+162)
		tmp = t_1;
	elseif (Float64(b * a) <= -4.7e+16)
		tmp = c;
	elseif (Float64(b * a) <= -1.2e-45)
		tmp = t_1;
	elseif (Float64(b * a) <= -4.4e-259)
		tmp = Float64(x * y);
	elseif (Float64(b * a) <= 8.2e-114)
		tmp = Float64(Float64(t * z) * 0.0625);
	elseif (Float64(b * a) <= 4.2e+14)
		tmp = Float64(x * y);
	elseif (Float64(b * a) <= 4.2e+131)
		tmp = c;
	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 ((b * a) <= -1.4e+162)
		tmp = t_1;
	elseif ((b * a) <= -4.7e+16)
		tmp = c;
	elseif ((b * a) <= -1.2e-45)
		tmp = t_1;
	elseif ((b * a) <= -4.4e-259)
		tmp = x * y;
	elseif ((b * a) <= 8.2e-114)
		tmp = (t * z) * 0.0625;
	elseif ((b * a) <= 4.2e+14)
		tmp = x * y;
	elseif ((b * a) <= 4.2e+131)
		tmp = c;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(b * a), $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[N[(b * a), $MachinePrecision], -1.4e+162], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -4.7e+16], c, If[LessEqual[N[(b * a), $MachinePrecision], -1.2e-45], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], -4.4e-259], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 8.2e-114], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4.2e+14], N[(x * y), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4.2e+131], c, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \cdot a \leq -4.7 \cdot 10^{+16}:\\
\;\;\;\;c\\

\mathbf{elif}\;b \cdot a \leq -1.2 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-259}:\\
\;\;\;\;x \cdot y\\

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

\mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+14}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+131}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -1.39999999999999995e162 or -4.7e16 < (*.f64 a b) < -1.19999999999999995e-45 or 4.19999999999999971e131 < (*.f64 a b)

    1. Initial program 95.1%

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

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

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

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

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

    if -1.39999999999999995e162 < (*.f64 a b) < -4.7e16 or 4.2e14 < (*.f64 a b) < 4.19999999999999971e131

    1. Initial program 100.0%

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

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

    if -1.19999999999999995e-45 < (*.f64 a b) < -4.40000000000000019e-259 or 8.1999999999999993e-114 < (*.f64 a b) < 4.2e14

    1. Initial program 100.0%

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

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

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

    if -4.40000000000000019e-259 < (*.f64 a b) < 8.1999999999999993e-114

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \cdot a \leq -1.4 \cdot 10^{+162}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -4.7 \cdot 10^{+16}:\\ \;\;\;\;c\\ \mathbf{elif}\;b \cdot a \leq -1.2 \cdot 10^{-45}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \mathbf{elif}\;b \cdot a \leq -4.4 \cdot 10^{-259}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 8.2 \cdot 10^{-114}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+14}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;b \cdot a \leq 4.2 \cdot 10^{+131}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;\left(b \cdot a\right) \cdot -0.25\\ \end{array} \]

Alternative 4: 63.4% accurate, 0.7× 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}\;b \cdot a \leq -1 \cdot 10^{-45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-251}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-119}:\\ \;\;\;\;c + t \cdot \frac{z}{16}\\ \mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+93}:\\ \;\;\;\;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 (<= (* b a) -1e-45)
     t_2
     (if (<= (* b a) -2e-251)
       t_1
       (if (<= (* b a) 5e-119)
         (+ c (* t (/ z 16.0)))
         (if (<= (* b a) 4e+93) 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 ((b * a) <= -1e-45) {
		tmp = t_2;
	} else if ((b * a) <= -2e-251) {
		tmp = t_1;
	} else if ((b * a) <= 5e-119) {
		tmp = c + (t * (z / 16.0));
	} else if ((b * a) <= 4e+93) {
		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 ((b * a) <= (-1d-45)) then
        tmp = t_2
    else if ((b * a) <= (-2d-251)) then
        tmp = t_1
    else if ((b * a) <= 5d-119) then
        tmp = c + (t * (z / 16.0d0))
    else if ((b * a) <= 4d+93) 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 ((b * a) <= -1e-45) {
		tmp = t_2;
	} else if ((b * a) <= -2e-251) {
		tmp = t_1;
	} else if ((b * a) <= 5e-119) {
		tmp = c + (t * (z / 16.0));
	} else if ((b * a) <= 4e+93) {
		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 (b * a) <= -1e-45:
		tmp = t_2
	elif (b * a) <= -2e-251:
		tmp = t_1
	elif (b * a) <= 5e-119:
		tmp = c + (t * (z / 16.0))
	elif (b * a) <= 4e+93:
		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 (Float64(b * a) <= -1e-45)
		tmp = t_2;
	elseif (Float64(b * a) <= -2e-251)
		tmp = t_1;
	elseif (Float64(b * a) <= 5e-119)
		tmp = Float64(c + Float64(t * Float64(z / 16.0)));
	elseif (Float64(b * a) <= 4e+93)
		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 ((b * a) <= -1e-45)
		tmp = t_2;
	elseif ((b * a) <= -2e-251)
		tmp = t_1;
	elseif ((b * a) <= 5e-119)
		tmp = c + (t * (z / 16.0));
	elseif ((b * a) <= 4e+93)
		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[N[(b * a), $MachinePrecision], -1e-45], t$95$2, If[LessEqual[N[(b * a), $MachinePrecision], -2e-251], t$95$1, If[LessEqual[N[(b * a), $MachinePrecision], 5e-119], N[(c + N[(t * N[(z / 16.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * a), $MachinePrecision], 4e+93], 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}\;b \cdot a \leq -1 \cdot 10^{-45}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-251}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \cdot a \leq 5 \cdot 10^{-119}:\\
\;\;\;\;c + t \cdot \frac{z}{16}\\

\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+93}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -9.99999999999999984e-46 or 4.00000000000000017e93 < (*.f64 a b)

    1. Initial program 96.4%

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

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

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

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

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

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

    if -9.99999999999999984e-46 < (*.f64 a b) < -2.00000000000000003e-251 or 4.99999999999999993e-119 < (*.f64 a b) < 4.00000000000000017e93

    1. Initial program 100.0%

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

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

    if -2.00000000000000003e-251 < (*.f64 a b) < 4.99999999999999993e-119

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 64.8% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;b \cdot a \leq 4 \cdot 10^{+93}:\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -9.99999999999999984e-46 or 4.00000000000000017e93 < (*.f64 a b)

    1. Initial program 96.4%

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

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

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

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

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

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

    if -9.99999999999999984e-46 < (*.f64 a b) < 5.00000000000000009e-88

    1. Initial program 100.0%

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

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

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

    if 5.00000000000000009e-88 < (*.f64 a b) < 4.00000000000000017e93

    1. Initial program 100.0%

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

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

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

Alternative 6: 85.8% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 94.5%

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

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

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

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

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

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

    if -4.0000000000000002e152 < (*.f64 a b) < 4.99999999999999961e133

    1. Initial program 100.0%

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

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

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

Alternative 7: 89.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2e110 or 3.9999999999999999e99 < (*.f64 a b)

    1. Initial program 95.3%

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

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

    if -2e110 < (*.f64 a b) < 3.9999999999999999e99

    1. Initial program 100.0%

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

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

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

Alternative 8: 97.5% accurate, 1.0× speedup?

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

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

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

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

Alternative 9: 63.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -1 \cdot 10^{-45} \lor \neg \left(b \cdot a \leq 4 \cdot 10^{+93}\right):\\
\;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -9.99999999999999984e-46 or 4.00000000000000017e93 < (*.f64 a b)

    1. Initial program 96.4%

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

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

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

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

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

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

    if -9.99999999999999984e-46 < (*.f64 a b) < 4.00000000000000017e93

    1. Initial program 100.0%

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

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

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

Alternative 10: 62.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \cdot a \leq -3.8 \cdot 10^{+162} \lor \neg \left(b \cdot a \leq 2.8 \cdot 10^{+132}\right):\\
\;\;\;\;\left(b \cdot a\right) \cdot -0.25\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -3.80000000000000024e162 or 2.7999999999999999e132 < (*.f64 a b)

    1. Initial program 94.4%

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

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

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

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

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

    if -3.80000000000000024e162 < (*.f64 a b) < 2.7999999999999999e132

    1. Initial program 100.0%

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

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

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

Alternative 11: 37.1% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
t_1 := \left(t \cdot z\right) \cdot 0.0625\\
\mathbf{if}\;t \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -5.5 \cdot 10^{-241}:\\
\;\;\;\;c\\

\mathbf{elif}\;t \leq 1.18 \cdot 10^{+148}:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1e-62 or 1.18e148 < t

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{z}{16} \cdot t} + c \]
      8. *-commutative57.9%

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

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

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

    if -1e-62 < t < -5.4999999999999998e-241

    1. Initial program 94.1%

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

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

    if -5.4999999999999998e-241 < t < 1.18e148

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-62}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-241}:\\ \;\;\;\;c\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{+148}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \end{array} \]

Alternative 12: 37.6% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;c \leq 1.8 \cdot 10^{+81}:\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.15e63 or 1.80000000000000003e81 < c

    1. Initial program 100.0%

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

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

    if -2.15e63 < c < 1.80000000000000003e81

    1. Initial program 97.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.15 \cdot 10^{+63}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{+81}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 13: 21.5% accurate, 17.0× speedup?

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

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

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

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

    \[\leadsto c \]

Reproduce

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