Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4

Percentage Accurate: 99.9% → 100.0%
Time: 7.8s
Alternatives: 12
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + 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 = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z):
	return ((((x + y) + y) + x) + z) + x
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x)
end
function tmp = code(x, y, z)
	tmp = ((((x + y) + y) + x) + z) + x;
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + 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 = ((((x + y) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
	return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z):
	return ((((x + y) + y) + x) + z) + x
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x)
end
function tmp = code(x, y, z)
	tmp = ((((x + y) + y) + x) + z) + x;
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 100.0% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto z + \left(\color{blue}{2 \cdot \left(x + y\right)} + x\right) \]
    7. accelerator-lowering-fma.f64N/A

      \[\leadsto z + \color{blue}{\mathsf{fma}\left(2, x + y, x\right)} \]
    8. +-lowering-+.f6499.9

      \[\leadsto z + \mathsf{fma}\left(2, \color{blue}{x + y}, x\right) \]
  4. Applied egg-rr99.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{3} \cdot x + \left(2 \cdot y + z\right) \]
    8. accelerator-lowering-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(3, x, 2 \cdot y + z\right)} \]
    9. accelerator-lowering-fma.f64100.0

      \[\leadsto \mathsf{fma}\left(3, x, \color{blue}{\mathsf{fma}\left(2, y, z\right)}\right) \]
  6. Applied egg-rr100.0%

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

Alternative 2: 52.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+71}:\\ \;\;\;\;3 \cdot x\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-31}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-5}:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;3 \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.4e+71)
   (* 3.0 x)
   (if (<= x -1.35e-31)
     (+ x z)
     (if (<= x 4.8e-5) (* 2.0 y) (if (<= x 2.1e+98) (+ x z) (* 3.0 x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.4e+71) {
		tmp = 3.0 * x;
	} else if (x <= -1.35e-31) {
		tmp = x + z;
	} else if (x <= 4.8e-5) {
		tmp = 2.0 * y;
	} else if (x <= 2.1e+98) {
		tmp = x + z;
	} else {
		tmp = 3.0 * 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 <= (-2.4d+71)) then
        tmp = 3.0d0 * x
    else if (x <= (-1.35d-31)) then
        tmp = x + z
    else if (x <= 4.8d-5) then
        tmp = 2.0d0 * y
    else if (x <= 2.1d+98) then
        tmp = x + z
    else
        tmp = 3.0d0 * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.4e+71) {
		tmp = 3.0 * x;
	} else if (x <= -1.35e-31) {
		tmp = x + z;
	} else if (x <= 4.8e-5) {
		tmp = 2.0 * y;
	} else if (x <= 2.1e+98) {
		tmp = x + z;
	} else {
		tmp = 3.0 * x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.4e+71:
		tmp = 3.0 * x
	elif x <= -1.35e-31:
		tmp = x + z
	elif x <= 4.8e-5:
		tmp = 2.0 * y
	elif x <= 2.1e+98:
		tmp = x + z
	else:
		tmp = 3.0 * x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.4e+71)
		tmp = Float64(3.0 * x);
	elseif (x <= -1.35e-31)
		tmp = Float64(x + z);
	elseif (x <= 4.8e-5)
		tmp = Float64(2.0 * y);
	elseif (x <= 2.1e+98)
		tmp = Float64(x + z);
	else
		tmp = Float64(3.0 * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.4e+71)
		tmp = 3.0 * x;
	elseif (x <= -1.35e-31)
		tmp = x + z;
	elseif (x <= 4.8e-5)
		tmp = 2.0 * y;
	elseif (x <= 2.1e+98)
		tmp = x + z;
	else
		tmp = 3.0 * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.4e+71], N[(3.0 * x), $MachinePrecision], If[LessEqual[x, -1.35e-31], N[(x + z), $MachinePrecision], If[LessEqual[x, 4.8e-5], N[(2.0 * y), $MachinePrecision], If[LessEqual[x, 2.1e+98], N[(x + z), $MachinePrecision], N[(3.0 * x), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+71}:\\
\;\;\;\;3 \cdot x\\

\mathbf{elif}\;x \leq -1.35 \cdot 10^{-31}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-5}:\\
\;\;\;\;2 \cdot y\\

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+98}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.39999999999999981e71 or 2.10000000000000004e98 < x

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{x \cdot 3} \]
      2. *-lowering-*.f6482.7

        \[\leadsto \color{blue}{x \cdot 3} \]
    5. Simplified82.7%

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

    if -2.39999999999999981e71 < x < -1.35000000000000007e-31 or 4.8000000000000001e-5 < x < 2.10000000000000004e98

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{z} + x \]
    4. Step-by-step derivation
      1. Simplified59.7%

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

      if -1.35000000000000007e-31 < x < 4.8000000000000001e-5

      1. Initial program 100.0%

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

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

          \[\leadsto \color{blue}{2 \cdot y} \]
      5. Simplified57.1%

        \[\leadsto \color{blue}{2 \cdot y} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification65.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+71}:\\ \;\;\;\;3 \cdot x\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-31}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-5}:\\ \;\;\;\;2 \cdot y\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;3 \cdot x\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 85.5% accurate, 0.7× speedup?

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

      1. Initial program 100.0%

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

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

          \[\leadsto \color{blue}{\left(2 \cdot y + z\right)} + x \]
        2. accelerator-lowering-fma.f6495.2

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} + x \]
      5. Simplified95.2%

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

      if -3.6999999999999999e76 < z < 1.05e10

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{2 \cdot \left(x + y\right)} + x \]
        3. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x + y, x\right)} \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(2, \color{blue}{y + x}, x\right) \]
        5. +-lowering-+.f6492.6

          \[\leadsto \mathsf{fma}\left(2, \color{blue}{y + x}, x\right) \]
      5. Simplified92.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(2, y + x, x\right)} \]
      6. Step-by-step derivation
        1. distribute-lft-inN/A

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

          \[\leadsto \color{blue}{2 \cdot y + \left(2 \cdot x + x\right)} \]
        3. distribute-lft1-inN/A

          \[\leadsto 2 \cdot y + \color{blue}{\left(2 + 1\right) \cdot x} \]
        4. metadata-evalN/A

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

          \[\leadsto \color{blue}{3 \cdot x + 2 \cdot y} \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot 3} + 2 \cdot y \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, 2 \cdot y\right)} \]
        8. *-lowering-*.f6492.6

          \[\leadsto \mathsf{fma}\left(x, 3, \color{blue}{2 \cdot y}\right) \]
      7. Applied egg-rr92.6%

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

      if 1.05e10 < z

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{\left(x + 2 \cdot x\right) + z} \]
        3. distribute-rgt1-inN/A

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

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

          \[\leadsto \color{blue}{x \cdot 3} + z \]
        6. accelerator-lowering-fma.f6492.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
      5. Simplified92.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification93.0%

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

    Alternative 4: 85.5% accurate, 0.7× speedup?

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

      1. Initial program 100.0%

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

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

          \[\leadsto \color{blue}{\left(2 \cdot y + z\right)} + x \]
        2. accelerator-lowering-fma.f6495.2

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} + x \]
      5. Simplified95.2%

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

      if -4.79999999999999971e79 < z < 1.2e11

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{2 \cdot \left(x + y\right)} + x \]
        3. accelerator-lowering-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, x + y, x\right)} \]
        4. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(2, \color{blue}{y + x}, x\right) \]
        5. +-lowering-+.f6492.6

          \[\leadsto \mathsf{fma}\left(2, \color{blue}{y + x}, x\right) \]
      5. Simplified92.6%

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

      if 1.2e11 < z

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{\left(x + 2 \cdot x\right) + z} \]
        3. distribute-rgt1-inN/A

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

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

          \[\leadsto \color{blue}{x \cdot 3} + z \]
        6. accelerator-lowering-fma.f6492.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
      5. Simplified92.6%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification93.0%

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

    Alternative 5: 86.5% accurate, 0.7× speedup?

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

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{\left(x + 2 \cdot x\right) + z} \]
        3. distribute-rgt1-inN/A

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

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

          \[\leadsto \color{blue}{x \cdot 3} + z \]
        6. accelerator-lowering-fma.f6490.6

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
      5. Simplified90.6%

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

      if -2.50000000000000005e63 < x < 7.5e20

      1. Initial program 100.0%

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

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

          \[\leadsto \color{blue}{\left(2 \cdot y + z\right)} + x \]
        2. accelerator-lowering-fma.f6492.1

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} + x \]
      5. Simplified92.1%

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

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

    Alternative 6: 85.9% accurate, 0.8× speedup?

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

      1. Initial program 99.9%

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

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

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

          \[\leadsto \color{blue}{\left(x + 2 \cdot x\right) + z} \]
        3. distribute-rgt1-inN/A

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

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

          \[\leadsto \color{blue}{x \cdot 3} + z \]
        6. accelerator-lowering-fma.f6489.4

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, 3, z\right)} \]
      5. Simplified89.4%

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

      if -2.29999999999999994e40 < x < 2.6e20

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{z + 2 \cdot y} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{2 \cdot y + z} \]
        2. accelerator-lowering-fma.f6491.9

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} \]
      5. Simplified91.9%

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

    Alternative 7: 78.9% accurate, 0.8× speedup?

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

      1. Initial program 99.9%

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

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

          \[\leadsto \color{blue}{x \cdot 3} \]
        2. *-lowering-*.f6482.0

          \[\leadsto \color{blue}{x \cdot 3} \]
      5. Simplified82.0%

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

      if -3.44999999999999987e71 < x < 1.25000000000000005e92

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{z + 2 \cdot y} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{2 \cdot y + z} \]
        2. accelerator-lowering-fma.f6487.7

          \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} \]
      5. Simplified87.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(2, y, z\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification85.8%

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

    Alternative 8: 53.4% accurate, 0.9× speedup?

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

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{z} + x \]
      4. Step-by-step derivation
        1. Simplified70.8%

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

        if -1.3999999999999999e100 < z < 3.8000000000000001e31

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{2 \cdot y} \]
        4. Step-by-step derivation
          1. *-lowering-*.f6446.9

            \[\leadsto \color{blue}{2 \cdot y} \]
        5. Simplified46.9%

          \[\leadsto \color{blue}{2 \cdot y} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification55.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+100}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+31}:\\ \;\;\;\;2 \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
      7. Add Preprocessing

      Alternative 9: 99.9% accurate, 1.2× speedup?

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

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

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

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

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

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

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

          \[\leadsto z + \left(\color{blue}{2 \cdot \left(x + y\right)} + x\right) \]
        7. accelerator-lowering-fma.f64N/A

          \[\leadsto z + \color{blue}{\mathsf{fma}\left(2, x + y, x\right)} \]
        8. +-lowering-+.f6499.9

          \[\leadsto z + \mathsf{fma}\left(2, \color{blue}{x + y}, x\right) \]
      4. Applied egg-rr99.9%

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

      Alternative 10: 39.8% accurate, 4.0× speedup?

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

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

        \[\leadsto \color{blue}{z} + x \]
      4. Step-by-step derivation
        1. Simplified37.3%

          \[\leadsto \color{blue}{z} + x \]
        2. Final simplification37.3%

          \[\leadsto x + z \]
        3. Add Preprocessing

        Alternative 11: 34.7% accurate, 16.0× speedup?

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

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

          \[\leadsto \color{blue}{z} \]
        4. Step-by-step derivation
          1. Simplified32.0%

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

          Alternative 12: 7.9% accurate, 16.0× speedup?

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

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

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

              \[\leadsto \color{blue}{2 \cdot y} + x \]
          5. Simplified40.4%

            \[\leadsto \color{blue}{2 \cdot y} + x \]
          6. Taylor expanded in y around 0

            \[\leadsto \color{blue}{x} \]
          7. Step-by-step derivation
            1. Simplified8.2%

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

            Reproduce

            ?
            herbie shell --seed 2024204 
            (FPCore (x y z)
              :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
              :precision binary64
              (+ (+ (+ (+ (+ x y) y) x) z) x))