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

Percentage Accurate: 97.8% → 98.5%
Time: 12.4s
Alternatives: 13
Speedup: 0.6×

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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) (/.f64 (*.f64 a b) #s(literal 4 binary64))) < +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 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \left(\frac{1}{16}\right)\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\left(x \cdot y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      13. associate-/l*N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(a \cdot \frac{b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      14. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(\frac{b}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(b \cdot \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \left(\frac{1}{4}\right)\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
      18. neg-lowering-neg.f64100.0%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \mathsf{neg.f64}\left(c\right)\right)\right)\right) \]
    4. Applied egg-rr100.0%

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{0} \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, 0\right) \]
      3. *-lowering-*.f6457.6%

        \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), 0\right) \]
    5. Simplified57.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, 0\right)} \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \frac{1}{16} \cdot \color{blue}{\left(t \cdot z\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(t \cdot z\right) \cdot \color{blue}{\frac{1}{16}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(t \cdot z\right), \color{blue}{\frac{1}{16}}\right) \]
      4. *-lowering-*.f6457.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, z\right), \frac{1}{16}\right) \]
    7. Applied egg-rr57.6%

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

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

Alternative 2: 64.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -100:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{-230}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+151}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (if (<= (* x y) -100.0)
   (fma y x c)
   (if (<= (* x y) 1e-230)
     (fma (* t 0.0625) z c)
     (if (<= (* x y) 1e+151) (fma a (* b -0.25) c) (fma y x c)))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	double tmp;
	if ((x * y) <= -100.0) {
		tmp = fma(y, x, c);
	} else if ((x * y) <= 1e-230) {
		tmp = fma((t * 0.0625), z, c);
	} else if ((x * y) <= 1e+151) {
		tmp = fma(a, (b * -0.25), c);
	} else {
		tmp = fma(y, x, c);
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	tmp = 0.0
	if (Float64(x * y) <= -100.0)
		tmp = fma(y, x, c);
	elseif (Float64(x * y) <= 1e-230)
		tmp = fma(Float64(t * 0.0625), z, c);
	elseif (Float64(x * y) <= 1e+151)
		tmp = fma(a, Float64(b * -0.25), c);
	else
		tmp = fma(y, x, c);
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -100.0], N[(y * x + c), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-230], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e+151], N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision], N[(y * x + c), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -100:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\

\mathbf{elif}\;x \cdot y \leq 10^{-230}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\

\mathbf{elif}\;x \cdot y \leq 10^{+151}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -100 or 1.00000000000000002e151 < (*.f64 x y)

    1. Initial program 95.3%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, c\right) \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y + 0\right), c\right) \]
      2. accelerator-lowering-fma.f6471.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(x, y, 0\right), c\right) \]
    5. Simplified71.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, 0\right)} + c \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto x \cdot y + c \]
      2. *-commutativeN/A

        \[\leadsto y \cdot x + c \]
      3. accelerator-lowering-fma.f6471.7%

        \[\leadsto \mathsf{fma.f64}\left(y, \color{blue}{x}, c\right) \]
    7. Applied egg-rr71.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c\right)} \]

    if -100 < (*.f64 x y) < 1.00000000000000005e-230

    1. Initial program 98.9%

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

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}, c\right) \]
    4. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{1}{16} \cdot \left(t \cdot z\right) + 0\right), c\right) \]
      2. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \left(t \cdot z\right), 0\right), c\right) \]
      3. *-lowering-*.f6473.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), 0\right), c\right) \]
    5. Simplified73.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, 0\right)} + c \]
    6. Step-by-step derivation
      1. +-rgt-identityN/A

        \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + c \]
      2. associate-*r*N/A

        \[\leadsto \left(\frac{1}{16} \cdot t\right) \cdot z + c \]
      3. *-commutativeN/A

        \[\leadsto \left(t \cdot \frac{1}{16}\right) \cdot z + c \]
      4. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), \color{blue}{z}, c\right) \]
      5. *-lowering-*.f6473.4%

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, c\right) \]
    7. Applied egg-rr73.4%

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

    if 1.00000000000000005e-230 < (*.f64 x y) < 1.00000000000000002e151

    1. Initial program 98.3%

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

      \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
      2. metadata-evalN/A

        \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
      3. +-commutativeN/A

        \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
      4. *-commutativeN/A

        \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
      5. associate-*l*N/A

        \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
      6. *-commutativeN/A

        \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
      7. accelerator-lowering-fma.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
      11. accelerator-lowering-fma.f6480.7%

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
    5. Simplified80.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
    6. Taylor expanded in x around 0

      \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{c}\right) \]
    7. Step-by-step derivation
      1. Simplified65.5%

        \[\leadsto \mathsf{fma}\left(a, b \cdot -0.25, \color{blue}{c}\right) \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 3: 89.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+146}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{-22}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c)
     :precision binary64
     (if (<= (* x y) -2e+146)
       (fma 0.0625 (* z t) (fma x y c))
       (if (<= (* x y) 1e-22)
         (fma 0.0625 (* z t) (fma a (* b -0.25) c))
         (fma a (* b -0.25) (fma x y c)))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double tmp;
    	if ((x * y) <= -2e+146) {
    		tmp = fma(0.0625, (z * t), fma(x, y, c));
    	} else if ((x * y) <= 1e-22) {
    		tmp = fma(0.0625, (z * t), fma(a, (b * -0.25), c));
    	} else {
    		tmp = fma(a, (b * -0.25), fma(x, y, c));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	tmp = 0.0
    	if (Float64(x * y) <= -2e+146)
    		tmp = fma(0.0625, Float64(z * t), fma(x, y, c));
    	elseif (Float64(x * y) <= 1e-22)
    		tmp = fma(0.0625, Float64(z * t), fma(a, Float64(b * -0.25), c));
    	else
    		tmp = fma(a, Float64(b * -0.25), fma(x, y, c));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+146], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-22], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+146}:\\
    \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\
    
    \mathbf{elif}\;x \cdot y \leq 10^{-22}:\\
    \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x y) < -1.99999999999999987e146

      1. Initial program 90.0%

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

        \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
      4. Step-by-step derivation
        1. associate-+r+N/A

          \[\leadsto \left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + \color{blue}{x \cdot y} \]
        2. +-commutativeN/A

          \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) + c\right) + \color{blue}{x} \cdot y \]
        3. associate-+l+N/A

          \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, \left(c + x \cdot y\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), \left(c + x \cdot y\right)\right) \]
        6. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(x \cdot y + c\right)\right) \]
        7. accelerator-lowering-fma.f6493.3%

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified93.3%

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

      if -1.99999999999999987e146 < (*.f64 x y) < 1e-22

      1. Initial program 98.6%

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

        \[\leadsto \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. +-commutativeN/A

          \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) + c\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)} \cdot \left(a \cdot b\right) \]
        3. metadata-evalN/A

          \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) + c\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        4. associate-+l+N/A

          \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{\left(c + \frac{-1}{4} \cdot \left(a \cdot b\right)\right)} \]
        5. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, \left(c + \frac{-1}{4} \cdot \left(a \cdot b\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), \left(c + \frac{-1}{4} \cdot \left(a \cdot b\right)\right)\right) \]
        7. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(\frac{-1}{4} \cdot \left(a \cdot b\right) + c\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(\left(a \cdot b\right) \cdot \frac{-1}{4} + c\right)\right) \]
        9. associate-*l*N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(a \cdot \left(b \cdot \frac{-1}{4}\right) + c\right)\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(a \cdot \left(\frac{-1}{4} \cdot b\right) + c\right)\right) \]
        11. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(a, \left(\frac{-1}{4} \cdot b\right), c\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(a, \left(b \cdot \frac{-1}{4}\right), c\right)\right) \]
        13. *-lowering-*.f6490.5%

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), c\right)\right) \]
      5. Simplified90.5%

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

      if 1e-22 < (*.f64 x y)

      1. Initial program 97.4%

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

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
        5. associate-*l*N/A

          \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
        11. accelerator-lowering-fma.f6489.8%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified89.8%

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

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

    Alternative 4: 65.7% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -0.0002:\\ \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, x \cdot y\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{-65}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c)
     :precision binary64
     (if (<= (* x y) -0.0002)
       (fma (* t 0.0625) z (* x y))
       (if (<= (* x y) 1e-65) (fma (* t 0.0625) z c) (fma a (* b -0.25) (* x y)))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double tmp;
    	if ((x * y) <= -0.0002) {
    		tmp = fma((t * 0.0625), z, (x * y));
    	} else if ((x * y) <= 1e-65) {
    		tmp = fma((t * 0.0625), z, c);
    	} else {
    		tmp = fma(a, (b * -0.25), (x * y));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	tmp = 0.0
    	if (Float64(x * y) <= -0.0002)
    		tmp = fma(Float64(t * 0.0625), z, Float64(x * y));
    	elseif (Float64(x * y) <= 1e-65)
    		tmp = fma(Float64(t * 0.0625), z, c);
    	else
    		tmp = fma(a, Float64(b * -0.25), Float64(x * y));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(x * y), $MachinePrecision], -0.0002], N[(N[(t * 0.0625), $MachinePrecision] * z + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-65], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot y \leq -0.0002:\\
    \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, x \cdot y\right)\\
    
    \mathbf{elif}\;x \cdot y \leq 10^{-65}:\\
    \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 x y) < -2.0000000000000001e-4

      1. Initial program 95.2%

        \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. associate-+l-N/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \left(\frac{1}{16}\right)\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
        9. metadata-evalN/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
        10. --lowering--.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\left(x \cdot y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
        11. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        13. associate-/l*N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(a \cdot \frac{b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        14. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(\frac{b}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        15. div-invN/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(b \cdot \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        16. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \left(\frac{1}{4}\right)\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        17. metadata-evalN/A

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
        18. neg-lowering-neg.f6495.2%

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \mathsf{neg.f64}\left(c\right)\right)\right)\right) \]
      4. Applied egg-rr95.2%

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

        \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \color{blue}{\left(x \cdot y\right)}\right) \]
      6. Step-by-step derivation
        1. *-lowering-*.f6470.3%

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{*.f64}\left(x, y\right)\right) \]
      7. Simplified70.3%

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

      if -2.0000000000000001e-4 < (*.f64 x y) < 9.99999999999999923e-66

      1. Initial program 98.2%

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

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}, c\right) \]
      4. Step-by-step derivation
        1. +-rgt-identityN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{1}{16} \cdot \left(t \cdot z\right) + 0\right), c\right) \]
        2. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \left(t \cdot z\right), 0\right), c\right) \]
        3. *-lowering-*.f6471.1%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), 0\right), c\right) \]
      5. Simplified71.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, 0\right)} + c \]
      6. Step-by-step derivation
        1. +-rgt-identityN/A

          \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + c \]
        2. associate-*r*N/A

          \[\leadsto \left(\frac{1}{16} \cdot t\right) \cdot z + c \]
        3. *-commutativeN/A

          \[\leadsto \left(t \cdot \frac{1}{16}\right) \cdot z + c \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), \color{blue}{z}, c\right) \]
        5. *-lowering-*.f6471.1%

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, c\right) \]
      7. Applied egg-rr71.1%

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

      if 9.99999999999999923e-66 < (*.f64 x y)

      1. Initial program 97.6%

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

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
        5. associate-*l*N/A

          \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
        11. accelerator-lowering-fma.f6489.2%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified89.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
      6. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{\left(x \cdot y\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f6477.8%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{*.f64}\left(x, y\right)\right) \]
      8. Simplified77.8%

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

    Alternative 5: 66.1% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\ \mathbf{if}\;x \cdot y \leq -100:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 10^{-65}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c)
     :precision binary64
     (let* ((t_1 (fma a (* b -0.25) (* x y))))
       (if (<= (* x y) -100.0)
         t_1
         (if (<= (* x y) 1e-65) (fma (* t 0.0625) z c) t_1))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double t_1 = fma(a, (b * -0.25), (x * y));
    	double tmp;
    	if ((x * y) <= -100.0) {
    		tmp = t_1;
    	} else if ((x * y) <= 1e-65) {
    		tmp = fma((t * 0.0625), z, c);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	t_1 = fma(a, Float64(b * -0.25), Float64(x * y))
    	tmp = 0.0
    	if (Float64(x * y) <= -100.0)
    		tmp = t_1;
    	elseif (Float64(x * y) <= 1e-65)
    		tmp = fma(Float64(t * 0.0625), z, c);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -100.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-65], N[(N[(t * 0.0625), $MachinePrecision] * z + c), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
    \mathbf{if}\;x \cdot y \leq -100:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \cdot y \leq 10^{-65}:\\
    \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 x y) < -100 or 9.99999999999999923e-66 < (*.f64 x y)

      1. Initial program 96.6%

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

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
        5. associate-*l*N/A

          \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
        11. accelerator-lowering-fma.f6484.4%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified84.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
      6. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{\left(x \cdot y\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f6473.7%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{*.f64}\left(x, y\right)\right) \]
      8. Simplified73.7%

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

      if -100 < (*.f64 x y) < 9.99999999999999923e-66

      1. Initial program 98.2%

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

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\frac{1}{16} \cdot \left(t \cdot z\right)\right)}, c\right) \]
      4. Step-by-step derivation
        1. +-rgt-identityN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{1}{16} \cdot \left(t \cdot z\right) + 0\right), c\right) \]
        2. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \left(t \cdot z\right), 0\right), c\right) \]
        3. *-lowering-*.f6471.1%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), 0\right), c\right) \]
      5. Simplified71.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, 0\right)} + c \]
      6. Step-by-step derivation
        1. +-rgt-identityN/A

          \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + c \]
        2. associate-*r*N/A

          \[\leadsto \left(\frac{1}{16} \cdot t\right) \cdot z + c \]
        3. *-commutativeN/A

          \[\leadsto \left(t \cdot \frac{1}{16}\right) \cdot z + c \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), \color{blue}{z}, c\right) \]
        5. *-lowering-*.f6471.1%

          \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, c\right) \]
      7. Applied egg-rr71.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot 0.0625, z, c\right)} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 83.1% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{if}\;t \leq -1.26 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.45 \cdot 10^{+123}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c)
     :precision binary64
     (let* ((t_1 (fma 0.0625 (* z t) (fma x y c))))
       (if (<= t -1.26e-7)
         t_1
         (if (<= t 1.45e+123) (fma a (* b -0.25) (fma x y c)) t_1))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double t_1 = fma(0.0625, (z * t), fma(x, y, c));
    	double tmp;
    	if (t <= -1.26e-7) {
    		tmp = t_1;
    	} else if (t <= 1.45e+123) {
    		tmp = fma(a, (b * -0.25), fma(x, y, c));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	t_1 = fma(0.0625, Float64(z * t), fma(x, y, c))
    	tmp = 0.0
    	if (t <= -1.26e-7)
    		tmp = t_1;
    	elseif (t <= 1.45e+123)
    		tmp = fma(a, Float64(b * -0.25), fma(x, y, c));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.26e-7], t$95$1, If[LessEqual[t, 1.45e+123], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\
    \mathbf{if}\;t \leq -1.26 \cdot 10^{-7}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 1.45 \cdot 10^{+123}:\\
    \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -1.2599999999999999e-7 or 1.45000000000000005e123 < t

      1. Initial program 95.0%

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

        \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
      4. Step-by-step derivation
        1. associate-+r+N/A

          \[\leadsto \left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + \color{blue}{x \cdot y} \]
        2. +-commutativeN/A

          \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) + c\right) + \color{blue}{x} \cdot y \]
        3. associate-+l+N/A

          \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, \left(c + x \cdot y\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), \left(c + x \cdot y\right)\right) \]
        6. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(x \cdot y + c\right)\right) \]
        7. accelerator-lowering-fma.f6481.5%

          \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified81.5%

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

      if -1.2599999999999999e-7 < t < 1.45000000000000005e123

      1. Initial program 98.7%

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

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
        5. associate-*l*N/A

          \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
        11. accelerator-lowering-fma.f6488.5%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified88.5%

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

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

    Alternative 7: 78.3% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{+121}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+31}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c)
     :precision binary64
     (if (<= a -2.6e+121)
       (fma a (* b -0.25) c)
       (if (<= a 1.05e+31)
         (fma 0.0625 (* z t) (fma x y c))
         (fma a (* b -0.25) (* x y)))))
    double code(double x, double y, double z, double t, double a, double b, double c) {
    	double tmp;
    	if (a <= -2.6e+121) {
    		tmp = fma(a, (b * -0.25), c);
    	} else if (a <= 1.05e+31) {
    		tmp = fma(0.0625, (z * t), fma(x, y, c));
    	} else {
    		tmp = fma(a, (b * -0.25), (x * y));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c)
    	tmp = 0.0
    	if (a <= -2.6e+121)
    		tmp = fma(a, Float64(b * -0.25), c);
    	elseif (a <= 1.05e+31)
    		tmp = fma(0.0625, Float64(z * t), fma(x, y, c));
    	else
    		tmp = fma(a, Float64(b * -0.25), Float64(x * y));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[a, -2.6e+121], N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision], If[LessEqual[a, 1.05e+31], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;a \leq -2.6 \cdot 10^{+121}:\\
    \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\
    
    \mathbf{elif}\;a \leq 1.05 \cdot 10^{+31}:\\
    \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if a < -2.5999999999999999e121

      1. Initial program 93.1%

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

        \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
      4. Step-by-step derivation
        1. cancel-sign-sub-invN/A

          \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
        2. metadata-evalN/A

          \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
        3. +-commutativeN/A

          \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
        4. *-commutativeN/A

          \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
        5. associate-*l*N/A

          \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
        6. *-commutativeN/A

          \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
        11. accelerator-lowering-fma.f6480.1%

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
      5. Simplified80.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
      6. Taylor expanded in x around 0

        \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{c}\right) \]
      7. Step-by-step derivation
        1. Simplified73.2%

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

        if -2.5999999999999999e121 < a < 1.04999999999999989e31

        1. Initial program 97.5%

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

          \[\leadsto \color{blue}{c + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)} \]
        4. Step-by-step derivation
          1. associate-+r+N/A

            \[\leadsto \left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + \color{blue}{x \cdot y} \]
          2. +-commutativeN/A

            \[\leadsto \left(\frac{1}{16} \cdot \left(t \cdot z\right) + c\right) + \color{blue}{x} \cdot y \]
          3. associate-+l+N/A

            \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{\left(c + x \cdot y\right)} \]
          4. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, \left(c + x \cdot y\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), \left(c + x \cdot y\right)\right) \]
          6. +-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \left(x \cdot y + c\right)\right) \]
          7. accelerator-lowering-fma.f6486.7%

            \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, z\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
        5. Simplified86.7%

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

        if 1.04999999999999989e31 < a

        1. Initial program 98.4%

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

          \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
        4. Step-by-step derivation
          1. cancel-sign-sub-invN/A

            \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
          2. metadata-evalN/A

            \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
          4. *-commutativeN/A

            \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
          5. associate-*l*N/A

            \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
          6. *-commutativeN/A

            \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
          7. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
          10. +-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
          11. accelerator-lowering-fma.f6478.5%

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
        5. Simplified78.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
        6. Taylor expanded in x around inf

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{\left(x \cdot y\right)}\right) \]
        7. Step-by-step derivation
          1. *-lowering-*.f6467.2%

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{*.f64}\left(x, y\right)\right) \]
        8. Simplified67.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.6 \cdot 10^{+121}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\ \mathbf{elif}\;a \leq 1.05 \cdot 10^{+31}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 8: 59.7% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(a, b \cdot -0.25, c\right)\\ \mathbf{if}\;a \leq -6.5 \cdot 10^{+121}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 1.72 \cdot 10^{+43}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c)
       :precision binary64
       (let* ((t_1 (fma a (* b -0.25) c)))
         (if (<= a -6.5e+121) t_1 (if (<= a 1.72e+43) (fma y x c) t_1))))
      double code(double x, double y, double z, double t, double a, double b, double c) {
      	double t_1 = fma(a, (b * -0.25), c);
      	double tmp;
      	if (a <= -6.5e+121) {
      		tmp = t_1;
      	} else if (a <= 1.72e+43) {
      		tmp = fma(y, x, c);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c)
      	t_1 = fma(a, Float64(b * -0.25), c)
      	tmp = 0.0
      	if (a <= -6.5e+121)
      		tmp = t_1;
      	elseif (a <= 1.72e+43)
      		tmp = fma(y, x, c);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision]}, If[LessEqual[a, -6.5e+121], t$95$1, If[LessEqual[a, 1.72e+43], N[(y * x + c), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(a, b \cdot -0.25, c\right)\\
      \mathbf{if}\;a \leq -6.5 \cdot 10^{+121}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 1.72 \cdot 10^{+43}:\\
      \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -6.50000000000000019e121 or 1.7199999999999999e43 < a

        1. Initial program 97.8%

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

          \[\leadsto \color{blue}{\left(c + x \cdot y\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
        4. Step-by-step derivation
          1. cancel-sign-sub-invN/A

            \[\leadsto \left(c + x \cdot y\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
          2. metadata-evalN/A

            \[\leadsto \left(c + x \cdot y\right) + \frac{-1}{4} \cdot \left(\color{blue}{a} \cdot b\right) \]
          3. +-commutativeN/A

            \[\leadsto \frac{-1}{4} \cdot \left(a \cdot b\right) + \color{blue}{\left(c + x \cdot y\right)} \]
          4. *-commutativeN/A

            \[\leadsto \left(a \cdot b\right) \cdot \frac{-1}{4} + \left(\color{blue}{c} + x \cdot y\right) \]
          5. associate-*l*N/A

            \[\leadsto a \cdot \left(b \cdot \frac{-1}{4}\right) + \left(\color{blue}{c} + x \cdot y\right) \]
          6. *-commutativeN/A

            \[\leadsto a \cdot \left(\frac{-1}{4} \cdot b\right) + \left(c + x \cdot y\right) \]
          7. accelerator-lowering-fma.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}, \left(c + x \cdot y\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right), \left(c + x \cdot y\right)\right) \]
          10. +-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \left(x \cdot y + c\right)\right) \]
          11. accelerator-lowering-fma.f6479.4%

            \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \mathsf{fma.f64}\left(x, y, c\right)\right) \]
        5. Simplified79.4%

          \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
        6. Taylor expanded in x around 0

          \[\leadsto \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{-1}{4}\right), \color{blue}{c}\right) \]
        7. Step-by-step derivation
          1. Simplified57.7%

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

          if -6.50000000000000019e121 < a < 1.7199999999999999e43

          1. Initial program 97.0%

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, c\right) \]
          4. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y + 0\right), c\right) \]
            2. accelerator-lowering-fma.f6460.2%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(x, y, 0\right), c\right) \]
          5. Simplified60.2%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, 0\right)} + c \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto x \cdot y + c \]
            2. *-commutativeN/A

              \[\leadsto y \cdot x + c \]
            3. accelerator-lowering-fma.f6460.2%

              \[\leadsto \mathsf{fma.f64}\left(y, \color{blue}{x}, c\right) \]
          7. Applied egg-rr60.2%

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c\right)} \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 9: 53.4% accurate, 2.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;t \leq -57000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+150}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c)
         :precision binary64
         (let* ((t_1 (* 0.0625 (* z t))))
           (if (<= t -57000000000.0) t_1 (if (<= t 1.05e+150) (fma y x c) t_1))))
        double code(double x, double y, double z, double t, double a, double b, double c) {
        	double t_1 = 0.0625 * (z * t);
        	double tmp;
        	if (t <= -57000000000.0) {
        		tmp = t_1;
        	} else if (t <= 1.05e+150) {
        		tmp = fma(y, x, c);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a, b, c)
        	t_1 = Float64(0.0625 * Float64(z * t))
        	tmp = 0.0
        	if (t <= -57000000000.0)
        		tmp = t_1;
        	elseif (t <= 1.05e+150)
        		tmp = fma(y, x, c);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.0625 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -57000000000.0], t$95$1, If[LessEqual[t, 1.05e+150], N[(y * x + c), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
        \mathbf{if}\;t \leq -57000000000:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 1.05 \cdot 10^{+150}:\\
        \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -5.7e10 or 1.04999999999999999e150 < t

          1. Initial program 94.5%

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

            \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
          4. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \frac{1}{16} \cdot \left(t \cdot z\right) + \color{blue}{0} \]
            2. accelerator-lowering-fma.f64N/A

              \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \color{blue}{\left(t \cdot z\right)}, 0\right) \]
            3. *-lowering-*.f6451.6%

              \[\leadsto \mathsf{fma.f64}\left(\frac{1}{16}, \mathsf{*.f64}\left(t, \color{blue}{z}\right), 0\right) \]
          5. Simplified51.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, 0\right)} \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \frac{1}{16} \cdot \color{blue}{\left(t \cdot z\right)} \]
            2. *-commutativeN/A

              \[\leadsto \left(t \cdot z\right) \cdot \color{blue}{\frac{1}{16}} \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\left(t \cdot z\right), \color{blue}{\frac{1}{16}}\right) \]
            4. *-lowering-*.f6451.6%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, z\right), \frac{1}{16}\right) \]
          7. Applied egg-rr51.6%

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

          if -5.7e10 < t < 1.04999999999999999e150

          1. Initial program 98.8%

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, c\right) \]
          4. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y + 0\right), c\right) \]
            2. accelerator-lowering-fma.f6461.4%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(x, y, 0\right), c\right) \]
          5. Simplified61.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, 0\right)} + c \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto x \cdot y + c \]
            2. *-commutativeN/A

              \[\leadsto y \cdot x + c \]
            3. accelerator-lowering-fma.f6461.4%

              \[\leadsto \mathsf{fma.f64}\left(y, \color{blue}{x}, c\right) \]
          7. Applied egg-rr61.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification57.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -57000000000:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+150}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625 \cdot \left(z \cdot t\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 10: 55.4% accurate, 2.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot \left(b \cdot -0.25\right)\\ \mathbf{if}\;a \leq -2.15 \cdot 10^{+175}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 4.8 \cdot 10^{+77}:\\ \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c)
         :precision binary64
         (let* ((t_1 (* a (* b -0.25))))
           (if (<= a -2.15e+175) t_1 (if (<= a 4.8e+77) (fma y x c) t_1))))
        double code(double x, double y, double z, double t, double a, double b, double c) {
        	double t_1 = a * (b * -0.25);
        	double tmp;
        	if (a <= -2.15e+175) {
        		tmp = t_1;
        	} else if (a <= 4.8e+77) {
        		tmp = fma(y, x, c);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t, a, b, c)
        	t_1 = Float64(a * Float64(b * -0.25))
        	tmp = 0.0
        	if (a <= -2.15e+175)
        		tmp = t_1;
        	elseif (a <= 4.8e+77)
        		tmp = fma(y, x, c);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(a * N[(b * -0.25), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.15e+175], t$95$1, If[LessEqual[a, 4.8e+77], N[(y * x + c), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := a \cdot \left(b \cdot -0.25\right)\\
        \mathbf{if}\;a \leq -2.15 \cdot 10^{+175}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \leq 4.8 \cdot 10^{+77}:\\
        \;\;\;\;\mathsf{fma}\left(y, x, c\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -2.14999999999999992e175 or 4.7999999999999997e77 < a

          1. Initial program 98.6%

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

            \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(a \cdot b\right) \cdot \color{blue}{\frac{-1}{4}} \]
            2. associate-*l*N/A

              \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} \]
            3. *-commutativeN/A

              \[\leadsto a \cdot \left(\frac{-1}{4} \cdot \color{blue}{b}\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{-1}{4} \cdot b\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(a, \left(b \cdot \color{blue}{\frac{-1}{4}}\right)\right) \]
            6. *-lowering-*.f6449.6%

              \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right)\right) \]
          5. Simplified49.6%

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

          if -2.14999999999999992e175 < a < 4.7999999999999997e77

          1. Initial program 96.8%

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

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, c\right) \]
          4. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y + 0\right), c\right) \]
            2. accelerator-lowering-fma.f6459.1%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(x, y, 0\right), c\right) \]
          5. Simplified59.1%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, 0\right)} + c \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto x \cdot y + c \]
            2. *-commutativeN/A

              \[\leadsto y \cdot x + c \]
            3. accelerator-lowering-fma.f6459.1%

              \[\leadsto \mathsf{fma.f64}\left(y, \color{blue}{x}, c\right) \]
          7. Applied egg-rr59.1%

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c\right)} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 11: 36.9% accurate, 2.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -7.6 \cdot 10^{+135}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 0.00106:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \end{array} \]
        (FPCore (x y z t a b c)
         :precision binary64
         (if (<= c -7.6e+135) c (if (<= c 0.00106) (* x y) c)))
        double code(double x, double y, double z, double t, double a, double b, double c) {
        	double tmp;
        	if (c <= -7.6e+135) {
        		tmp = c;
        	} else if (c <= 0.00106) {
        		tmp = x * y;
        	} else {
        		tmp = c;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t, a, b, c)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8) :: tmp
            if (c <= (-7.6d+135)) then
                tmp = c
            else if (c <= 0.00106d0) then
                tmp = x * y
            else
                tmp = c
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b, double c) {
        	double tmp;
        	if (c <= -7.6e+135) {
        		tmp = c;
        	} else if (c <= 0.00106) {
        		tmp = x * y;
        	} else {
        		tmp = c;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b, c):
        	tmp = 0
        	if c <= -7.6e+135:
        		tmp = c
        	elif c <= 0.00106:
        		tmp = x * y
        	else:
        		tmp = c
        	return tmp
        
        function code(x, y, z, t, a, b, c)
        	tmp = 0.0
        	if (c <= -7.6e+135)
        		tmp = c;
        	elseif (c <= 0.00106)
        		tmp = Float64(x * y);
        	else
        		tmp = c;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b, c)
        	tmp = 0.0;
        	if (c <= -7.6e+135)
        		tmp = c;
        	elseif (c <= 0.00106)
        		tmp = x * y;
        	else
        		tmp = c;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[c, -7.6e+135], c, If[LessEqual[c, 0.00106], N[(x * y), $MachinePrecision], c]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;c \leq -7.6 \cdot 10^{+135}:\\
        \;\;\;\;c\\
        
        \mathbf{elif}\;c \leq 0.00106:\\
        \;\;\;\;x \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;c\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if c < -7.6000000000000003e135 or 0.00105999999999999996 < c

          1. Initial program 97.8%

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

            \[\leadsto \color{blue}{c} \]
          4. Step-by-step derivation
            1. Simplified50.9%

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

            if -7.6000000000000003e135 < c < 0.00105999999999999996

            1. Initial program 96.9%

              \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. associate-+l-N/A

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

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

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

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

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

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

                \[\leadsto \mathsf{fma.f64}\left(\left(t \cdot \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
              8. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \left(\frac{1}{16}\right)\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
              9. metadata-evalN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \left(x \cdot y - \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
              10. --lowering--.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\left(x \cdot y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
              11. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} - c\right)\right)\right) \]
              12. sub-negN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(\frac{a \cdot b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              13. associate-/l*N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(a \cdot \frac{b}{4} + \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              14. accelerator-lowering-fma.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(\frac{b}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              15. div-invN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \left(b \cdot \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \left(\frac{1}{4}\right)\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              17. metadata-evalN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \left(\mathsf{neg}\left(c\right)\right)\right)\right)\right) \]
              18. neg-lowering-neg.f6496.9%

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{*.f64}\left(t, \frac{1}{16}\right), z, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{fma.f64}\left(a, \mathsf{*.f64}\left(b, \frac{1}{4}\right), \mathsf{neg.f64}\left(c\right)\right)\right)\right) \]
            4. Applied egg-rr96.9%

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

              \[\leadsto \color{blue}{x \cdot y} \]
            6. Step-by-step derivation
              1. *-lowering-*.f6441.3%

                \[\leadsto \mathsf{*.f64}\left(x, \color{blue}{y}\right) \]
            7. Simplified41.3%

              \[\leadsto \color{blue}{x \cdot y} \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 12: 48.3% accurate, 6.7× speedup?

          \[\begin{array}{l} \\ \mathsf{fma}\left(y, x, c\right) \end{array} \]
          (FPCore (x y z t a b c) :precision binary64 (fma y x c))
          double code(double x, double y, double z, double t, double a, double b, double c) {
          	return fma(y, x, c);
          }
          
          function code(x, y, z, t, a, b, c)
          	return fma(y, x, c)
          end
          
          code[x_, y_, z_, t_, a_, b_, c_] := N[(y * x + c), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \mathsf{fma}\left(y, x, c\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. Add Preprocessing
          3. Taylor expanded in x around inf

            \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(x \cdot y\right)}, c\right) \]
          4. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto \mathsf{+.f64}\left(\left(x \cdot y + 0\right), c\right) \]
            2. accelerator-lowering-fma.f6452.0%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{fma.f64}\left(x, y, 0\right), c\right) \]
          5. Simplified52.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, 0\right)} + c \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

              \[\leadsto x \cdot y + c \]
            2. *-commutativeN/A

              \[\leadsto y \cdot x + c \]
            3. accelerator-lowering-fma.f6452.0%

              \[\leadsto \mathsf{fma.f64}\left(y, \color{blue}{x}, c\right) \]
          7. Applied egg-rr52.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, c\right)} \]
          8. Add Preprocessing

          Alternative 13: 22.2% accurate, 47.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. Add Preprocessing
          3. Taylor expanded in c around inf

            \[\leadsto \color{blue}{c} \]
          4. Step-by-step derivation
            1. Simplified21.4%

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

            Reproduce

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