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

Percentage Accurate: 97.6% → 99.0%
Time: 8.9s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 97.6% 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: 99.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, \color{blue}{a \cdot \frac{1}{\frac{-4}{b}}}\right)\right) + c \]
    13. clear-num97.7%

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

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

      \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot \color{blue}{-0.25}\right)\right)\right) + c \]
  3. Applied egg-rr97.7%

    \[\leadsto \color{blue}{\left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right)\right)} + c \]
  4. Final simplification97.7%

    \[\leadsto c + \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot -0.25\right)\right)\right) \]

Alternative 3: 98.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(x, y, \frac{z}{16} \cdot 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(Float64(z / 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[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(c + N[(a / N[(-4.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 42.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -3.5 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -2.1 \cdot 10^{+35}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-316}:\\
\;\;\;\;c\\

\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{-130}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq 1.92 \cdot 10^{+96}:\\
\;\;\;\;c\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -9.00000000000000053e159 or -3.49999999999999985e46 < (*.f64 a b) < -2.0999999999999999e35 or 1.92e96 < (*.f64 a b)

    1. Initial program 94.7%

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

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

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

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

    if -9.00000000000000053e159 < (*.f64 a b) < -3.49999999999999985e46 or -9.999999837e-317 < (*.f64 a b) < 3.7999999999999998e-130

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, \color{blue}{a \cdot \frac{1}{\frac{-4}{b}}}\right)\right) + c \]
      13. clear-num100.0%

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

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

        \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot \color{blue}{-0.25}\right)\right)\right) + c \]
    3. Applied egg-rr100.0%

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

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

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

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

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

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

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

    if -2.0999999999999999e35 < (*.f64 a b) < -9.999999837e-317 or 3.7999999999999998e-130 < (*.f64 a b) < 1.92e96

    1. Initial program 97.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. sub-neg97.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -9 \cdot 10^{+159}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq -3.5 \cdot 10^{+46}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq -2.1 \cdot 10^{+35}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-316}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{-130}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 1.92 \cdot 10^{+96}:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 5: 61.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := -0.25 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+159}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -1.05 \cdot 10^{-17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -4.2 \cdot 10^{-46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 10^{-251}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-185}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+98}:\\ \;\;\;\;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 (* 0.0625 (* z t))) (t_3 (* -0.25 (* a b))))
   (if (<= (* a b) -8e+159)
     t_3
     (if (<= (* a b) -1.05e-17)
       t_1
       (if (<= (* a b) -4.2e-46)
         t_2
         (if (<= (* a b) 1e-251)
           t_1
           (if (<= (* a b) 1.2e-185)
             t_2
             (if (<= (* a b) 3.8e+98) 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 = 0.0625 * (z * t);
	double t_3 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -8e+159) {
		tmp = t_3;
	} else if ((a * b) <= -1.05e-17) {
		tmp = t_1;
	} else if ((a * b) <= -4.2e-46) {
		tmp = t_2;
	} else if ((a * b) <= 1e-251) {
		tmp = t_1;
	} else if ((a * b) <= 1.2e-185) {
		tmp = t_2;
	} else if ((a * b) <= 3.8e+98) {
		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 = 0.0625d0 * (z * t)
    t_3 = (-0.25d0) * (a * b)
    if ((a * b) <= (-8d+159)) then
        tmp = t_3
    else if ((a * b) <= (-1.05d-17)) then
        tmp = t_1
    else if ((a * b) <= (-4.2d-46)) then
        tmp = t_2
    else if ((a * b) <= 1d-251) then
        tmp = t_1
    else if ((a * b) <= 1.2d-185) then
        tmp = t_2
    else if ((a * b) <= 3.8d+98) 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 = 0.0625 * (z * t);
	double t_3 = -0.25 * (a * b);
	double tmp;
	if ((a * b) <= -8e+159) {
		tmp = t_3;
	} else if ((a * b) <= -1.05e-17) {
		tmp = t_1;
	} else if ((a * b) <= -4.2e-46) {
		tmp = t_2;
	} else if ((a * b) <= 1e-251) {
		tmp = t_1;
	} else if ((a * b) <= 1.2e-185) {
		tmp = t_2;
	} else if ((a * b) <= 3.8e+98) {
		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 = 0.0625 * (z * t)
	t_3 = -0.25 * (a * b)
	tmp = 0
	if (a * b) <= -8e+159:
		tmp = t_3
	elif (a * b) <= -1.05e-17:
		tmp = t_1
	elif (a * b) <= -4.2e-46:
		tmp = t_2
	elif (a * b) <= 1e-251:
		tmp = t_1
	elif (a * b) <= 1.2e-185:
		tmp = t_2
	elif (a * b) <= 3.8e+98:
		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(0.0625 * Float64(z * t))
	t_3 = Float64(-0.25 * Float64(a * b))
	tmp = 0.0
	if (Float64(a * b) <= -8e+159)
		tmp = t_3;
	elseif (Float64(a * b) <= -1.05e-17)
		tmp = t_1;
	elseif (Float64(a * b) <= -4.2e-46)
		tmp = t_2;
	elseif (Float64(a * b) <= 1e-251)
		tmp = t_1;
	elseif (Float64(a * b) <= 1.2e-185)
		tmp = t_2;
	elseif (Float64(a * b) <= 3.8e+98)
		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 = 0.0625 * (z * t);
	t_3 = -0.25 * (a * b);
	tmp = 0.0;
	if ((a * b) <= -8e+159)
		tmp = t_3;
	elseif ((a * b) <= -1.05e-17)
		tmp = t_1;
	elseif ((a * b) <= -4.2e-46)
		tmp = t_2;
	elseif ((a * b) <= 1e-251)
		tmp = t_1;
	elseif ((a * b) <= 1.2e-185)
		tmp = t_2;
	elseif ((a * b) <= 3.8e+98)
		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[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -8e+159], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], -1.05e-17], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -4.2e-46], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 1e-251], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1.2e-185], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 3.8e+98], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -1.05 \cdot 10^{-17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq -4.2 \cdot 10^{-46}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-185}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+98}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.5%

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

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

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

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

    if -7.9999999999999994e159 < (*.f64 a b) < -1.04999999999999996e-17 or -4.19999999999999975e-46 < (*.f64 a b) < 1.00000000000000002e-251 or 1.2000000000000001e-185 < (*.f64 a b) < 3.7999999999999999e98

    1. Initial program 98.7%

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

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

    if -1.04999999999999996e-17 < (*.f64 a b) < -4.19999999999999975e-46 or 1.00000000000000002e-251 < (*.f64 a b) < 1.2000000000000001e-185

    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 + \left(\frac{z \cdot t}{16} - \frac{a \cdot b}{4}\right)\right)} + c \]
      2. associate-*l/100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, \color{blue}{a \cdot \frac{1}{\frac{-4}{b}}}\right)\right) + c \]
      13. clear-num100.0%

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

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

        \[\leadsto \left(x \cdot y + \mathsf{fma}\left(t, z \cdot 0.0625, a \cdot \left(b \cdot \color{blue}{-0.25}\right)\right)\right) + c \]
    3. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{0.0625 \cdot \left(t \cdot z\right)} + c \]
    5. Step-by-step derivation
      1. *-commutative93.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+159}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq -1.05 \cdot 10^{-17}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -4.2 \cdot 10^{-46}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{-251}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-185}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+98}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 6: 65.6% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+75}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.5000000000000002e83 or 5.39999999999999996e75 < (*.f64 x y)

    1. Initial program 95.0%

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

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

    if -9.5000000000000002e83 < (*.f64 x y) < -2.6e-92 or -3.75000000000000014e-203 < (*.f64 x y) < 5.39999999999999996e75

    1. Initial program 99.2%

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

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

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

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

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

    if -2.6e-92 < (*.f64 x y) < -3.75000000000000014e-203

    1. Initial program 96.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+83}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-92}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;x \cdot y \leq -3.75 \cdot 10^{-203}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 5.4 \cdot 10^{+75}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + x \cdot y\\ \end{array} \]

Alternative 7: 62.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{-296}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+98}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 94.5%

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

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

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

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

    if -3.4999999999999999e159 < (*.f64 a b) < 2.50000000000000015e-296 or 2.79999999999999991e-185 < (*.f64 a b) < 3.7999999999999999e98

    1. Initial program 98.7%

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

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

    if 2.50000000000000015e-296 < (*.f64 a b) < 2.79999999999999991e-185

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.5 \cdot 10^{+159}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \cdot b \leq 2.5 \cdot 10^{-296}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.8 \cdot 10^{-185}:\\ \;\;\;\;c + 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{+98}:\\ \;\;\;\;c + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 8: 88.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{-29}:\\
\;\;\;\;c + \left(t_1 - t_2\right)\\

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


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

    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 0 88.3%

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

    if -1.2e86 < (*.f64 x y) < 6.0000000000000005e-29

    1. Initial program 98.7%

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

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

    if 6.0000000000000005e-29 < (*.f64 x y)

    1. Initial program 95.7%

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

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

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

Alternative 9: 86.5% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5.0000000000000004e171 or 2.00000000000000001e160 < (*.f64 a b)

    1. Initial program 93.6%

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

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

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

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

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

    if -5.0000000000000004e171 < (*.f64 a b) < 2.00000000000000001e160

    1. Initial program 98.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 89.9%

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

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

Alternative 10: 89.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1e-8 or 9.99999999999999983e76 < (*.f64 a 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. Taylor expanded in z around 0 84.9%

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

    if -1e-8 < (*.f64 a b) < 9.99999999999999983e76

    1. Initial program 98.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 96.2%

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

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

Alternative 11: 97.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 12: 41.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+31} \lor \neg \left(a \cdot b \leq 9.5 \cdot 10^{+95}\right):\\
\;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.2000000000000001e31 or 9.5000000000000004e95 < (*.f64 a b)

    1. Initial program 95.4%

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

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

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

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

    if -2.2000000000000001e31 < (*.f64 a b) < 9.5000000000000004e95

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+31} \lor \neg \left(a \cdot b \leq 9.5 \cdot 10^{+95}\right):\\ \;\;\;\;-0.25 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]

Alternative 13: 22.2% accurate, 17.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{c} \]
  5. Final simplification24.6%

    \[\leadsto c \]

Reproduce

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