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

Percentage Accurate: 97.5% → 98.9%
Time: 15.1s
Alternatives: 16
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto \color{blue}{\left(\left(-0.25 \cdot \left(a \cdot b\right)\right) + y \cdot x\right)} + c \]
      3. distribute-lft-neg-in30.0%

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

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

        \[\leadsto \left(\color{blue}{\left(-0.25 \cdot a\right) \cdot b} + y \cdot x\right) + c \]
      6. *-commutative30.0%

        \[\leadsto \left(\color{blue}{\left(a \cdot -0.25\right)} \cdot b + y \cdot x\right) + c \]
      7. *-commutative30.0%

        \[\leadsto \left(\left(a \cdot -0.25\right) \cdot b + \color{blue}{x \cdot y}\right) + c \]
      8. fma-def60.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, x \cdot y\right)} + c \]
      9. *-commutative60.0%

        \[\leadsto \mathsf{fma}\left(a \cdot -0.25, b, \color{blue}{y \cdot x}\right) + c \]
    4. Simplified60.0%

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

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

Alternative 2: 98.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.9% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

      \[\leadsto \color{blue}{y \cdot x - 0.25 \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv30.0%

        \[\leadsto \color{blue}{y \cdot x + \left(-0.25\right) \cdot \left(a \cdot b\right)} \]
      2. metadata-eval30.0%

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

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

        \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot -0.25 + y \cdot x} \]
      5. *-commutative30.0%

        \[\leadsto \color{blue}{-0.25 \cdot \left(a \cdot b\right)} + y \cdot x \]
      6. associate-*r*30.0%

        \[\leadsto \color{blue}{\left(-0.25 \cdot a\right) \cdot b} + y \cdot x \]
      7. *-commutative30.0%

        \[\leadsto \color{blue}{\left(a \cdot -0.25\right)} \cdot b + y \cdot x \]
      8. fma-udef60.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot -0.25, b, y \cdot x\right)} \]
    5. Applied egg-rr60.0%

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

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

Alternative 4: 98.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef0.0%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr0.0%

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

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

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

Alternative 5: 89.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+134}:\\
\;\;\;\;c + \left(x \cdot y + t_2\right)\\

\mathbf{else}:\\
\;\;\;\;\left(c + t_2\right) - t_1\\


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

    1. Initial program 85.7%

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

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

    if -4.99999999999999981e134 < (*.f64 a b) < 3.99999999999999969e134

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

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

    if 3.99999999999999969e134 < (*.f64 a b)

    1. Initial program 93.3%

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

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

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

Alternative 6: 38.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(a \cdot b\right) \cdot -0.25\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-108}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-258}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-166}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-118}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* (* a b) -0.25)) (t_2 (* 0.0625 (* z t))))
   (if (<= z -4.6e+18)
     t_2
     (if (<= z -3.3e-108)
       t_1
       (if (<= z -4.8e-191)
         c
         (if (<= z 5.8e-258)
           (* x y)
           (if (<= z 5.5e-166)
             t_1
             (if (<= z 3.7e-118) c (if (<= z 1.9e-40) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = (a * b) * -0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if (z <= -4.6e+18) {
		tmp = t_2;
	} else if (z <= -3.3e-108) {
		tmp = t_1;
	} else if (z <= -4.8e-191) {
		tmp = c;
	} else if (z <= 5.8e-258) {
		tmp = x * y;
	} else if (z <= 5.5e-166) {
		tmp = t_1;
	} else if (z <= 3.7e-118) {
		tmp = c;
	} else if (z <= 1.9e-40) {
		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 = (a * b) * (-0.25d0)
    t_2 = 0.0625d0 * (z * t)
    if (z <= (-4.6d+18)) then
        tmp = t_2
    else if (z <= (-3.3d-108)) then
        tmp = t_1
    else if (z <= (-4.8d-191)) then
        tmp = c
    else if (z <= 5.8d-258) then
        tmp = x * y
    else if (z <= 5.5d-166) then
        tmp = t_1
    else if (z <= 3.7d-118) then
        tmp = c
    else if (z <= 1.9d-40) 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 = (a * b) * -0.25;
	double t_2 = 0.0625 * (z * t);
	double tmp;
	if (z <= -4.6e+18) {
		tmp = t_2;
	} else if (z <= -3.3e-108) {
		tmp = t_1;
	} else if (z <= -4.8e-191) {
		tmp = c;
	} else if (z <= 5.8e-258) {
		tmp = x * y;
	} else if (z <= 5.5e-166) {
		tmp = t_1;
	} else if (z <= 3.7e-118) {
		tmp = c;
	} else if (z <= 1.9e-40) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = (a * b) * -0.25
	t_2 = 0.0625 * (z * t)
	tmp = 0
	if z <= -4.6e+18:
		tmp = t_2
	elif z <= -3.3e-108:
		tmp = t_1
	elif z <= -4.8e-191:
		tmp = c
	elif z <= 5.8e-258:
		tmp = x * y
	elif z <= 5.5e-166:
		tmp = t_1
	elif z <= 3.7e-118:
		tmp = c
	elif z <= 1.9e-40:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(a * b) * -0.25)
	t_2 = Float64(0.0625 * Float64(z * t))
	tmp = 0.0
	if (z <= -4.6e+18)
		tmp = t_2;
	elseif (z <= -3.3e-108)
		tmp = t_1;
	elseif (z <= -4.8e-191)
		tmp = c;
	elseif (z <= 5.8e-258)
		tmp = Float64(x * y);
	elseif (z <= 5.5e-166)
		tmp = t_1;
	elseif (z <= 3.7e-118)
		tmp = c;
	elseif (z <= 1.9e-40)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = (a * b) * -0.25;
	t_2 = 0.0625 * (z * t);
	tmp = 0.0;
	if (z <= -4.6e+18)
		tmp = t_2;
	elseif (z <= -3.3e-108)
		tmp = t_1;
	elseif (z <= -4.8e-191)
		tmp = c;
	elseif (z <= 5.8e-258)
		tmp = x * y;
	elseif (z <= 5.5e-166)
		tmp = t_1;
	elseif (z <= 3.7e-118)
		tmp = c;
	elseif (z <= 1.9e-40)
		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[(N[(a * b), $MachinePrecision] * -0.25), $MachinePrecision]}, Block[{t$95$2 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+18], t$95$2, If[LessEqual[z, -3.3e-108], t$95$1, If[LessEqual[z, -4.8e-191], c, If[LessEqual[z, 5.8e-258], N[(x * y), $MachinePrecision], If[LessEqual[z, 5.5e-166], t$95$1, If[LessEqual[z, 3.7e-118], c, If[LessEqual[z, 1.9e-40], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.3 \cdot 10^{-108}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\
\;\;\;\;c\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-258}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-166}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 3.7 \cdot 10^{-118}:\\
\;\;\;\;c\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.6e18 or 1.8999999999999999e-40 < z

    1. Initial program 94.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef94.6%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr94.7%

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

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

    if -4.6e18 < z < -3.3000000000000002e-108 or 5.7999999999999999e-258 < z < 5.4999999999999997e-166 or 3.70000000000000014e-118 < z < 1.8999999999999999e-40

    1. Initial program 99.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.9%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr99.9%

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

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

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

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

    if -3.3000000000000002e-108 < z < -4.7999999999999998e-191 or 5.4999999999999997e-166 < z < 3.70000000000000014e-118

    1. Initial program 92.8%

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

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

    if -4.7999999999999998e-191 < z < 5.7999999999999999e-258

    1. Initial program 97.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.3%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr97.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+18}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-108}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-258}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-166}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{-118}:\\ \;\;\;\;c\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-40}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 7: 86.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

    if -4.99999999999999981e134 < (*.f64 a b) < 2e143

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

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

    if 2e143 < (*.f64 a b)

    1. Initial program 92.6%

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

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

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

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

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

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

Alternative 8: 86.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

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

    if -4.99999999999999981e134 < (*.f64 a b) < 2.0000000000000001e167

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

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

    if 2.0000000000000001e167 < (*.f64 a b)

    1. Initial program 92.3%

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

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

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

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

Alternative 9: 87.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 85.7%

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

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

    if -4.99999999999999981e134 < (*.f64 a b) < 2.0000000000000001e167

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

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

    if 2.0000000000000001e167 < (*.f64 a b)

    1. Initial program 92.3%

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

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

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

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

Alternative 10: 37.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-196}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.8 \cdot 10^{-222}:\\
\;\;\;\;c\\

\mathbf{elif}\;y \leq 3.7 \cdot 10^{-174}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-127}:\\
\;\;\;\;c\\

\mathbf{elif}\;y \leq 1.22 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.5000000000000005e-134 or 1.22e160 < y

    1. Initial program 93.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef93.8%

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

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

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

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

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

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

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

    if -4.5000000000000005e-134 < y < -6.59999999999999997e-196 or -1.79999999999999987e-222 < y < 3.7000000000000001e-174 or 2.1000000000000001e-127 < y < 1.22e160

    1. Initial program 97.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.5%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr97.6%

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

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

    if -6.59999999999999997e-196 < y < -1.79999999999999987e-222 or 3.7000000000000001e-174 < y < 2.1000000000000001e-127

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-134}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-196}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-222}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-174}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-127}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+160}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 58.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+121}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+138}:\\ \;\;\;\;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 (+ c (* z (* t 0.0625)))))
   (if (<= y -4.8e-134)
     (+ c (* x y))
     (if (<= y 2.6e+25)
       t_1
       (if (<= y 8.5e+121)
         (+ c (* b (* a -0.25)))
         (if (<= y 1.2e+138) 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 = c + (z * (t * 0.0625));
	double tmp;
	if (y <= -4.8e-134) {
		tmp = c + (x * y);
	} else if (y <= 2.6e+25) {
		tmp = t_1;
	} else if (y <= 8.5e+121) {
		tmp = c + (b * (a * -0.25));
	} else if (y <= 1.2e+138) {
		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) :: tmp
    t_1 = c + (z * (t * 0.0625d0))
    if (y <= (-4.8d-134)) then
        tmp = c + (x * y)
    else if (y <= 2.6d+25) then
        tmp = t_1
    else if (y <= 8.5d+121) then
        tmp = c + (b * (a * (-0.25d0)))
    else if (y <= 1.2d+138) 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 = c + (z * (t * 0.0625));
	double tmp;
	if (y <= -4.8e-134) {
		tmp = c + (x * y);
	} else if (y <= 2.6e+25) {
		tmp = t_1;
	} else if (y <= 8.5e+121) {
		tmp = c + (b * (a * -0.25));
	} else if (y <= 1.2e+138) {
		tmp = t_1;
	} else {
		tmp = (x * y) - ((a * b) * 0.25);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = c + (z * (t * 0.0625))
	tmp = 0
	if y <= -4.8e-134:
		tmp = c + (x * y)
	elif y <= 2.6e+25:
		tmp = t_1
	elif y <= 8.5e+121:
		tmp = c + (b * (a * -0.25))
	elif y <= 1.2e+138:
		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(c + Float64(z * Float64(t * 0.0625)))
	tmp = 0.0
	if (y <= -4.8e-134)
		tmp = Float64(c + Float64(x * y));
	elseif (y <= 2.6e+25)
		tmp = t_1;
	elseif (y <= 8.5e+121)
		tmp = Float64(c + Float64(b * Float64(a * -0.25)));
	elseif (y <= 1.2e+138)
		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 = c + (z * (t * 0.0625));
	tmp = 0.0;
	if (y <= -4.8e-134)
		tmp = c + (x * y);
	elseif (y <= 2.6e+25)
		tmp = t_1;
	elseif (y <= 8.5e+121)
		tmp = c + (b * (a * -0.25));
	elseif (y <= 1.2e+138)
		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[(c + N[(z * N[(t * 0.0625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e-134], N[(c + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+25], t$95$1, If[LessEqual[y, 8.5e+121], N[(c + N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+138], 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 := c + z \cdot \left(t \cdot 0.0625\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\
\;\;\;\;c + x \cdot y\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{+25}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+138}:\\
\;\;\;\;t_1\\

\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 y < -4.80000000000000019e-134

    1. Initial program 94.2%

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

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

    if -4.80000000000000019e-134 < y < 2.5999999999999998e25 or 8.5e121 < y < 1.2e138

    1. Initial program 99.1%

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

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

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

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

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

    if 2.5999999999999998e25 < y < 8.5e121

    1. Initial program 88.9%

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

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

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

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

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

    if 1.2e138 < y

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+25}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+121}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+138}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y - \left(a \cdot b\right) \cdot 0.25\\ \end{array} \]

Alternative 12: 58.0% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 4 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.38 \cdot 10^{+160}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.80000000000000019e-134 or 1.38e160 < y

    1. Initial program 93.9%

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

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

    if -4.80000000000000019e-134 < y < 4e20 or 3.19999999999999982e120 < y < 1.38e160

    1. Initial program 99.1%

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

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

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

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

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

    if 4e20 < y < 3.19999999999999982e120

    1. Initial program 88.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-134}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+20}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+120}:\\ \;\;\;\;c + b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{+160}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 13: 49.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-96}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.1999999999999999e186 or 1.35e-96 < z

    1. Initial program 97.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef97.1%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr97.3%

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

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

    if -3.1999999999999999e186 < z < -2.00000000000000002e-50 or -3.39999999999999982e-106 < z < 1.35e-96

    1. Initial program 94.6%

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

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

    if -2.00000000000000002e-50 < z < -3.39999999999999982e-106

    1. Initial program 100.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef99.7%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr99.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+186}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-50}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;z \leq -3.4 \cdot 10^{-106}:\\ \;\;\;\;\left(a \cdot b\right) \cdot -0.25\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-96}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 14: 57.8% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-134} \lor \neg \left(y \leq 9.6 \cdot 10^{+159}\right):\\
\;\;\;\;c + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.80000000000000019e-134 or 9.5999999999999999e159 < y

    1. Initial program 93.9%

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

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

    if -4.80000000000000019e-134 < y < 9.5999999999999999e159

    1. Initial program 97.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{-134} \lor \neg \left(y \leq 9.6 \cdot 10^{+159}\right):\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \end{array} \]

Alternative 15: 35.7% accurate, 2.4× speedup?

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

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

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-80}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.22e69 or 1.50000000000000004e-80 < x

    1. Initial program 92.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{t}{\frac{16}{z}}\right) - \left(\frac{a}{\frac{4}{b}} - c\right)} \]
    4. Step-by-step derivation
      1. fma-udef92.9%

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

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

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

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

        \[\leadsto \left(x \cdot y + t \cdot \left(z \cdot \color{blue}{0.0625}\right)\right) - \left(\frac{a}{\frac{4}{b}} - c\right) \]
    5. Applied egg-rr92.9%

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

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

    if -1.22e69 < x < 1.50000000000000004e-80

    1. Initial program 99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.22 \cdot 10^{+69}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-80}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 22.2% accurate, 17.0× speedup?

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

\\
c
\end{array}
Derivation
  1. Initial program 96.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 22.6%

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

    \[\leadsto c \]

Reproduce

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