Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C

Percentage Accurate: 99.9% → 99.9%
Time: 8.4s
Alternatives: 10
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ x \cdot \left(y + z\right) + z \cdot 5 \end{array} \]
(FPCore (x y z) :precision binary64 (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (y + z)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z):
	return (x * (y + z)) + (z * 5.0)
function code(x, y, z)
	return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0))
end
function tmp = code(x, y, z)
	tmp = (x * (y + z)) + (z * 5.0);
end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(y + z\right) + z \cdot 5
\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 10 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: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(y + z\right) + z \cdot 5 \end{array} \]
(FPCore (x y z) :precision binary64 (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (y + z)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
	return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z):
	return (x * (y + z)) + (z * 5.0)
function code(x, y, z)
	return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0))
end
function tmp = code(x, y, z)
	tmp = (x * (y + z)) + (z * 5.0);
end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(y + z\right) + z \cdot 5
\end{array}

Alternative 1: 99.9% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y + z, x, z \cdot 5\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (+ y z) x (* z 5.0)))
double code(double x, double y, double z) {
	return fma((y + z), x, (z * 5.0));
}
function code(x, y, z)
	return fma(Float64(y + z), x, Float64(z * 5.0))
end
code[x_, y_, z_] := N[(N[(y + z), $MachinePrecision] * x + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y + z, x, z \cdot 5\right)
\end{array}
Derivation
  1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x \cdot \left(y + z\right) + z \cdot 5} \]
    2. lift-*.f64N/A

      \[\leadsto \color{blue}{x \cdot \left(y + z\right)} + z \cdot 5 \]
    3. *-commutativeN/A

      \[\leadsto \color{blue}{\left(y + z\right) \cdot x} + z \cdot 5 \]
    4. lower-fma.f6499.9

      \[\leadsto \color{blue}{\mathsf{fma}\left(y + z, x, z \cdot 5\right)} \]
  4. Applied rewrites99.9%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y + z, x, z \cdot 5\right)} \]
  5. Add Preprocessing

Alternative 2: 98.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(z, 5, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -5.0)
   (* x (+ y z))
   (if (<= x 2.7e-6) (fma z 5.0 (* y x)) (fma z x (* y x)))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -5.0) {
		tmp = x * (y + z);
	} else if (x <= 2.7e-6) {
		tmp = fma(z, 5.0, (y * x));
	} else {
		tmp = fma(z, x, (y * x));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= -5.0)
		tmp = Float64(x * Float64(y + z));
	elseif (x <= 2.7e-6)
		tmp = fma(z, 5.0, Float64(y * x));
	else
		tmp = fma(z, x, Float64(y * x));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, -5.0], N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-6], N[(z * 5.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(z * x + N[(y * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5:\\
\;\;\;\;x \cdot \left(y + z\right)\\

\mathbf{elif}\;x \leq 2.7 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(z, 5, y \cdot x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5

    1. Initial program 100.0%

      \[x \cdot \left(y + z\right) + z \cdot 5 \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
      3. lower-+.f6499.7

        \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
    5. Applied rewrites99.7%

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

    if -5 < x < 2.69999999999999998e-6

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{x \cdot \left(y + z\right) + z \cdot 5} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(y + z\right)} + z \cdot 5 \]
      3. lift-+.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(y + z\right)} + z \cdot 5 \]
      4. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left(y \cdot x + z \cdot x\right)} + z \cdot 5 \]
      5. associate-+l+N/A

        \[\leadsto \color{blue}{y \cdot x + \left(z \cdot x + z \cdot 5\right)} \]
      6. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot x + z \cdot 5\right) + y \cdot x} \]
      7. lift-*.f64N/A

        \[\leadsto \left(z \cdot x + \color{blue}{z \cdot 5}\right) + y \cdot x \]
      8. distribute-lft-outN/A

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x + 5}, y \cdot x\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
      12. lower-*.f6499.9

        \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
    4. Applied rewrites99.9%

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

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

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

      if 2.69999999999999998e-6 < x

      1. Initial program 100.0%

        \[x \cdot \left(y + z\right) + z \cdot 5 \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

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

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

          \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
        3. lower-+.f6499.8

          \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
      5. Applied rewrites99.8%

        \[\leadsto \color{blue}{x \cdot \left(z + y\right)} \]
      6. Step-by-step derivation
        1. Applied rewrites99.8%

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

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

      Alternative 3: 98.4% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(y, x, z \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= x -5.0)
         (* x (+ y z))
         (if (<= x 2.7e-6) (fma y x (* z 5.0)) (fma z x (* y x)))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (x <= -5.0) {
      		tmp = x * (y + z);
      	} else if (x <= 2.7e-6) {
      		tmp = fma(y, x, (z * 5.0));
      	} else {
      		tmp = fma(z, x, (y * x));
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (x <= -5.0)
      		tmp = Float64(x * Float64(y + z));
      	elseif (x <= 2.7e-6)
      		tmp = fma(y, x, Float64(z * 5.0));
      	else
      		tmp = fma(z, x, Float64(y * x));
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[x, -5.0], N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-6], N[(y * x + N[(z * 5.0), $MachinePrecision]), $MachinePrecision], N[(z * x + N[(y * x), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -5:\\
      \;\;\;\;x \cdot \left(y + z\right)\\
      
      \mathbf{elif}\;x \leq 2.7 \cdot 10^{-6}:\\
      \;\;\;\;\mathsf{fma}\left(y, x, z \cdot 5\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -5

        1. Initial program 100.0%

          \[x \cdot \left(y + z\right) + z \cdot 5 \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

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

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

            \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
          3. lower-+.f6499.7

            \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
        5. Applied rewrites99.7%

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

        if -5 < x < 2.69999999999999998e-6

        1. Initial program 99.9%

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

            \[\leadsto \color{blue}{x \cdot \left(y + z\right) + z \cdot 5} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(y + z\right)} + z \cdot 5 \]
          3. lift-+.f64N/A

            \[\leadsto x \cdot \color{blue}{\left(y + z\right)} + z \cdot 5 \]
          4. distribute-rgt-inN/A

            \[\leadsto \color{blue}{\left(y \cdot x + z \cdot x\right)} + z \cdot 5 \]
          5. associate-+l+N/A

            \[\leadsto \color{blue}{y \cdot x + \left(z \cdot x + z \cdot 5\right)} \]
          6. +-commutativeN/A

            \[\leadsto \color{blue}{\left(z \cdot x + z \cdot 5\right) + y \cdot x} \]
          7. lift-*.f64N/A

            \[\leadsto \left(z \cdot x + \color{blue}{z \cdot 5}\right) + y \cdot x \]
          8. distribute-lft-outN/A

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

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

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x + 5}, y \cdot x\right) \]
          11. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
          12. lower-*.f6499.9

            \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
        4. Applied rewrites99.9%

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

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

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{5}, x \cdot y\right) \]
          2. Step-by-step derivation
            1. lift-fma.f64N/A

              \[\leadsto \color{blue}{z \cdot 5 + x \cdot y} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{x \cdot y + z \cdot 5} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{x \cdot y} + z \cdot 5 \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{y \cdot x} + z \cdot 5 \]
            5. lower-fma.f64N/A

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

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

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

          if 2.69999999999999998e-6 < x

          1. Initial program 100.0%

            \[x \cdot \left(y + z\right) + z \cdot 5 \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

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

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

              \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
            3. lower-+.f6499.8

              \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
          5. Applied rewrites99.8%

            \[\leadsto \color{blue}{x \cdot \left(z + y\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites99.8%

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

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

          Alternative 4: 82.6% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot \left(x + 5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= x -6.2e-49)
             (* x (+ y z))
             (if (<= x 1.6e-100) (* z (+ x 5.0)) (fma z x (* y x)))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (x <= -6.2e-49) {
          		tmp = x * (y + z);
          	} else if (x <= 1.6e-100) {
          		tmp = z * (x + 5.0);
          	} else {
          		tmp = fma(z, x, (y * x));
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (x <= -6.2e-49)
          		tmp = Float64(x * Float64(y + z));
          	elseif (x <= 1.6e-100)
          		tmp = Float64(z * Float64(x + 5.0));
          	else
          		tmp = fma(z, x, Float64(y * x));
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[x, -6.2e-49], N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-100], N[(z * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], N[(z * x + N[(y * x), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\
          \;\;\;\;x \cdot \left(y + z\right)\\
          
          \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\
          \;\;\;\;z \cdot \left(x + 5\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -6.2e-49

            1. Initial program 100.0%

              \[x \cdot \left(y + z\right) + z \cdot 5 \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

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

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

                \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
              3. lower-+.f6491.5

                \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
            5. Applied rewrites91.5%

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

            if -6.2e-49 < x < 1.60000000000000008e-100

            1. Initial program 99.9%

              \[x \cdot \left(y + z\right) + z \cdot 5 \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto \color{blue}{5 \cdot z + x \cdot z} \]
            4. Step-by-step derivation
              1. distribute-rgt-inN/A

                \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]
              3. lower-+.f6472.1

                \[\leadsto z \cdot \color{blue}{\left(5 + x\right)} \]
            5. Applied rewrites72.1%

              \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]

            if 1.60000000000000008e-100 < x

            1. Initial program 99.9%

              \[x \cdot \left(y + z\right) + z \cdot 5 \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

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

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

                \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
              3. lower-+.f6489.8

                \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
            5. Applied rewrites89.8%

              \[\leadsto \color{blue}{x \cdot \left(z + y\right)} \]
            6. Step-by-step derivation
              1. Applied rewrites89.8%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot \left(x + 5\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, y \cdot x\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 5: 83.2% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot \left(x + 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* x (+ y z))))
               (if (<= x -6.2e-49) t_0 (if (<= x 1.6e-100) (* z (+ x 5.0)) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = x * (y + z);
            	double tmp;
            	if (x <= -6.2e-49) {
            		tmp = t_0;
            	} else if (x <= 1.6e-100) {
            		tmp = z * (x + 5.0);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = x * (y + z)
                if (x <= (-6.2d-49)) then
                    tmp = t_0
                else if (x <= 1.6d-100) then
                    tmp = z * (x + 5.0d0)
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = x * (y + z);
            	double tmp;
            	if (x <= -6.2e-49) {
            		tmp = t_0;
            	} else if (x <= 1.6e-100) {
            		tmp = z * (x + 5.0);
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = x * (y + z)
            	tmp = 0
            	if x <= -6.2e-49:
            		tmp = t_0
            	elif x <= 1.6e-100:
            		tmp = z * (x + 5.0)
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(x * Float64(y + z))
            	tmp = 0.0
            	if (x <= -6.2e-49)
            		tmp = t_0;
            	elseif (x <= 1.6e-100)
            		tmp = Float64(z * Float64(x + 5.0));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = x * (y + z);
            	tmp = 0.0;
            	if (x <= -6.2e-49)
            		tmp = t_0;
            	elseif (x <= 1.6e-100)
            		tmp = z * (x + 5.0);
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e-49], t$95$0, If[LessEqual[x, 1.6e-100], N[(z * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := x \cdot \left(y + z\right)\\
            \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\
            \;\;\;\;z \cdot \left(x + 5\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -6.2e-49 or 1.60000000000000008e-100 < x

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

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

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

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
                3. lower-+.f6490.5

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
              5. Applied rewrites90.5%

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

              if -6.2e-49 < x < 1.60000000000000008e-100

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in y around 0

                \[\leadsto \color{blue}{5 \cdot z + x \cdot z} \]
              4. Step-by-step derivation
                1. distribute-rgt-inN/A

                  \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]
                3. lower-+.f6472.1

                  \[\leadsto z \cdot \color{blue}{\left(5 + x\right)} \]
              5. Applied rewrites72.1%

                \[\leadsto \color{blue}{z \cdot \left(5 + x\right)} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification83.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot \left(x + 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 6: 83.2% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(y + z\right)\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* x (+ y z))))
               (if (<= x -6.2e-49) t_0 (if (<= x 1.6e-100) (* z 5.0) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = x * (y + z);
            	double tmp;
            	if (x <= -6.2e-49) {
            		tmp = t_0;
            	} else if (x <= 1.6e-100) {
            		tmp = z * 5.0;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: t_0
                real(8) :: tmp
                t_0 = x * (y + z)
                if (x <= (-6.2d-49)) then
                    tmp = t_0
                else if (x <= 1.6d-100) then
                    tmp = z * 5.0d0
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = x * (y + z);
            	double tmp;
            	if (x <= -6.2e-49) {
            		tmp = t_0;
            	} else if (x <= 1.6e-100) {
            		tmp = z * 5.0;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = x * (y + z)
            	tmp = 0
            	if x <= -6.2e-49:
            		tmp = t_0
            	elif x <= 1.6e-100:
            		tmp = z * 5.0
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(x * Float64(y + z))
            	tmp = 0.0
            	if (x <= -6.2e-49)
            		tmp = t_0;
            	elseif (x <= 1.6e-100)
            		tmp = Float64(z * 5.0);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = x * (y + z);
            	tmp = 0.0;
            	if (x <= -6.2e-49)
            		tmp = t_0;
            	elseif (x <= 1.6e-100)
            		tmp = z * 5.0;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e-49], t$95$0, If[LessEqual[x, 1.6e-100], N[(z * 5.0), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := x \cdot \left(y + z\right)\\
            \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\
            \;\;\;\;z \cdot 5\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -6.2e-49 or 1.60000000000000008e-100 < x

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

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

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

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
                3. lower-+.f6490.5

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
              5. Applied rewrites90.5%

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

              if -6.2e-49 < x < 1.60000000000000008e-100

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{5 \cdot z} \]
              4. Step-by-step derivation
                1. lower-*.f6472.1

                  \[\leadsto \color{blue}{5 \cdot z} \]
              5. Applied rewrites72.1%

                \[\leadsto \color{blue}{5 \cdot z} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification83.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-100}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + z\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 7: 60.0% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.46 \cdot 10^{-49}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.68 \cdot 10^{-100}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= x -1.46e-49) (* y x) (if (<= x 1.68e-100) (* z 5.0) (* y x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -1.46e-49) {
            		tmp = y * x;
            	} else if (x <= 1.68e-100) {
            		tmp = z * 5.0;
            	} else {
            		tmp = y * x;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: tmp
                if (x <= (-1.46d-49)) then
                    tmp = y * x
                else if (x <= 1.68d-100) then
                    tmp = z * 5.0d0
                else
                    tmp = y * x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -1.46e-49) {
            		tmp = y * x;
            	} else if (x <= 1.68e-100) {
            		tmp = z * 5.0;
            	} else {
            		tmp = y * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if x <= -1.46e-49:
            		tmp = y * x
            	elif x <= 1.68e-100:
            		tmp = z * 5.0
            	else:
            		tmp = y * x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if (x <= -1.46e-49)
            		tmp = Float64(y * x);
            	elseif (x <= 1.68e-100)
            		tmp = Float64(z * 5.0);
            	else
            		tmp = Float64(y * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if (x <= -1.46e-49)
            		tmp = y * x;
            	elseif (x <= 1.68e-100)
            		tmp = z * 5.0;
            	else
            		tmp = y * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[LessEqual[x, -1.46e-49], N[(y * x), $MachinePrecision], If[LessEqual[x, 1.68e-100], N[(z * 5.0), $MachinePrecision], N[(y * x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -1.46 \cdot 10^{-49}:\\
            \;\;\;\;y \cdot x\\
            
            \mathbf{elif}\;x \leq 1.68 \cdot 10^{-100}:\\
            \;\;\;\;z \cdot 5\\
            
            \mathbf{else}:\\
            \;\;\;\;y \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -1.46000000000000007e-49 or 1.68000000000000012e-100 < x

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in y around inf

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

                  \[\leadsto \color{blue}{x \cdot y} \]
              5. Applied rewrites62.2%

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

              if -1.46000000000000007e-49 < x < 1.68000000000000012e-100

              1. Initial program 99.9%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{5 \cdot z} \]
              4. Step-by-step derivation
                1. lower-*.f6472.1

                  \[\leadsto \color{blue}{5 \cdot z} \]
              5. Applied rewrites72.1%

                \[\leadsto \color{blue}{5 \cdot z} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification65.8%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.46 \cdot 10^{-49}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;x \leq 1.68 \cdot 10^{-100}:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
            5. Add Preprocessing

            Alternative 8: 60.4% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq 0.00325:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= x -5.0) (* z x) (if (<= x 0.00325) (* z 5.0) (* z x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -5.0) {
            		tmp = z * x;
            	} else if (x <= 0.00325) {
            		tmp = z * 5.0;
            	} else {
            		tmp = z * x;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: tmp
                if (x <= (-5.0d0)) then
                    tmp = z * x
                else if (x <= 0.00325d0) then
                    tmp = z * 5.0d0
                else
                    tmp = z * x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -5.0) {
            		tmp = z * x;
            	} else if (x <= 0.00325) {
            		tmp = z * 5.0;
            	} else {
            		tmp = z * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if x <= -5.0:
            		tmp = z * x
            	elif x <= 0.00325:
            		tmp = z * 5.0
            	else:
            		tmp = z * x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if (x <= -5.0)
            		tmp = Float64(z * x);
            	elseif (x <= 0.00325)
            		tmp = Float64(z * 5.0);
            	else
            		tmp = Float64(z * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if (x <= -5.0)
            		tmp = z * x;
            	elseif (x <= 0.00325)
            		tmp = z * 5.0;
            	else
            		tmp = z * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[LessEqual[x, -5.0], N[(z * x), $MachinePrecision], If[LessEqual[x, 0.00325], N[(z * 5.0), $MachinePrecision], N[(z * x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -5:\\
            \;\;\;\;z \cdot x\\
            
            \mathbf{elif}\;x \leq 0.00325:\\
            \;\;\;\;z \cdot 5\\
            
            \mathbf{else}:\\
            \;\;\;\;z \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -5 or 0.00324999999999999985 < x

              1. Initial program 100.0%

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

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

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

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
                3. lower-+.f6499.7

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
              5. Applied rewrites99.7%

                \[\leadsto \color{blue}{x \cdot \left(z + y\right)} \]
              6. Taylor expanded in z around inf

                \[\leadsto x \cdot \color{blue}{z} \]
              7. Step-by-step derivation
                1. Applied rewrites41.1%

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

                if -5 < x < 0.00324999999999999985

                1. Initial program 99.9%

                  \[x \cdot \left(y + z\right) + z \cdot 5 \]
                2. Add Preprocessing
                3. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{5 \cdot z} \]
                4. Step-by-step derivation
                  1. lower-*.f6463.4

                    \[\leadsto \color{blue}{5 \cdot z} \]
                5. Applied rewrites63.4%

                  \[\leadsto \color{blue}{5 \cdot z} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification52.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq 0.00325:\\ \;\;\;\;z \cdot 5\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
              10. Add Preprocessing

              Alternative 9: 98.8% accurate, 1.1× speedup?

              \[\begin{array}{l} \\ \mathsf{fma}\left(z, x + 5, y \cdot x\right) \end{array} \]
              (FPCore (x y z) :precision binary64 (fma z (+ x 5.0) (* y x)))
              double code(double x, double y, double z) {
              	return fma(z, (x + 5.0), (y * x));
              }
              
              function code(x, y, z)
              	return fma(z, Float64(x + 5.0), Float64(y * x))
              end
              
              code[x_, y_, z_] := N[(z * N[(x + 5.0), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \mathsf{fma}\left(z, x + 5, y \cdot x\right)
              \end{array}
              
              Derivation
              1. Initial program 99.9%

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

                  \[\leadsto \color{blue}{x \cdot \left(y + z\right) + z \cdot 5} \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{x \cdot \left(y + z\right)} + z \cdot 5 \]
                3. lift-+.f64N/A

                  \[\leadsto x \cdot \color{blue}{\left(y + z\right)} + z \cdot 5 \]
                4. distribute-rgt-inN/A

                  \[\leadsto \color{blue}{\left(y \cdot x + z \cdot x\right)} + z \cdot 5 \]
                5. associate-+l+N/A

                  \[\leadsto \color{blue}{y \cdot x + \left(z \cdot x + z \cdot 5\right)} \]
                6. +-commutativeN/A

                  \[\leadsto \color{blue}{\left(z \cdot x + z \cdot 5\right) + y \cdot x} \]
                7. lift-*.f64N/A

                  \[\leadsto \left(z \cdot x + \color{blue}{z \cdot 5}\right) + y \cdot x \]
                8. distribute-lft-outN/A

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

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

                  \[\leadsto \mathsf{fma}\left(z, \color{blue}{x + 5}, y \cdot x\right) \]
                11. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
                12. lower-*.f6499.6

                  \[\leadsto \mathsf{fma}\left(z, x + 5, \color{blue}{x \cdot y}\right) \]
              4. Applied rewrites99.6%

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, x + 5, x \cdot y\right)} \]
              5. Final simplification99.6%

                \[\leadsto \mathsf{fma}\left(z, x + 5, y \cdot x\right) \]
              6. Add Preprocessing

              Alternative 10: 27.6% accurate, 2.8× speedup?

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

                \[x \cdot \left(y + z\right) + z \cdot 5 \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

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

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

                  \[\leadsto x \cdot \color{blue}{\left(z + y\right)} \]
                3. lower-+.f6468.6

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

                \[\leadsto \color{blue}{x \cdot \left(z + y\right)} \]
              6. Taylor expanded in z around inf

                \[\leadsto x \cdot \color{blue}{z} \]
              7. Step-by-step derivation
                1. Applied rewrites22.6%

                  \[\leadsto z \cdot \color{blue}{x} \]
                2. Add Preprocessing

                Developer Target 1: 97.9% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \left(x + 5\right) \cdot z + x \cdot y \end{array} \]
                (FPCore (x y z) :precision binary64 (+ (* (+ x 5.0) z) (* x y)))
                double code(double x, double y, double z) {
                	return ((x + 5.0) * z) + (x * y);
                }
                
                real(8) function code(x, y, z)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    code = ((x + 5.0d0) * z) + (x * y)
                end function
                
                public static double code(double x, double y, double z) {
                	return ((x + 5.0) * z) + (x * y);
                }
                
                def code(x, y, z):
                	return ((x + 5.0) * z) + (x * y)
                
                function code(x, y, z)
                	return Float64(Float64(Float64(x + 5.0) * z) + Float64(x * y))
                end
                
                function tmp = code(x, y, z)
                	tmp = ((x + 5.0) * z) + (x * y);
                end
                
                code[x_, y_, z_] := N[(N[(N[(x + 5.0), $MachinePrecision] * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(x + 5\right) \cdot z + x \cdot y
                \end{array}
                

                Reproduce

                ?
                herbie shell --seed 2024233 
                (FPCore (x y z)
                  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
                  :precision binary64
                
                  :alt
                  (! :herbie-platform default (+ (* (+ x 5) z) (* x y)))
                
                  (+ (* x (+ y z)) (* z 5.0)))