Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 95.7% → 97.7%
Time: 6.9s
Alternatives: 12
Speedup: 1.3×

Specification

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\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 12 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: 95.7% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}

Alternative 1: 97.7% accurate, 1.3× speedup?

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

\\
\mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\right)
\end{array}
Derivation
  1. Initial program 95.3%

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

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

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

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

      \[\leadsto \color{blue}{i \cdot c} + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) \]
    5. lower-fma.f6496.5

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

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

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

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

      \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{b \cdot a} + \left(x \cdot y + z \cdot t\right)\right) \]
    10. lower-fma.f6497.2

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

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

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

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

      \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z} + x \cdot y\right)\right) \]
    15. lower-fma.f6497.6

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

      \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{x \cdot y}\right)\right)\right) \]
    17. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
    18. lower-*.f6497.6

      \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
  4. Applied rewrites97.6%

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

Alternative 2: 88.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+170} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+146}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* a b) -5e+170) (not (<= (* a b) 5e+146)))
   (fma b a (fma y x (* c i)))
   (fma i c (fma t z (* y x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((a * b) <= -5e+170) || !((a * b) <= 5e+146)) {
		tmp = fma(b, a, fma(y, x, (c * i)));
	} else {
		tmp = fma(i, c, fma(t, z, (y * x)));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(a * b) <= -5e+170) || !(Float64(a * b) <= 5e+146))
		tmp = fma(b, a, fma(y, x, Float64(c * i)));
	else
		tmp = fma(i, c, fma(t, z, Float64(y * x)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+170], N[Not[LessEqual[N[(a * b), $MachinePrecision], 5e+146]], $MachinePrecision]], N[(b * a + N[(y * x + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * c + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+170} \lor \neg \left(a \cdot b \leq 5 \cdot 10^{+146}\right):\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -4.99999999999999977e170 or 4.9999999999999999e146 < (*.f64 a b)

    1. Initial program 89.2%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
      6. lower-*.f6490.9

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites92.4%

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

      if -4.99999999999999977e170 < (*.f64 a b) < 4.9999999999999999e146

      1. Initial program 97.3%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
        5. lower-*.f6493.8

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification93.5%

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

    Alternative 3: 89.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+37}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \end{array} \]
    (FPCore (x y z t a b c i)
     :precision binary64
     (if (or (<= (* x y) -2e+124) (not (<= (* x y) 1e+37)))
       (fma b a (fma y x (* c i)))
       (fma b a (fma i c (* t z)))))
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double tmp;
    	if (((x * y) <= -2e+124) || !((x * y) <= 1e+37)) {
    		tmp = fma(b, a, fma(y, x, (c * i)));
    	} else {
    		tmp = fma(b, a, fma(i, c, (t * z)));
    	}
    	return tmp;
    }
    
    function code(x, y, z, t, a, b, c, i)
    	tmp = 0.0
    	if ((Float64(x * y) <= -2e+124) || !(Float64(x * y) <= 1e+37))
    		tmp = fma(b, a, fma(y, x, Float64(c * i)));
    	else
    		tmp = fma(b, a, fma(i, c, Float64(t * z)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+124], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+37]], $MachinePrecision]], N[(b * a + N[(y * x + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+37}\right):\\
    \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 x y) < -1.9999999999999999e124 or 9.99999999999999954e36 < (*.f64 x y)

      1. Initial program 91.6%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

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

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

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

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

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
        5. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
        6. lower-*.f6486.4

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites86.5%

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

        if -1.9999999999999999e124 < (*.f64 x y) < 9.99999999999999954e36

        1. Initial program 98.0%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

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

            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
          2. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
          5. lower-*.f6494.2

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
        5. Applied rewrites94.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+37}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 89.4% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+37}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (if (or (<= (* x y) -2e+124) (not (<= (* x y) 1e+37)))
         (fma b a (fma i c (* y x)))
         (fma b a (fma i c (* t z)))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double tmp;
      	if (((x * y) <= -2e+124) || !((x * y) <= 1e+37)) {
      		tmp = fma(b, a, fma(i, c, (y * x)));
      	} else {
      		tmp = fma(b, a, fma(i, c, (t * z)));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c, i)
      	tmp = 0.0
      	if ((Float64(x * y) <= -2e+124) || !(Float64(x * y) <= 1e+37))
      		tmp = fma(b, a, fma(i, c, Float64(y * x)));
      	else
      		tmp = fma(b, a, fma(i, c, Float64(t * z)));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+124], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+37]], $MachinePrecision]], N[(b * a + N[(i * c + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+37}\right):\\
      \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 x y) < -1.9999999999999999e124 or 9.99999999999999954e36 < (*.f64 x y)

        1. Initial program 91.6%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

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

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

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

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

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
          6. lower-*.f6486.4

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

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

        if -1.9999999999999999e124 < (*.f64 x y) < 9.99999999999999954e36

        1. Initial program 98.0%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

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

            \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
          2. lower-fma.f64N/A

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

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

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
          5. lower-*.f6494.2

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
        5. Applied rewrites94.2%

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

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

      Alternative 5: 84.7% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+181}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t a b c i)
       :precision binary64
       (if (or (<= (* x y) -1e+236) (not (<= (* x y) 2e+181)))
         (* y x)
         (fma b a (fma i c (* t z)))))
      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
      	double tmp;
      	if (((x * y) <= -1e+236) || !((x * y) <= 2e+181)) {
      		tmp = y * x;
      	} else {
      		tmp = fma(b, a, fma(i, c, (t * z)));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b, c, i)
      	tmp = 0.0
      	if ((Float64(x * y) <= -1e+236) || !(Float64(x * y) <= 2e+181))
      		tmp = Float64(y * x);
      	else
      		tmp = fma(b, a, fma(i, c, Float64(t * z)));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+236], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+181]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+181}\right):\\
      \;\;\;\;y \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (*.f64 x y) < -1.00000000000000005e236 or 1.9999999999999998e181 < (*.f64 x y)

        1. Initial program 85.9%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

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

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

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

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

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
          5. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
          6. lower-*.f6488.0

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
        6. Step-by-step derivation
          1. Applied rewrites88.0%

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right) \]
          2. Taylor expanded in x around inf

            \[\leadsto \color{blue}{x \cdot y} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{y \cdot x} \]
            2. lower-*.f6480.3

              \[\leadsto \color{blue}{y \cdot x} \]
          4. Applied rewrites80.3%

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

          if -1.00000000000000005e236 < (*.f64 x y) < 1.9999999999999998e181

          1. Initial program 98.4%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

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

              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
            2. lower-fma.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
            5. lower-*.f6486.8

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{t \cdot z}\right)\right) \]
          5. Applied rewrites86.8%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+181}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 6: 88.6% accurate, 0.7× speedup?

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

          1. Initial program 89.3%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

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

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

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

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

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
            6. lower-*.f6493.2

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites96.7%

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

            if -4.99999999999999977e170 < (*.f64 a b) < 5e102

            1. Initial program 97.3%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in a around 0

              \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

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

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

                \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
              5. lower-*.f6493.6

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

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

            if 5e102 < (*.f64 a b)

            1. Initial program 90.7%

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

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

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

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

                \[\leadsto \color{blue}{i \cdot c} + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) \]
              5. lower-fma.f6493.0

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

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

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

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

                \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{b \cdot a} + \left(x \cdot y + z \cdot t\right)\right) \]
              10. lower-fma.f6493.0

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

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

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

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

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z} + x \cdot y\right)\right) \]
              15. lower-fma.f6493.0

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

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{x \cdot y}\right)\right)\right) \]
              17. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
              18. lower-*.f6493.0

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
            4. Applied rewrites93.0%

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

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{a \cdot b + t \cdot z}\right) \]
            6. Step-by-step derivation
              1. +-commutativeN/A

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

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

                \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)}\right) \]
              4. lower-*.f6493.2

                \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(z, t, \color{blue}{a \cdot b}\right)\right) \]
            7. Applied rewrites93.2%

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

          Alternative 7: 63.0% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+179}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, z \cdot t\right)\\ \end{array} \end{array} \]
          (FPCore (x y z t a b c i)
           :precision binary64
           (if (or (<= (* x y) -2e+124) (not (<= (* x y) 1e+179)))
             (* y x)
             (fma i c (* z t))))
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double tmp;
          	if (((x * y) <= -2e+124) || !((x * y) <= 1e+179)) {
          		tmp = y * x;
          	} else {
          		tmp = fma(i, c, (z * t));
          	}
          	return tmp;
          }
          
          function code(x, y, z, t, a, b, c, i)
          	tmp = 0.0
          	if ((Float64(x * y) <= -2e+124) || !(Float64(x * y) <= 1e+179))
          		tmp = Float64(y * x);
          	else
          		tmp = fma(i, c, Float64(z * t));
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+124], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+179]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(i * c + N[(z * t), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 10^{+179}\right):\\
          \;\;\;\;y \cdot x\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(i, c, z \cdot t\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 x y) < -1.9999999999999999e124 or 9.9999999999999998e178 < (*.f64 x y)

            1. Initial program 89.5%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in z around 0

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

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

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

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

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
              6. lower-*.f6487.6

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

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

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right) \]
              2. Taylor expanded in x around inf

                \[\leadsto \color{blue}{x \cdot y} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{y \cdot x} \]
                2. lower-*.f6469.5

                  \[\leadsto \color{blue}{y \cdot x} \]
              4. Applied rewrites69.5%

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

              if -1.9999999999999999e124 < (*.f64 x y) < 9.9999999999999998e178

              1. Initial program 98.2%

                \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
              2. Add Preprocessing
              3. Taylor expanded in a around 0

                \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

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

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

                  \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)}\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
                5. lower-*.f6476.5

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

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

                \[\leadsto \mathsf{fma}\left(i, c, t \cdot z\right) \]
              7. Step-by-step derivation
                1. Applied rewrites67.8%

                  \[\leadsto \mathsf{fma}\left(i, c, z \cdot t\right) \]
              8. Recombined 2 regimes into one program.
              9. Final simplification68.4%

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

              Alternative 8: 61.6% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\ \end{array} \end{array} \]
              (FPCore (x y z t a b c i)
               :precision binary64
               (if (or (<= (* x y) -1e+236) (not (<= (* x y) 2e+51)))
                 (* y x)
                 (fma b a (* c i))))
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double tmp;
              	if (((x * y) <= -1e+236) || !((x * y) <= 2e+51)) {
              		tmp = y * x;
              	} else {
              		tmp = fma(b, a, (c * i));
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b, c, i)
              	tmp = 0.0
              	if ((Float64(x * y) <= -1e+236) || !(Float64(x * y) <= 2e+51))
              		tmp = Float64(y * x);
              	else
              		tmp = fma(b, a, Float64(c * i));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+236], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2e+51]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+51}\right):\\
              \;\;\;\;y \cdot x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 x y) < -1.00000000000000005e236 or 2e51 < (*.f64 x y)

                1. Initial program 89.1%

                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                  6. lower-*.f6486.1

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

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

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right) \]
                  2. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{x \cdot y} \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{y \cdot x} \]
                    2. lower-*.f6471.9

                      \[\leadsto \color{blue}{y \cdot x} \]
                  4. Applied rewrites71.9%

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

                  if -1.00000000000000005e236 < (*.f64 x y) < 2e51

                  1. Initial program 98.2%

                    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                  2. Add Preprocessing
                  3. Taylor expanded in z around 0

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                    5. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                    6. lower-*.f6473.6

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

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

                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites64.0%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+236} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 9: 42.3% accurate, 1.1× speedup?

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

                    1. Initial program 91.3%

                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                    2. Add Preprocessing
                    3. Taylor expanded in z around 0

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                      5. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                      6. lower-*.f6486.1

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

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

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right) \]
                      2. Taylor expanded in x around inf

                        \[\leadsto \color{blue}{x \cdot y} \]
                      3. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{y \cdot x} \]
                        2. lower-*.f6465.3

                          \[\leadsto \color{blue}{y \cdot x} \]
                      4. Applied rewrites65.3%

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

                      if -1.9999999999999999e124 < (*.f64 x y) < 2e51

                      1. Initial program 98.0%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{c \cdot i} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{i \cdot c} \]
                        2. lower-*.f6443.2

                          \[\leadsto \color{blue}{i \cdot c} \]
                      5. Applied rewrites43.2%

                        \[\leadsto \color{blue}{i \cdot c} \]
                    7. Recombined 2 regimes into one program.
                    8. Final simplification52.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+124} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+51}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 10: 41.6% accurate, 1.1× speedup?

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

                      1. Initial program 88.9%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around 0

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right)\right) \]
                        6. lower-*.f6433.6

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, y \cdot x\right)\right)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites32.0%

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, c \cdot i\right)\right) \]
                        2. Taylor expanded in x around inf

                          \[\leadsto \color{blue}{x \cdot y} \]
                        3. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{y \cdot x} \]
                          2. lower-*.f6418.0

                            \[\leadsto \color{blue}{y \cdot x} \]
                        4. Applied rewrites18.0%

                          \[\leadsto \color{blue}{y \cdot x} \]
                        5. Taylor expanded in z around inf

                          \[\leadsto \color{blue}{t \cdot z} \]
                        6. Step-by-step derivation
                          1. lower-*.f6470.2

                            \[\leadsto \color{blue}{t \cdot z} \]
                        7. Applied rewrites70.2%

                          \[\leadsto \color{blue}{t \cdot z} \]

                        if -2.00000000000000003e116 < (*.f64 z t) < 5.0000000000000001e215

                        1. Initial program 97.4%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{c \cdot i} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{i \cdot c} \]
                          2. lower-*.f6438.5

                            \[\leadsto \color{blue}{i \cdot c} \]
                        5. Applied rewrites38.5%

                          \[\leadsto \color{blue}{i \cdot c} \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification46.3%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+116} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+215}\right):\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 11: 42.0% accurate, 1.1× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+192} \lor \neg \left(a \cdot b \leq 8.2 \cdot 10^{+146}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (if (or (<= (* a b) -3.8e+192) (not (<= (* a b) 8.2e+146))) (* a b) (* i c)))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double tmp;
                      	if (((a * b) <= -3.8e+192) || !((a * b) <= 8.2e+146)) {
                      		tmp = a * b;
                      	} else {
                      		tmp = i * c;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(x, y, z, t, a, b, c, i)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8), intent (in) :: c
                          real(8), intent (in) :: i
                          real(8) :: tmp
                          if (((a * b) <= (-3.8d+192)) .or. (.not. ((a * b) <= 8.2d+146))) then
                              tmp = a * b
                          else
                              tmp = i * c
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double tmp;
                      	if (((a * b) <= -3.8e+192) || !((a * b) <= 8.2e+146)) {
                      		tmp = a * b;
                      	} else {
                      		tmp = i * c;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a, b, c, i):
                      	tmp = 0
                      	if ((a * b) <= -3.8e+192) or not ((a * b) <= 8.2e+146):
                      		tmp = a * b
                      	else:
                      		tmp = i * c
                      	return tmp
                      
                      function code(x, y, z, t, a, b, c, i)
                      	tmp = 0.0
                      	if ((Float64(a * b) <= -3.8e+192) || !(Float64(a * b) <= 8.2e+146))
                      		tmp = Float64(a * b);
                      	else
                      		tmp = Float64(i * c);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a, b, c, i)
                      	tmp = 0.0;
                      	if (((a * b) <= -3.8e+192) || ~(((a * b) <= 8.2e+146)))
                      		tmp = a * b;
                      	else
                      		tmp = i * c;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(a * b), $MachinePrecision], -3.8e+192], N[Not[LessEqual[N[(a * b), $MachinePrecision], 8.2e+146]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(i * c), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+192} \lor \neg \left(a \cdot b \leq 8.2 \cdot 10^{+146}\right):\\
                      \;\;\;\;a \cdot b\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;i \cdot c\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 a b) < -3.7999999999999999e192 or 8.2000000000000007e146 < (*.f64 a b)

                        1. Initial program 88.7%

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

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

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

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

                            \[\leadsto \color{blue}{i \cdot c} + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) \]
                          5. lower-fma.f6490.3

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{b \cdot a} + \left(x \cdot y + z \cdot t\right)\right) \]
                          10. lower-fma.f6493.5

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z} + x \cdot y\right)\right) \]
                          15. lower-fma.f6493.5

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

                            \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{x \cdot y}\right)\right)\right) \]
                          17. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
                          18. lower-*.f6493.5

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

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

                          \[\leadsto \color{blue}{a \cdot b} \]
                        6. Step-by-step derivation
                          1. lower-*.f6471.5

                            \[\leadsto \color{blue}{a \cdot b} \]
                        7. Applied rewrites71.5%

                          \[\leadsto \color{blue}{a \cdot b} \]

                        if -3.7999999999999999e192 < (*.f64 a b) < 8.2000000000000007e146

                        1. Initial program 97.4%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{c \cdot i} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{i \cdot c} \]
                          2. lower-*.f6435.8

                            \[\leadsto \color{blue}{i \cdot c} \]
                        5. Applied rewrites35.8%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -3.8 \cdot 10^{+192} \lor \neg \left(a \cdot b \leq 8.2 \cdot 10^{+146}\right):\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 12: 27.9% accurate, 5.0× speedup?

                      \[\begin{array}{l} \\ a \cdot b \end{array} \]
                      (FPCore (x y z t a b c i) :precision binary64 (* a b))
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	return a * b;
                      }
                      
                      real(8) function code(x, y, z, t, a, b, c, i)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8), intent (in) :: c
                          real(8), intent (in) :: i
                          code = a * b
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	return a * b;
                      }
                      
                      def code(x, y, z, t, a, b, c, i):
                      	return a * b
                      
                      function code(x, y, z, t, a, b, c, i)
                      	return Float64(a * b)
                      end
                      
                      function tmp = code(x, y, z, t, a, b, c, i)
                      	tmp = a * b;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      a \cdot b
                      \end{array}
                      
                      Derivation
                      1. Initial program 95.3%

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

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

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

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

                          \[\leadsto \color{blue}{i \cdot c} + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) \]
                        5. lower-fma.f6496.5

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{b \cdot a} + \left(x \cdot y + z \cdot t\right)\right) \]
                        10. lower-fma.f6497.2

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z} + x \cdot y\right)\right) \]
                        15. lower-fma.f6497.6

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

                          \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{x \cdot y}\right)\right)\right) \]
                        17. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
                        18. lower-*.f6497.6

                          \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right)\right) \]
                      4. Applied rewrites97.6%

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

                        \[\leadsto \color{blue}{a \cdot b} \]
                      6. Step-by-step derivation
                        1. lower-*.f6421.9

                          \[\leadsto \color{blue}{a \cdot b} \]
                      7. Applied rewrites21.9%

                        \[\leadsto \color{blue}{a \cdot b} \]
                      8. Final simplification21.9%

                        \[\leadsto a \cdot b \]
                      9. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2024339 
                      (FPCore (x y z t a b c i)
                        :name "Linear.V4:$cdot from linear-1.19.1.3, C"
                        :precision binary64
                        (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))