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

Percentage Accurate: 99.9% → 100.0%
Time: 5.9s
Alternatives: 9
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 9 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: 100.0% accurate, 1.1× speedup?

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

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

    \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{+202}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{+24}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 5:\\ \;\;\;\;5 \cdot z\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+160}:\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4.6e+202)
   (* x y)
   (if (<= x -1.55e+24)
     (* x z)
     (if (<= x -7.5e-60)
       (* x y)
       (if (<= x 5.0) (* 5.0 z) (if (<= x 2.2e+160) (* x z) (* x y)))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.6e+202) {
		tmp = x * y;
	} else if (x <= -1.55e+24) {
		tmp = x * z;
	} else if (x <= -7.5e-60) {
		tmp = x * y;
	} else if (x <= 5.0) {
		tmp = 5.0 * z;
	} else if (x <= 2.2e+160) {
		tmp = x * z;
	} else {
		tmp = x * y;
	}
	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 <= (-4.6d+202)) then
        tmp = x * y
    else if (x <= (-1.55d+24)) then
        tmp = x * z
    else if (x <= (-7.5d-60)) then
        tmp = x * y
    else if (x <= 5.0d0) then
        tmp = 5.0d0 * z
    else if (x <= 2.2d+160) then
        tmp = x * z
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.6e+202) {
		tmp = x * y;
	} else if (x <= -1.55e+24) {
		tmp = x * z;
	} else if (x <= -7.5e-60) {
		tmp = x * y;
	} else if (x <= 5.0) {
		tmp = 5.0 * z;
	} else if (x <= 2.2e+160) {
		tmp = x * z;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4.6e+202:
		tmp = x * y
	elif x <= -1.55e+24:
		tmp = x * z
	elif x <= -7.5e-60:
		tmp = x * y
	elif x <= 5.0:
		tmp = 5.0 * z
	elif x <= 2.2e+160:
		tmp = x * z
	else:
		tmp = x * y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4.6e+202)
		tmp = Float64(x * y);
	elseif (x <= -1.55e+24)
		tmp = Float64(x * z);
	elseif (x <= -7.5e-60)
		tmp = Float64(x * y);
	elseif (x <= 5.0)
		tmp = Float64(5.0 * z);
	elseif (x <= 2.2e+160)
		tmp = Float64(x * z);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4.6e+202)
		tmp = x * y;
	elseif (x <= -1.55e+24)
		tmp = x * z;
	elseif (x <= -7.5e-60)
		tmp = x * y;
	elseif (x <= 5.0)
		tmp = 5.0 * z;
	elseif (x <= 2.2e+160)
		tmp = x * z;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4.6e+202], N[(x * y), $MachinePrecision], If[LessEqual[x, -1.55e+24], N[(x * z), $MachinePrecision], If[LessEqual[x, -7.5e-60], N[(x * y), $MachinePrecision], If[LessEqual[x, 5.0], N[(5.0 * z), $MachinePrecision], If[LessEqual[x, 2.2e+160], N[(x * z), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{+202}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq -1.55 \cdot 10^{+24}:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-60}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq 5:\\
\;\;\;\;5 \cdot z\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{+160}:\\
\;\;\;\;x \cdot z\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.59999999999999998e202 or -1.55000000000000005e24 < x < -7.5000000000000002e-60 or 2.19999999999999992e160 < x

    1. Initial program 100.0%

      \[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. *-commutativeN/A

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

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

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

    if -4.59999999999999998e202 < x < -1.55000000000000005e24 or 5 < x < 2.19999999999999992e160

    1. Initial program 98.7%

      \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
      17. sub-negN/A

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

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

        \[\leadsto \color{blue}{\left(x - -5\right) \cdot z} + y \cdot x \]
      20. lower-fma.f64100.0

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
      2. distribute-lft-inN/A

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

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
      5. mul-1-negN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
      6. remove-double-negN/A

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

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

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

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

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

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

      if -7.5000000000000002e-60 < x < 5

      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-*.f6475.6

          \[\leadsto \color{blue}{5 \cdot z} \]
      5. Applied rewrites75.6%

        \[\leadsto \color{blue}{5 \cdot z} \]
    12. Recombined 3 regimes into one program.
    13. Final simplification70.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{+202}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{+24}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 5:\\ \;\;\;\;5 \cdot z\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+160}:\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
    14. Add Preprocessing

    Alternative 3: 98.0% accurate, 0.7× speedup?

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

      1. Initial program 98.4%

        \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
        17. sub-negN/A

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

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

          \[\leadsto \color{blue}{\left(x - -5\right) \cdot z} + y \cdot x \]
        20. lower-fma.f64100.0

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
      8. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
        2. distribute-lft-inN/A

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
        5. mul-1-negN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
        6. remove-double-negN/A

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

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

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

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

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

        if -1.3e19 < x < 5

        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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
          17. sub-negN/A

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

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

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

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

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

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

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

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

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

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

          if 5 < x

          1. Initial program 100.0%

            \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
            17. sub-negN/A

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
          8. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
            2. distribute-lft-inN/A

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

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
            5. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
            6. remove-double-negN/A

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

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

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

            \[\leadsto \color{blue}{\left(y + z\right) \cdot x} \]
        9. Recombined 3 regimes into one program.
        10. Final simplification99.7%

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

        Alternative 4: 83.8% accurate, 0.7× speedup?

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

          1. Initial program 98.6%

            \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
            17. sub-negN/A

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

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

              \[\leadsto \color{blue}{\left(x - -5\right) \cdot z} + y \cdot x \]
            20. lower-fma.f64100.0

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

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

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
          8. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
            2. distribute-lft-inN/A

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

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
            5. mul-1-negN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
            6. remove-double-negN/A

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

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

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

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

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

            if -7.5000000000000002e-60 < x < 7.50000000000000006e-29

            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}{x \cdot z} + z \cdot 5 \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{z \cdot x} + z \cdot 5 \]
              2. lower-*.f6478.6

                \[\leadsto \color{blue}{z \cdot x} + z \cdot 5 \]
            5. Applied rewrites78.6%

              \[\leadsto \color{blue}{z \cdot x} + z \cdot 5 \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

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

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

                \[\leadsto \color{blue}{z \cdot 5} + z \cdot x \]
              4. lower-fma.f6478.7

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, 5, z \cdot x\right)} \]
            7. Applied rewrites78.7%

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

            if 7.50000000000000006e-29 < x

            1. Initial program 100.0%

              \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
              17. sub-negN/A

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
            8. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
              2. distribute-lft-inN/A

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
              5. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
              6. remove-double-negN/A

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

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

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

              \[\leadsto \color{blue}{\left(y + z\right) \cdot x} \]
          11. Recombined 3 regimes into one program.
          12. Final simplification88.8%

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

          Alternative 5: 83.7% accurate, 0.8× speedup?

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

            1. Initial program 98.6%

              \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
              17. sub-negN/A

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

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

                \[\leadsto \color{blue}{\left(x - -5\right) \cdot z} + y \cdot x \]
              20. lower-fma.f64100.0

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

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

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

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

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

              \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
            8. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
              2. distribute-lft-inN/A

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
              5. mul-1-negN/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
              6. remove-double-negN/A

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

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

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

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

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

              if -7.5000000000000002e-60 < x < 7.50000000000000006e-29

              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-*.f6478.6

                  \[\leadsto \color{blue}{5 \cdot z} \]
              5. Applied rewrites78.6%

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

              if 7.50000000000000006e-29 < x

              1. Initial program 100.0%

                \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
                17. sub-negN/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
              8. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
                2. distribute-lft-inN/A

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

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

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
                5. mul-1-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
                6. remove-double-negN/A

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

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

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

                \[\leadsto \color{blue}{\left(y + z\right) \cdot x} \]
            11. Recombined 3 regimes into one program.
            12. Final simplification88.8%

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

            Alternative 6: 84.2% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + z\right) \cdot x\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-29}:\\ \;\;\;\;5 \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* (+ y z) x)))
               (if (<= x -7.5e-60) t_0 (if (<= x 7.5e-29) (* 5.0 z) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = (y + z) * x;
            	double tmp;
            	if (x <= -7.5e-60) {
            		tmp = t_0;
            	} else if (x <= 7.5e-29) {
            		tmp = 5.0 * z;
            	} 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 = (y + z) * x
                if (x <= (-7.5d-60)) then
                    tmp = t_0
                else if (x <= 7.5d-29) then
                    tmp = 5.0d0 * z
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = (y + z) * x;
            	double tmp;
            	if (x <= -7.5e-60) {
            		tmp = t_0;
            	} else if (x <= 7.5e-29) {
            		tmp = 5.0 * z;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = (y + z) * x
            	tmp = 0
            	if x <= -7.5e-60:
            		tmp = t_0
            	elif x <= 7.5e-29:
            		tmp = 5.0 * z
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(Float64(y + z) * x)
            	tmp = 0.0
            	if (x <= -7.5e-60)
            		tmp = t_0;
            	elseif (x <= 7.5e-29)
            		tmp = Float64(5.0 * z);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = (y + z) * x;
            	tmp = 0.0;
            	if (x <= -7.5e-60)
            		tmp = t_0;
            	elseif (x <= 7.5e-29)
            		tmp = 5.0 * z;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y + z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -7.5e-60], t$95$0, If[LessEqual[x, 7.5e-29], N[(5.0 * z), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(y + z\right) \cdot x\\
            \mathbf{if}\;x \leq -7.5 \cdot 10^{-60}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;x \leq 7.5 \cdot 10^{-29}:\\
            \;\;\;\;5 \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -7.5000000000000002e-60 or 7.50000000000000006e-29 < x

              1. Initial program 99.3%

                \[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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto z \cdot \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) + y \cdot x \]
                17. sub-negN/A

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{-1 \cdot \left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
              8. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \color{blue}{\mathsf{neg}\left(x \cdot \left(-1 \cdot y + -1 \cdot z\right)\right)} \]
                2. distribute-lft-inN/A

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

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

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \left(y + z\right)\right)\right) \cdot x} \]
                5. mul-1-negN/A

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(y + z\right)\right)\right)}\right)\right) \cdot x \]
                6. remove-double-negN/A

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

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

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

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

              if -7.5000000000000002e-60 < x < 7.50000000000000006e-29

              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-*.f6478.6

                  \[\leadsto \color{blue}{5 \cdot z} \]
              5. Applied rewrites78.6%

                \[\leadsto \color{blue}{5 \cdot z} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 7: 74.9% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x - -5\right) \cdot z\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{-112}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1200000000:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* (- x -5.0) z)))
               (if (<= z -1.05e-112) t_0 (if (<= z 1200000000.0) (* x y) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = (x - -5.0) * z;
            	double tmp;
            	if (z <= -1.05e-112) {
            		tmp = t_0;
            	} else if (z <= 1200000000.0) {
            		tmp = x * y;
            	} 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 - (-5.0d0)) * z
                if (z <= (-1.05d-112)) then
                    tmp = t_0
                else if (z <= 1200000000.0d0) then
                    tmp = x * y
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double t_0 = (x - -5.0) * z;
            	double tmp;
            	if (z <= -1.05e-112) {
            		tmp = t_0;
            	} else if (z <= 1200000000.0) {
            		tmp = x * y;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = (x - -5.0) * z
            	tmp = 0
            	if z <= -1.05e-112:
            		tmp = t_0
            	elif z <= 1200000000.0:
            		tmp = x * y
            	else:
            		tmp = t_0
            	return tmp
            
            function code(x, y, z)
            	t_0 = Float64(Float64(x - -5.0) * z)
            	tmp = 0.0
            	if (z <= -1.05e-112)
            		tmp = t_0;
            	elseif (z <= 1200000000.0)
            		tmp = Float64(x * y);
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	t_0 = (x - -5.0) * z;
            	tmp = 0.0;
            	if (z <= -1.05e-112)
            		tmp = t_0;
            	elseif (z <= 1200000000.0)
            		tmp = x * y;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - -5.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.05e-112], t$95$0, If[LessEqual[z, 1200000000.0], N[(x * y), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(x - -5\right) \cdot z\\
            \mathbf{if}\;z \leq -1.05 \cdot 10^{-112}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq 1200000000:\\
            \;\;\;\;x \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.05e-112 or 1.2e9 < z

              1. Initial program 99.2%

                \[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. *-commutativeN/A

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

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

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

                  \[\leadsto \left(x + \color{blue}{\left(\mathsf{neg}\left(-5\right)\right)}\right) \cdot z \]
                6. sub-negN/A

                  \[\leadsto \color{blue}{\left(x - -5\right)} \cdot z \]
                7. lower--.f6487.7

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

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

              if -1.05e-112 < z < 1.2e9

              1. Initial program 100.0%

                \[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. *-commutativeN/A

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

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

                \[\leadsto \color{blue}{y \cdot x} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification80.6%

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

            Alternative 8: 60.7% accurate, 0.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{-60}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-29}:\\ \;\;\;\;5 \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= x -7.5e-60) (* x y) (if (<= x 7.5e-29) (* 5.0 z) (* x y))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -7.5e-60) {
            		tmp = x * y;
            	} else if (x <= 7.5e-29) {
            		tmp = 5.0 * z;
            	} else {
            		tmp = x * y;
            	}
            	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 <= (-7.5d-60)) then
                    tmp = x * y
                else if (x <= 7.5d-29) then
                    tmp = 5.0d0 * z
                else
                    tmp = x * y
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -7.5e-60) {
            		tmp = x * y;
            	} else if (x <= 7.5e-29) {
            		tmp = 5.0 * z;
            	} else {
            		tmp = x * y;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if x <= -7.5e-60:
            		tmp = x * y
            	elif x <= 7.5e-29:
            		tmp = 5.0 * z
            	else:
            		tmp = x * y
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if (x <= -7.5e-60)
            		tmp = Float64(x * y);
            	elseif (x <= 7.5e-29)
            		tmp = Float64(5.0 * z);
            	else
            		tmp = Float64(x * y);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if (x <= -7.5e-60)
            		tmp = x * y;
            	elseif (x <= 7.5e-29)
            		tmp = 5.0 * z;
            	else
            		tmp = x * y;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[LessEqual[x, -7.5e-60], N[(x * y), $MachinePrecision], If[LessEqual[x, 7.5e-29], N[(5.0 * z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -7.5 \cdot 10^{-60}:\\
            \;\;\;\;x \cdot y\\
            
            \mathbf{elif}\;x \leq 7.5 \cdot 10^{-29}:\\
            \;\;\;\;5 \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot y\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -7.5000000000000002e-60 or 7.50000000000000006e-29 < x

              1. Initial program 99.3%

                \[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. *-commutativeN/A

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

                  \[\leadsto \color{blue}{y \cdot x} \]
              5. Applied rewrites52.8%

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

              if -7.5000000000000002e-60 < x < 7.50000000000000006e-29

              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-*.f6478.6

                  \[\leadsto \color{blue}{5 \cdot z} \]
              5. Applied rewrites78.6%

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

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

            Alternative 9: 35.2% accurate, 2.8× speedup?

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

              \[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-*.f6437.7

                \[\leadsto \color{blue}{5 \cdot z} \]
            5. Applied rewrites37.7%

              \[\leadsto \color{blue}{5 \cdot z} \]
            6. Add Preprocessing

            Developer Target 1: 97.8% 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 2024296 
            (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)))