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

Percentage Accurate: 97.5% → 98.3%
Time: 8.6s
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.3% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{z}{16}, c + x \cdot y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16)) < 5.00000000000000026e300

    1. Initial program 100.0%

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

    if 5.00000000000000026e300 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) 16))

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t, \frac{z}{16}, \color{blue}{c + y \cdot x}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 2: 98.9% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(t, \frac{z}{16}, \mathsf{fma}\left(x, y, c - b \cdot \frac{a}{4}\right)\right)
\end{array}
Derivation
  1. Initial program 96.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-96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.9% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\right) + \left(c - \frac{a}{\frac{4}{b}}\right)
\end{array}
Derivation
  1. Initial program 96.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-96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.4% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;c + 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. Taylor expanded in a around 0 12.5%

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

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

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

Alternative 5: 64.3% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;b \cdot a \leq -2 \cdot 10^{-120}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;b \cdot a \leq 2 \cdot 10^{-106}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \cdot a \leq 1:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


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

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

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

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

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

    if -4.99999999999999967e145 < (*.f64 a b) < -1.99999999999999991e-57 or -1.99999999999999996e-120 < (*.f64 a b) < 1.99999999999999992e-291 or 1.99999999999999988e-106 < (*.f64 a b) < 1

    1. Initial program 97.5%

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

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

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

    if -1.99999999999999991e-57 < (*.f64 a b) < -1.99999999999999996e-120 or 1.99999999999999992e-291 < (*.f64 a b) < 1.99999999999999988e-106

    1. Initial program 97.2%

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

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

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

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

Alternative 6: 88.4% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999967e145 < (*.f64 a b) < 1

    1. Initial program 97.5%

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

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

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

Alternative 7: 88.4% accurate, 0.8× speedup?

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

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

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


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

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

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

    if -4.99999999999999967e145 < (*.f64 a b) < 1

    1. Initial program 97.5%

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

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

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

Alternative 8: 85.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -4.99999999999999967e145 or 1.99999999999999989e66 < (*.f64 a b)

    1. Initial program 95.2%

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

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

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

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

    if -4.99999999999999967e145 < (*.f64 a b) < 1.99999999999999989e66

    1. Initial program 97.7%

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

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

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

Alternative 9: 86.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -4.99999999999999967e145 or 1.99999999999999989e66 < (*.f64 a b)

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

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

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

    if -4.99999999999999967e145 < (*.f64 a b) < 1.99999999999999989e66

    1. Initial program 97.7%

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

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

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

Alternative 10: 88.1% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.50000000000000003e91 or 4.9999999999999997e-37 < (*.f64 a b)

    1. Initial program 95.5%

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

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

    if -1.50000000000000003e91 < (*.f64 a b) < 4.9999999999999997e-37

    1. Initial program 97.9%

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

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

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

Alternative 11: 39.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := b \cdot \left(a \cdot -0.25\right)\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+31}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-267}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-214}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-47}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;y \leq 3600000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1 (* b (* a -0.25))))
   (if (<= y -2.9e+31)
     (* x y)
     (if (<= y 5.2e-267)
       t_1
       (if (<= y 2.4e-214)
         c
         (if (<= y 1.05e-101)
           t_1
           (if (<= y 4.8e-47)
             (* (* t z) 0.0625)
             (if (<= y 3600000.0) t_1 (if (<= y 9.5e+70) c (* x y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = b * (a * -0.25);
	double tmp;
	if (y <= -2.9e+31) {
		tmp = x * y;
	} else if (y <= 5.2e-267) {
		tmp = t_1;
	} else if (y <= 2.4e-214) {
		tmp = c;
	} else if (y <= 1.05e-101) {
		tmp = t_1;
	} else if (y <= 4.8e-47) {
		tmp = (t * z) * 0.0625;
	} else if (y <= 3600000.0) {
		tmp = t_1;
	} else if (y <= 9.5e+70) {
		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) :: t_1
    real(8) :: tmp
    t_1 = b * (a * (-0.25d0))
    if (y <= (-2.9d+31)) then
        tmp = x * y
    else if (y <= 5.2d-267) then
        tmp = t_1
    else if (y <= 2.4d-214) then
        tmp = c
    else if (y <= 1.05d-101) then
        tmp = t_1
    else if (y <= 4.8d-47) then
        tmp = (t * z) * 0.0625d0
    else if (y <= 3600000.0d0) then
        tmp = t_1
    else if (y <= 9.5d+70) 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 t_1 = b * (a * -0.25);
	double tmp;
	if (y <= -2.9e+31) {
		tmp = x * y;
	} else if (y <= 5.2e-267) {
		tmp = t_1;
	} else if (y <= 2.4e-214) {
		tmp = c;
	} else if (y <= 1.05e-101) {
		tmp = t_1;
	} else if (y <= 4.8e-47) {
		tmp = (t * z) * 0.0625;
	} else if (y <= 3600000.0) {
		tmp = t_1;
	} else if (y <= 9.5e+70) {
		tmp = c;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	t_1 = b * (a * -0.25)
	tmp = 0
	if y <= -2.9e+31:
		tmp = x * y
	elif y <= 5.2e-267:
		tmp = t_1
	elif y <= 2.4e-214:
		tmp = c
	elif y <= 1.05e-101:
		tmp = t_1
	elif y <= 4.8e-47:
		tmp = (t * z) * 0.0625
	elif y <= 3600000.0:
		tmp = t_1
	elif y <= 9.5e+70:
		tmp = c
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c)
	t_1 = Float64(b * Float64(a * -0.25))
	tmp = 0.0
	if (y <= -2.9e+31)
		tmp = Float64(x * y);
	elseif (y <= 5.2e-267)
		tmp = t_1;
	elseif (y <= 2.4e-214)
		tmp = c;
	elseif (y <= 1.05e-101)
		tmp = t_1;
	elseif (y <= 4.8e-47)
		tmp = Float64(Float64(t * z) * 0.0625);
	elseif (y <= 3600000.0)
		tmp = t_1;
	elseif (y <= 9.5e+70)
		tmp = c;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = b * (a * -0.25);
	tmp = 0.0;
	if (y <= -2.9e+31)
		tmp = x * y;
	elseif (y <= 5.2e-267)
		tmp = t_1;
	elseif (y <= 2.4e-214)
		tmp = c;
	elseif (y <= 1.05e-101)
		tmp = t_1;
	elseif (y <= 4.8e-47)
		tmp = (t * z) * 0.0625;
	elseif (y <= 3600000.0)
		tmp = t_1;
	elseif (y <= 9.5e+70)
		tmp = c;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b * N[(a * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+31], N[(x * y), $MachinePrecision], If[LessEqual[y, 5.2e-267], t$95$1, If[LessEqual[y, 2.4e-214], c, If[LessEqual[y, 1.05e-101], t$95$1, If[LessEqual[y, 4.8e-47], N[(N[(t * z), $MachinePrecision] * 0.0625), $MachinePrecision], If[LessEqual[y, 3600000.0], t$95$1, If[LessEqual[y, 9.5e+70], c, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-267}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.4 \cdot 10^{-214}:\\
\;\;\;\;c\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-101}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 3600000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.9e31 or 9.5000000000000002e70 < y

    1. Initial program 92.9%

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

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

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

    if -2.9e31 < y < 5.2000000000000003e-267 or 2.4000000000000002e-214 < y < 1.05000000000000008e-101 or 4.7999999999999999e-47 < y < 3.6e6

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000003e-267 < y < 2.4000000000000002e-214 or 3.6e6 < y < 9.5000000000000002e70

    1. Initial program 99.9%

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

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

    if 1.05000000000000008e-101 < y < 4.7999999999999999e-47

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+31}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-267}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-214}:\\ \;\;\;\;c\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-101}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-47}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;y \leq 3600000:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 12: 52.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 7.9 \cdot 10^{-221}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.3 \cdot 10^{-145}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-76}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 2.5 \cdot 10^{-9}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.25e-52 or 1.5000000000000001e206 < b

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-52 < b < 7.9000000000000004e-221 or 1.3e-145 < b < 7.99999999999999942e-76 or 2.5000000000000001e-9 < b < 1.5000000000000001e206

    1. Initial program 97.6%

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

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

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

    if 7.9000000000000004e-221 < b < 1.3e-145 or 7.99999999999999942e-76 < b < 2.5000000000000001e-9

    1. Initial program 97.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-52}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;b \leq 7.9 \cdot 10^{-221}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-145}:\\ \;\;\;\;c + \left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-76}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;c + \left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]

Alternative 13: 51.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;b \leq 1.16 \cdot 10^{-200}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.25e-52 or 1.5000000000000001e206 < b

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.25e-52 < b < 1.1600000000000001e-200 or 1.19999999999999999e-147 < b < 1.5000000000000001e206

    1. Initial program 97.3%

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

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

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

    if 1.1600000000000001e-200 < b < 1.19999999999999999e-147

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-52}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \mathbf{elif}\;b \leq 1.16 \cdot 10^{-200}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-147}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{+206}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot -0.25\right)\\ \end{array} \]

Alternative 14: 37.1% accurate, 1.9× speedup?

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

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

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

\mathbf{elif}\;y \leq 10^{+71}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.0000000000000001e-180 or 1e71 < y

    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 z around 0 85.1%

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

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

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

    if -7.0000000000000001e-180 < y < 9.5999999999999999e-9

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, \frac{z}{\frac{16}{t}}\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{z}{\frac{16}{t}}\right)} - \left(\frac{a}{\frac{4}{b}} - c\right) \]
      2. associate-/l*99.8%

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

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

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

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

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

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

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

    if 9.5999999999999999e-9 < y < 1e71

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{-180}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{-9}:\\ \;\;\;\;\left(t \cdot z\right) \cdot 0.0625\\ \mathbf{elif}\;y \leq 10^{+71}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 15: 35.5% accurate, 2.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.6 \cdot 10^{-150}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.6e-150 or 9.5000000000000002e70 < y

    1. Initial program 94.3%

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

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

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

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

    if -9.6e-150 < y < 9.5000000000000002e70

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.6 \cdot 10^{-150}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 16: 22.0% 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.9%

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

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

    \[\leadsto c \]

Reproduce

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