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

Percentage Accurate: 97.8% → 98.5%
Time: 10.7s
Alternatives: 13
Speedup: 1.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, 1.6× speedup?

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

\\
\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(0.0625, z \cdot t, \mathsf{fma}\left(x, y, c\right)\right)\right)
\end{array}
Derivation
  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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right) + \left(c + x \cdot y\right)}\right) \]
    13. lower-fma.f64N/A

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

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

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

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

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

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

Alternative 2: 76.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(0.0625, z \cdot t, x \cdot y\right)\\ t_2 := x \cdot y + \frac{z \cdot t}{16}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+179}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+39}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\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) (* x y))) (t_2 (+ (* x y) (/ (* z t) 16.0))))
   (if (<= t_2 -1e+179) t_1 (if (<= t_2 2e+39) (fma a (* b -0.25) 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), (x * y));
	double t_2 = (x * y) + ((z * t) / 16.0);
	double tmp;
	if (t_2 <= -1e+179) {
		tmp = t_1;
	} else if (t_2 <= 2e+39) {
		tmp = fma(a, (b * -0.25), c);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b, c)
	t_1 = fma(0.0625, Float64(z * t), Float64(x * y))
	t_2 = Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0))
	tmp = 0.0
	if (t_2 <= -1e+179)
		tmp = t_1;
	elseif (t_2 <= 2e+39)
		tmp = fma(a, Float64(b * -0.25), 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), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+179], t$95$1, If[LessEqual[t$95$2, 2e+39], N[(a * N[(b * -0.25), $MachinePrecision] + c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(0.0625, z \cdot t, x \cdot y\right)\\
t_2 := x \cdot y + \frac{z \cdot t}{16}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, c\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < -9.9999999999999998e178 or 1.99999999999999988e39 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64)))

    1. Initial program 95.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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
      2. +-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
      7. lower-fma.f6485.5

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

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

      \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, x \cdot y\right) \]
    7. Step-by-step derivation
      1. Applied rewrites80.1%

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

      if -9.9999999999999998e178 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 1.99999999999999988e39

      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. 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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
        3. +-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
        11. lower-fma.f6491.4

          \[\leadsto \mathsf{fma}\left(a, b \cdot -0.25, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
      5. Applied rewrites91.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 c + \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites85.8%

          \[\leadsto \mathsf{fma}\left(a, \color{blue}{b \cdot -0.25}, c\right) \]
      8. Recombined 2 regimes into one program.
      9. Final simplification82.5%

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

      Alternative 3: 63.4% accurate, 1.0× speedup?

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

        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 inf

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

            \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
          2. lower-*.f6473.0

            \[\leadsto 0.0625 \cdot \color{blue}{\left(t \cdot z\right)} \]
        5. Applied rewrites73.0%

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

        if -9.99999999999999944e118 < (*.f64 z t) < 2.0000000000000002e44

        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 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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
          3. +-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
          11. lower-fma.f6495.5

            \[\leadsto \mathsf{fma}\left(a, b \cdot -0.25, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
        5. Applied rewrites95.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 0

          \[\leadsto c + \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites69.9%

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

          if 2.0000000000000002e44 < (*.f64 z t) < 1.9999999999999999e87

          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. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x \cdot y} \]
          4. Step-by-step derivation
            1. lower-*.f64100.0

              \[\leadsto \color{blue}{x \cdot y} \]
          5. Applied rewrites100.0%

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

          if 1.9999999999999999e87 < (*.f64 z t)

          1. Initial program 94.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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
            2. +-commutativeN/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
            7. lower-fma.f6484.0

              \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
          5. Applied rewrites84.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
          6. Taylor expanded in x around 0

            \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites79.6%

              \[\leadsto \mathsf{fma}\left(0.0625, \color{blue}{t \cdot z}, c\right) \]
            2. Step-by-step derivation
              1. Applied rewrites79.6%

                \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, c\right) \]
            3. Recombined 4 regimes into one program.
            4. Final simplification73.3%

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

            Alternative 4: 89.8% accurate, 1.0× speedup?

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

              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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                2. +-commutativeN/A

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                7. lower-fma.f6487.6

                  \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
              5. Applied rewrites87.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites87.6%

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

                if -9.99999999999999944e118 < (*.f64 z t) < 1.9999999999999999e87

                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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
                  3. +-commutativeN/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
                  11. lower-fma.f6495.7

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

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

                if 1.9999999999999999e87 < (*.f64 z t)

                1. Initial program 94.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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + \left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(a \cdot b\right)} \]
                  2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \mathsf{fma}\left(a, \color{blue}{b \cdot \frac{-1}{4}}, c\right)\right) \]
                  13. lower-*.f6490.6

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)} \]
              7. Recombined 3 regimes into one program.
              8. Final simplification93.2%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+119}:\\ \;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+87}:\\ \;\;\;\;\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(a, b \cdot -0.25, c\right)\right)\\ \end{array} \]
              9. Add Preprocessing

              Alternative 5: 88.8% accurate, 1.1× speedup?

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

                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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                  2. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                  7. lower-fma.f6487.6

                    \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                5. Applied rewrites87.6%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                6. Step-by-step derivation
                  1. Applied rewrites87.6%

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

                  if -9.99999999999999944e118 < (*.f64 z t) < 3.9999999999999997e159

                  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 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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
                    3. +-commutativeN/A

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
                    11. lower-fma.f6493.3

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

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

                  if 3.9999999999999997e159 < (*.f64 z t)

                  1. Initial program 93.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 + \left(\frac{1}{16} \cdot \left(t \cdot z\right) + x \cdot y\right)\right) - \frac{1}{4} \cdot \left(a \cdot b\right)} \]
                  4. Step-by-step derivation
                    1. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right) + \left(c + x \cdot y\right)}\right) \]
                    13. lower-fma.f64N/A

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \frac{1}{16} \cdot \left(t \cdot z\right)\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites91.7%

                      \[\leadsto \mathsf{fma}\left(a, b \cdot -0.25, 0.0625 \cdot \left(t \cdot z\right)\right) \]
                  8. Recombined 3 regimes into one program.
                  9. Final simplification92.2%

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

                  Alternative 6: 89.8% accurate, 1.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(t \cdot 0.0625, z, \mathsf{fma}\left(x, y, c\right)\right)\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+119}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+40}:\\ \;\;\;\;\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 (* t 0.0625) z (fma x y c))))
                     (if (<= (* z t) -1e+119)
                       t_1
                       (if (<= (* z t) 5e+40) (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((t * 0.0625), z, fma(x, y, c));
                  	double tmp;
                  	if ((z * t) <= -1e+119) {
                  		tmp = t_1;
                  	} else if ((z * t) <= 5e+40) {
                  		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(Float64(t * 0.0625), z, fma(x, y, c))
                  	tmp = 0.0
                  	if (Float64(z * t) <= -1e+119)
                  		tmp = t_1;
                  	elseif (Float64(z * t) <= 5e+40)
                  		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[(N[(t * 0.0625), $MachinePrecision] * z + N[(x * y + c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+119], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e+40], 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(t \cdot 0.0625, z, \mathsf{fma}\left(x, y, c\right)\right)\\
                  \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+119}:\\
                  \;\;\;\;t\_1\\
                  
                  \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+40}:\\
                  \;\;\;\;\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 (*.f64 z t) < -9.99999999999999944e118 or 5.00000000000000003e40 < (*.f64 z t)

                    1. Initial program 96.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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                      2. +-commutativeN/A

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                      7. lower-fma.f6486.4

                        \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                    5. Applied rewrites86.4%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites86.4%

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

                      if -9.99999999999999944e118 < (*.f64 z t) < 5.00000000000000003e40

                      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 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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
                        3. +-commutativeN/A

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
                        11. lower-fma.f6495.5

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

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

                    Alternative 7: 88.1% accurate, 1.2× speedup?

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

                      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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                        2. +-commutativeN/A

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                        7. lower-fma.f6487.6

                          \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                      5. Applied rewrites87.6%

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

                        \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, x \cdot y\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites87.6%

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

                        if -9.99999999999999944e118 < (*.f64 z t) < 5.00000000000000003e40

                        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 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 \color{blue}{\left(c + x \cdot y\right) + \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) + \color{blue}{\frac{-1}{4}} \cdot \left(a \cdot b\right) \]
                          3. +-commutativeN/A

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{x \cdot y + c}\right) \]
                          11. lower-fma.f6495.5

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

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

                        if 5.00000000000000003e40 < (*.f64 z t)

                        1. Initial program 95.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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                          2. +-commutativeN/A

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                          7. lower-fma.f6485.7

                            \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                        5. Applied rewrites85.7%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification91.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+119}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, x \cdot y\right)\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+40}:\\ \;\;\;\;\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} \]
                      10. Add Preprocessing

                      Alternative 8: 86.8% 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}\;a \cdot b \leq -2 \cdot 10^{+182}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+224}:\\ \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \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 a (* b -0.25) (* x y))))
                         (if (<= (* a b) -2e+182)
                           t_1
                           (if (<= (* a b) 1e+224) (fma 0.0625 (* z t) (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(a, (b * -0.25), (x * y));
                      	double tmp;
                      	if ((a * b) <= -2e+182) {
                      		tmp = t_1;
                      	} else if ((a * b) <= 1e+224) {
                      		tmp = fma(0.0625, (z * t), fma(x, y, 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(a * b) <= -2e+182)
                      		tmp = t_1;
                      	elseif (Float64(a * b) <= 1e+224)
                      		tmp = fma(0.0625, Float64(z * t), 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[(a * N[(b * -0.25), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2e+182], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 1e+224], N[(0.0625 * N[(z * t), $MachinePrecision] + N[(x * y + c), $MachinePrecision]), $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}\;a \cdot b \leq -2 \cdot 10^{+182}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;a \cdot b \leq 10^{+224}:\\
                      \;\;\;\;\mathsf{fma}\left(0.0625, z \cdot t, \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 (*.f64 a b) < -2.0000000000000001e182 or 9.9999999999999997e223 < (*.f64 a b)

                        1. Initial program 93.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right) + \left(c + x \cdot y\right)}\right) \]
                          13. lower-fma.f64N/A

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(a, b \cdot \frac{-1}{4}, x \cdot y\right) \]
                        7. Step-by-step derivation
                          1. Applied rewrites86.9%

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

                          if -2.0000000000000001e182 < (*.f64 a b) < 9.9999999999999997e223

                          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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                            2. +-commutativeN/A

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                            7. lower-fma.f6487.6

                              \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                          5. Applied rewrites87.6%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+182}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot -0.25, x \cdot y\right)\\ \mathbf{elif}\;a \cdot b \leq 10^{+224}:\\ \;\;\;\;\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 9: 64.8% accurate, 1.4× speedup?

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

                          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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                            2. +-commutativeN/A

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                            7. lower-fma.f6482.7

                              \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                          5. Applied rewrites82.7%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                          6. Taylor expanded in x around 0

                            \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                          7. Step-by-step derivation
                            1. Applied rewrites69.0%

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

                            if -1.9999999999999999e45 < (*.f64 z t) < 1.9999999999999999e87

                            1. Initial program 98.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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                              2. +-commutativeN/A

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                              7. lower-fma.f6464.3

                                \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                            5. Applied rewrites64.3%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                            6. Taylor expanded in t around 0

                              \[\leadsto c + \color{blue}{x \cdot y} \]
                            7. Step-by-step derivation
                              1. Applied rewrites61.7%

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

                              if 1.9999999999999999e87 < (*.f64 z t)

                              1. Initial program 94.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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                                2. +-commutativeN/A

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                                7. lower-fma.f6484.0

                                  \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                              5. Applied rewrites84.0%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                              6. Taylor expanded in x around 0

                                \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites79.6%

                                  \[\leadsto \mathsf{fma}\left(0.0625, \color{blue}{t \cdot z}, c\right) \]
                                2. Step-by-step derivation
                                  1. Applied rewrites79.6%

                                    \[\leadsto \mathsf{fma}\left(z \cdot 0.0625, t, c\right) \]
                                3. Recombined 3 regimes into one program.
                                4. Final simplification67.5%

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

                                Alternative 10: 64.8% accurate, 1.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(0.0625, z \cdot t, c\right)\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+87}:\\ \;\;\;\;\mathsf{fma}\left(x, y, c\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) c)))
                                   (if (<= (* z t) -2e+45) t_1 (if (<= (* z t) 2e+87) (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), c);
                                	double tmp;
                                	if ((z * t) <= -2e+45) {
                                		tmp = t_1;
                                	} else if ((z * t) <= 2e+87) {
                                		tmp = 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), c)
                                	tmp = 0.0
                                	if (Float64(z * t) <= -2e+45)
                                		tmp = t_1;
                                	elseif (Float64(z * t) <= 2e+87)
                                		tmp = 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] + c), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+45], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+87], N[(x * y + c), $MachinePrecision], t$95$1]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := \mathsf{fma}\left(0.0625, z \cdot t, c\right)\\
                                \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+45}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+87}:\\
                                \;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_1\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if (*.f64 z t) < -1.9999999999999999e45 or 1.9999999999999999e87 < (*.f64 z t)

                                  1. Initial program 96.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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                                    2. +-commutativeN/A

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                                    7. lower-fma.f6483.4

                                      \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                                  5. Applied rewrites83.4%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                                  6. Taylor expanded in x around 0

                                    \[\leadsto c + \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites74.5%

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

                                    if -1.9999999999999999e45 < (*.f64 z t) < 1.9999999999999999e87

                                    1. Initial program 98.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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                                      2. +-commutativeN/A

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                                      7. lower-fma.f6464.3

                                        \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                                    5. Applied rewrites64.3%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                                    6. Taylor expanded in t around 0

                                      \[\leadsto c + \color{blue}{x \cdot y} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites61.7%

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

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

                                    Alternative 11: 63.0% accurate, 1.4× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+159}:\\ \;\;\;\;\mathsf{fma}\left(x, y, 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 (<= (* z t) -4e+154) t_1 (if (<= (* z t) 4e+159) (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 = 0.0625 * (z * t);
                                    	double tmp;
                                    	if ((z * t) <= -4e+154) {
                                    		tmp = t_1;
                                    	} else if ((z * t) <= 4e+159) {
                                    		tmp = fma(x, y, 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 (Float64(z * t) <= -4e+154)
                                    		tmp = t_1;
                                    	elseif (Float64(z * t) <= 4e+159)
                                    		tmp = 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]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -4e+154], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 4e+159], N[(x * y + c), $MachinePrecision], t$95$1]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_1 := 0.0625 \cdot \left(z \cdot t\right)\\
                                    \mathbf{if}\;z \cdot t \leq -4 \cdot 10^{+154}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    \mathbf{elif}\;z \cdot t \leq 4 \cdot 10^{+159}:\\
                                    \;\;\;\;\mathsf{fma}\left(x, y, c\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (*.f64 z t) < -4.00000000000000015e154 or 3.9999999999999997e159 < (*.f64 z 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 z around inf

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

                                          \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} \]
                                        2. lower-*.f6479.9

                                          \[\leadsto 0.0625 \cdot \color{blue}{\left(t \cdot z\right)} \]
                                      5. Applied rewrites79.9%

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

                                      if -4.00000000000000015e154 < (*.f64 z t) < 3.9999999999999997e159

                                      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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                                        2. +-commutativeN/A

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                                        7. lower-fma.f6466.5

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

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                                      6. Taylor expanded in t around 0

                                        \[\leadsto c + \color{blue}{x \cdot y} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites59.5%

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

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

                                      Alternative 12: 48.7% accurate, 6.7× speedup?

                                      \[\begin{array}{l} \\ \mathsf{fma}\left(x, y, c\right) \end{array} \]
                                      (FPCore (x y z t a b c) :precision binary64 (fma x y c))
                                      double code(double x, double y, double z, double t, double a, double b, double c) {
                                      	return fma(x, y, c);
                                      }
                                      
                                      function code(x, y, z, t, a, b, c)
                                      	return fma(x, y, c)
                                      end
                                      
                                      code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y + c), $MachinePrecision]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \mathsf{fma}\left(x, y, c\right)
                                      \end{array}
                                      
                                      Derivation
                                      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 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 \color{blue}{\left(c + \frac{1}{16} \cdot \left(t \cdot z\right)\right) + x \cdot y} \]
                                        2. +-commutativeN/A

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{16}, t \cdot z, \color{blue}{x \cdot y + c}\right) \]
                                        7. lower-fma.f6473.0

                                          \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
                                      5. Applied rewrites73.0%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(0.0625, t \cdot z, \mathsf{fma}\left(x, y, c\right)\right)} \]
                                      6. Taylor expanded in t around 0

                                        \[\leadsto c + \color{blue}{x \cdot y} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites45.9%

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

                                        Alternative 13: 28.2% accurate, 7.8× speedup?

                                        \[\begin{array}{l} \\ x \cdot y \end{array} \]
                                        (FPCore (x y z t a b c) :precision binary64 (* x y))
                                        double code(double x, double y, double z, double t, double a, double b, double c) {
                                        	return x * y;
                                        }
                                        
                                        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
                                        end function
                                        
                                        public static double code(double x, double y, double z, double t, double a, double b, double c) {
                                        	return x * y;
                                        }
                                        
                                        def code(x, y, z, t, a, b, c):
                                        	return x * y
                                        
                                        function code(x, y, z, t, a, b, c)
                                        	return Float64(x * y)
                                        end
                                        
                                        function tmp = code(x, y, z, t, a, b, c)
                                        	tmp = x * y;
                                        end
                                        
                                        code[x_, y_, z_, t_, a_, b_, c_] := N[(x * y), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        x \cdot y
                                        \end{array}
                                        
                                        Derivation
                                        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 x around inf

                                          \[\leadsto \color{blue}{x \cdot y} \]
                                        4. Step-by-step derivation
                                          1. lower-*.f6426.6

                                            \[\leadsto \color{blue}{x \cdot y} \]
                                        5. Applied rewrites26.6%

                                          \[\leadsto \color{blue}{x \cdot y} \]
                                        6. Add Preprocessing

                                        Reproduce

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