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

Percentage Accurate: 97.8% → 99.0%
Time: 10.8s
Alternatives: 14
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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: 99.0% accurate, 1.5× speedup?

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

\\
\mathsf{fma}\left(t \cdot 0.0625, z, \mathsf{fma}\left(x, y, \left(a \cdot b\right) \cdot -0.25\right)\right) + c
\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. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t \cdot \frac{1}{16}, z, \mathsf{fma}\left(x, y, \mathsf{neg}\left(\color{blue}{\left(a \cdot b\right) \cdot \frac{1}{4}}\right)\right)\right) + c \]
  4. Applied rewrites99.2%

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

Alternative 2: 99.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t \cdot 0.0625, z, \mathsf{fma}\left(x, y, \left(a \cdot b\right) \cdot -0.25\right)\right)} + c \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

      \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right) + x \cdot y} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

        \[\leadsto \mathsf{fma}\left(b, \color{blue}{\frac{-1}{4} \cdot a}, x \cdot y\right) \]
      5. lower-*.f6450.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, -0.25 \cdot a, x \cdot y\right)} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(b \cdot \frac{-1}{4}\right)} \cdot a\right) \]
      10. lower-*.f6466.7

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

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

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

Alternative 3: 75.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, 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))) < -1.99999999999999997e73 or 2e21 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64)))

    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.f6481.5

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

      \[\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. associate-*r*N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(t \cdot \frac{1}{16}, z, \color{blue}{x \cdot y}\right) \]
    9. Step-by-step derivation
      1. lower-*.f6474.3

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

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

    if -1.99999999999999997e73 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 2e21

    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 a around inf

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} + c \]
      6. lower-*.f6485.7

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(b \cdot \frac{-1}{4}\right) \cdot a} + c \]
      3. lower-fma.f6485.7

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

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

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

Alternative 4: 75.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(b \cdot -0.25, a, 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))) < -1.99999999999999997e73 or 2e21 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64)))

    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.f6481.5

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

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

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

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

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

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

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

    if -1.99999999999999997e73 < (+.f64 (*.f64 x y) (/.f64 (*.f64 z t) #s(literal 16 binary64))) < 2e21

    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 a around inf

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} + c \]
      6. lower-*.f6485.7

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(b \cdot \frac{-1}{4}\right) \cdot a} + c \]
      3. lower-fma.f6485.7

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

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

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

Alternative 5: 64.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b \cdot -0.25, a, c\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 0.0004:\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, c\right)\\

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} + c \]
      6. lower-*.f6482.7

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(b \cdot \frac{-1}{4}\right) \cdot a} + c \]
      3. lower-fma.f6482.7

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

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

    if -1.00000000000000004e192 < (*.f64 a b) < 4.00000000000000019e-4

    1. Initial program 98.1%

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

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

        \[\leadsto \color{blue}{\frac{1}{16} \cdot \left(t \cdot z\right)} + c \]
      2. lower-*.f6465.7

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

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

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

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

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

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

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

    if 4.00000000000000019e-4 < (*.f64 a b) < 4.99999999999999991e108

    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 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.1

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

      \[\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 \color{blue}{c + x \cdot y} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot y + c} \]
      2. lower-fma.f6472.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, c\right)} \]
    8. Applied rewrites72.4%

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

Alternative 6: 89.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(t \cdot 0.0625, z, \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) < -1.00000000000000004e192 or 1e18 < (*.f64 a b)

    1. Initial program 96.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.f6491.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e192 < (*.f64 a b) < 1e18

    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.f6492.5

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

      \[\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. associate-*r*N/A

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

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

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

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

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

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

Alternative 7: 88.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, \mathsf{fma}\left(a, b \cdot -0.25, c\right)\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \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) < -1.00000000000000004e192 or 1e18 < (*.f64 a b)

    1. Initial program 96.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.f6491.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, b \cdot -0.25, \mathsf{fma}\left(x, y, c\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e192 < (*.f64 a b) < 1e18

    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.f6492.5

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

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

Alternative 8: 88.8% accurate, 1.2× speedup?

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

\mathbf{elif}\;a \cdot b \leq 10^{+18}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \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) < -1.00000000000000004e192 or 1e18 < (*.f64 a b)

    1. Initial program 96.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.f6491.5

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

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

    if -1.00000000000000004e192 < (*.f64 a b) < 1e18

    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.f6492.5

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

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

Alternative 9: 86.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, x, a \cdot \left(b \cdot -0.25\right)\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+192}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(0.0625, t \cdot z, \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) < -1.00000000000000004e192 or 1.9999999999999999e87 < (*.f64 a b)

    1. Initial program 96.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.f6492.3

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

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

      \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(a \cdot b\right) + x \cdot y} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, -0.25 \cdot a, x \cdot y\right)} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(b \cdot \frac{-1}{4}\right)} \cdot a\right) \]
      10. lower-*.f6490.8

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

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

    if -1.00000000000000004e192 < (*.f64 a b) < 1.9999999999999999e87

    1. Initial program 98.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in 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.f6491.5

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

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

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

Alternative 10: 65.9% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(x, y, c\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.9999999999999998e86 or 5.00000000000000036e69 < (*.f64 x y)

    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.f6480.5

        \[\leadsto \mathsf{fma}\left(0.0625, t \cdot z, \color{blue}{\mathsf{fma}\left(x, y, c\right)}\right) \]
    5. Applied rewrites80.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 \color{blue}{c + x \cdot y} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot y + c} \]
      2. lower-fma.f6468.5

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, c\right)} \]
    8. Applied rewrites68.5%

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

    if -4.9999999999999998e86 < (*.f64 x y) < 5.00000000000000036e69

    1. Initial program 99.3%

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} + c \]
      6. lower-*.f6459.8

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

      \[\leadsto \color{blue}{a \cdot \left(b \cdot -0.25\right)} + c \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(b \cdot \frac{-1}{4}\right) \cdot a} + c \]
      3. lower-fma.f6459.8

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

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

Alternative 11: 62.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
t_1 := a \cdot \left(b \cdot -0.25\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\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 a b) < -9.9999999999999994e161 or 4.99999999999999991e108 < (*.f64 a b)

    1. Initial program 96.0%

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

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

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

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(b \cdot \frac{-1}{4}\right)} \]
      6. lower-*.f6478.1

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

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

    if -9.9999999999999994e161 < (*.f64 a b) < 4.99999999999999991e108

    1. Initial program 98.3%

      \[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
    2. Add Preprocessing
    3. Taylor expanded in 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.f6491.7

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

      \[\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 \color{blue}{c + x \cdot y} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot y + c} \]
      2. lower-fma.f6455.5

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, c\right)} \]
    8. Applied rewrites55.5%

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

Alternative 12: 62.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 0.0625 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+158}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+90}:\\ \;\;\;\;\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 (* t z))))
   (if (<= (* t z) -1e+158) t_1 (if (<= (* t z) 2e+90) (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 * (t * z);
	double tmp;
	if ((t * z) <= -1e+158) {
		tmp = t_1;
	} else if ((t * z) <= 2e+90) {
		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(t * z))
	tmp = 0.0
	if (Float64(t * z) <= -1e+158)
		tmp = t_1;
	elseif (Float64(t * z) <= 2e+90)
		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[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -1e+158], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 2e+90], N[(x * y + c), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 0.0625 \cdot \left(t \cdot z\right)\\
\mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+90}:\\
\;\;\;\;\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) < -9.99999999999999953e157 or 1.99999999999999993e90 < (*.f64 z t)

    1. Initial program 92.9%

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

      \[\leadsto \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-*.f6468.6

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

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

    if -9.99999999999999953e157 < (*.f64 z t) < 1.99999999999999993e90

    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 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.f6467.4

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

      \[\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 \color{blue}{c + x \cdot y} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{x \cdot y + c} \]
      2. lower-fma.f6456.4

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, c\right)} \]
    8. Applied rewrites56.4%

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

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

Alternative 13: 49.1% 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.f6472.1

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

    \[\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 \color{blue}{c + x \cdot y} \]
  7. Step-by-step derivation
    1. +-commutativeN/A

      \[\leadsto \color{blue}{x \cdot y + c} \]
    2. lower-fma.f6443.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(x, y, c\right)} \]
  8. Applied rewrites43.5%

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

Alternative 14: 28.7% 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.7

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

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

Reproduce

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