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

Percentage Accurate: 99.9% → 100.0%
Time: 7.8s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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, 0.1× speedup?

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

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

    \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
  2. Step-by-step derivation
    1. associate-+l+N/A

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

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
    7. associate-+r+N/A

      \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
    8. associate-+r+N/A

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
    14. count-2N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
    17. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
    18. metadata-eval99.9%

      \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-+r+N/A

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

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

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

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

      \[\leadsto \mathsf{fma.f64}\left(x, 3, \mathsf{+.f64}\left(z, \left(y \cdot 2\right)\right)\right) \]
    6. *-lowering-*.f64100.0%

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

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

Alternative 2: 54.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.28 \cdot 10^{+107}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-46}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-222}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-250}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-104}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+90}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -1.28e+107)
   (* y 2.0)
   (if (<= y -1.9e-46)
     (+ x z)
     (if (<= y -2.7e-222)
       (* x 3.0)
       (if (<= y 3.2e-250)
         (+ x z)
         (if (<= y 7.2e-104)
           (* x 3.0)
           (if (<= y 6.4e+90) (+ x z) (* y 2.0))))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.28e+107) {
		tmp = y * 2.0;
	} else if (y <= -1.9e-46) {
		tmp = x + z;
	} else if (y <= -2.7e-222) {
		tmp = x * 3.0;
	} else if (y <= 3.2e-250) {
		tmp = x + z;
	} else if (y <= 7.2e-104) {
		tmp = x * 3.0;
	} else if (y <= 6.4e+90) {
		tmp = x + z;
	} else {
		tmp = y * 2.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) :: tmp
    if (y <= (-1.28d+107)) then
        tmp = y * 2.0d0
    else if (y <= (-1.9d-46)) then
        tmp = x + z
    else if (y <= (-2.7d-222)) then
        tmp = x * 3.0d0
    else if (y <= 3.2d-250) then
        tmp = x + z
    else if (y <= 7.2d-104) then
        tmp = x * 3.0d0
    else if (y <= 6.4d+90) then
        tmp = x + z
    else
        tmp = y * 2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.28e+107) {
		tmp = y * 2.0;
	} else if (y <= -1.9e-46) {
		tmp = x + z;
	} else if (y <= -2.7e-222) {
		tmp = x * 3.0;
	} else if (y <= 3.2e-250) {
		tmp = x + z;
	} else if (y <= 7.2e-104) {
		tmp = x * 3.0;
	} else if (y <= 6.4e+90) {
		tmp = x + z;
	} else {
		tmp = y * 2.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -1.28e+107:
		tmp = y * 2.0
	elif y <= -1.9e-46:
		tmp = x + z
	elif y <= -2.7e-222:
		tmp = x * 3.0
	elif y <= 3.2e-250:
		tmp = x + z
	elif y <= 7.2e-104:
		tmp = x * 3.0
	elif y <= 6.4e+90:
		tmp = x + z
	else:
		tmp = y * 2.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -1.28e+107)
		tmp = Float64(y * 2.0);
	elseif (y <= -1.9e-46)
		tmp = Float64(x + z);
	elseif (y <= -2.7e-222)
		tmp = Float64(x * 3.0);
	elseif (y <= 3.2e-250)
		tmp = Float64(x + z);
	elseif (y <= 7.2e-104)
		tmp = Float64(x * 3.0);
	elseif (y <= 6.4e+90)
		tmp = Float64(x + z);
	else
		tmp = Float64(y * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -1.28e+107)
		tmp = y * 2.0;
	elseif (y <= -1.9e-46)
		tmp = x + z;
	elseif (y <= -2.7e-222)
		tmp = x * 3.0;
	elseif (y <= 3.2e-250)
		tmp = x + z;
	elseif (y <= 7.2e-104)
		tmp = x * 3.0;
	elseif (y <= 6.4e+90)
		tmp = x + z;
	else
		tmp = y * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -1.28e+107], N[(y * 2.0), $MachinePrecision], If[LessEqual[y, -1.9e-46], N[(x + z), $MachinePrecision], If[LessEqual[y, -2.7e-222], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 3.2e-250], N[(x + z), $MachinePrecision], If[LessEqual[y, 7.2e-104], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 6.4e+90], N[(x + z), $MachinePrecision], N[(y * 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.28 \cdot 10^{+107}:\\
\;\;\;\;y \cdot 2\\

\mathbf{elif}\;y \leq -1.9 \cdot 10^{-46}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;y \leq -2.7 \cdot 10^{-222}:\\
\;\;\;\;x \cdot 3\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-250}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-104}:\\
\;\;\;\;x \cdot 3\\

\mathbf{elif}\;y \leq 6.4 \cdot 10^{+90}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.2799999999999999e107 or 6.39999999999999997e90 < y

    1. Initial program 99.9%

      \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
    2. Step-by-step derivation
      1. associate-+l+N/A

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
      8. associate-+r+N/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
      14. count-2N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
      18. metadata-eval99.9%

        \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf

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

        \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{y}\right) \]
    7. Simplified72.9%

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

    if -1.2799999999999999e107 < y < -1.8999999999999998e-46 or -2.7e-222 < y < 3.20000000000000005e-250 or 7.1999999999999996e-104 < y < 6.39999999999999997e90

    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 \mathsf{+.f64}\left(\color{blue}{z}, x\right) \]
    4. Step-by-step derivation
      1. Simplified60.6%

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

      if -1.8999999999999998e-46 < y < -2.7e-222 or 3.20000000000000005e-250 < y < 7.1999999999999996e-104

      1. Initial program 99.8%

        \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
        8. associate-+r+N/A

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        14. count-2N/A

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        18. metadata-eval99.8%

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
      3. Simplified99.8%

        \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in x around inf

        \[\leadsto \color{blue}{3 \cdot x} \]
      6. Step-by-step derivation
        1. *-lowering-*.f6465.6%

          \[\leadsto \mathsf{*.f64}\left(3, \color{blue}{x}\right) \]
      7. Simplified65.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.28 \cdot 10^{+107}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-46}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-222}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-250}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-104}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 6.4 \cdot 10^{+90}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 52.0% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+107}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-46}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-230}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-245}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-103}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+90}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y -9.8e+107)
       (* y 2.0)
       (if (<= y -2.1e-46)
         z
         (if (<= y -6.8e-230)
           (* x 3.0)
           (if (<= y 7.8e-245)
             z
             (if (<= y 3.3e-103) (* x 3.0) (if (<= y 1.6e+90) z (* y 2.0))))))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= -9.8e+107) {
    		tmp = y * 2.0;
    	} else if (y <= -2.1e-46) {
    		tmp = z;
    	} else if (y <= -6.8e-230) {
    		tmp = x * 3.0;
    	} else if (y <= 7.8e-245) {
    		tmp = z;
    	} else if (y <= 3.3e-103) {
    		tmp = x * 3.0;
    	} else if (y <= 1.6e+90) {
    		tmp = z;
    	} else {
    		tmp = y * 2.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) :: tmp
        if (y <= (-9.8d+107)) then
            tmp = y * 2.0d0
        else if (y <= (-2.1d-46)) then
            tmp = z
        else if (y <= (-6.8d-230)) then
            tmp = x * 3.0d0
        else if (y <= 7.8d-245) then
            tmp = z
        else if (y <= 3.3d-103) then
            tmp = x * 3.0d0
        else if (y <= 1.6d+90) then
            tmp = z
        else
            tmp = y * 2.0d0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= -9.8e+107) {
    		tmp = y * 2.0;
    	} else if (y <= -2.1e-46) {
    		tmp = z;
    	} else if (y <= -6.8e-230) {
    		tmp = x * 3.0;
    	} else if (y <= 7.8e-245) {
    		tmp = z;
    	} else if (y <= 3.3e-103) {
    		tmp = x * 3.0;
    	} else if (y <= 1.6e+90) {
    		tmp = z;
    	} else {
    		tmp = y * 2.0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= -9.8e+107:
    		tmp = y * 2.0
    	elif y <= -2.1e-46:
    		tmp = z
    	elif y <= -6.8e-230:
    		tmp = x * 3.0
    	elif y <= 7.8e-245:
    		tmp = z
    	elif y <= 3.3e-103:
    		tmp = x * 3.0
    	elif y <= 1.6e+90:
    		tmp = z
    	else:
    		tmp = y * 2.0
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= -9.8e+107)
    		tmp = Float64(y * 2.0);
    	elseif (y <= -2.1e-46)
    		tmp = z;
    	elseif (y <= -6.8e-230)
    		tmp = Float64(x * 3.0);
    	elseif (y <= 7.8e-245)
    		tmp = z;
    	elseif (y <= 3.3e-103)
    		tmp = Float64(x * 3.0);
    	elseif (y <= 1.6e+90)
    		tmp = z;
    	else
    		tmp = Float64(y * 2.0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= -9.8e+107)
    		tmp = y * 2.0;
    	elseif (y <= -2.1e-46)
    		tmp = z;
    	elseif (y <= -6.8e-230)
    		tmp = x * 3.0;
    	elseif (y <= 7.8e-245)
    		tmp = z;
    	elseif (y <= 3.3e-103)
    		tmp = x * 3.0;
    	elseif (y <= 1.6e+90)
    		tmp = z;
    	else
    		tmp = y * 2.0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, -9.8e+107], N[(y * 2.0), $MachinePrecision], If[LessEqual[y, -2.1e-46], z, If[LessEqual[y, -6.8e-230], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 7.8e-245], z, If[LessEqual[y, 3.3e-103], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 1.6e+90], z, N[(y * 2.0), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -9.8 \cdot 10^{+107}:\\
    \;\;\;\;y \cdot 2\\
    
    \mathbf{elif}\;y \leq -2.1 \cdot 10^{-46}:\\
    \;\;\;\;z\\
    
    \mathbf{elif}\;y \leq -6.8 \cdot 10^{-230}:\\
    \;\;\;\;x \cdot 3\\
    
    \mathbf{elif}\;y \leq 7.8 \cdot 10^{-245}:\\
    \;\;\;\;z\\
    
    \mathbf{elif}\;y \leq 3.3 \cdot 10^{-103}:\\
    \;\;\;\;x \cdot 3\\
    
    \mathbf{elif}\;y \leq 1.6 \cdot 10^{+90}:\\
    \;\;\;\;z\\
    
    \mathbf{else}:\\
    \;\;\;\;y \cdot 2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -9.8000000000000003e107 or 1.59999999999999999e90 < y

      1. Initial program 99.9%

        \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
        8. associate-+r+N/A

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        14. count-2N/A

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        18. metadata-eval99.9%

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
      3. Simplified99.9%

        \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf

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

          \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{y}\right) \]
      7. Simplified72.9%

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

      if -9.8000000000000003e107 < y < -2.09999999999999987e-46 or -6.8e-230 < y < 7.7999999999999998e-245 or 3.2999999999999999e-103 < y < 1.59999999999999999e90

      1. Initial program 100.0%

        \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
      2. Step-by-step derivation
        1. associate-+l+N/A

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
        8. associate-+r+N/A

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        13. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
        14. count-2N/A

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

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

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        17. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
        18. metadata-eval100.0%

          \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
      3. Simplified100.0%

        \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in z around inf

        \[\leadsto \color{blue}{z} \]
      6. Step-by-step derivation
        1. Simplified56.6%

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

        if -2.09999999999999987e-46 < y < -6.8e-230 or 7.7999999999999998e-245 < y < 3.2999999999999999e-103

        1. Initial program 99.8%

          \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
          8. associate-+r+N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          14. count-2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          18. metadata-eval99.8%

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{3 \cdot x} \]
        6. Step-by-step derivation
          1. *-lowering-*.f6465.6%

            \[\leadsto \mathsf{*.f64}\left(3, \color{blue}{x}\right) \]
        7. Simplified65.6%

          \[\leadsto \color{blue}{3 \cdot x} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification64.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.8 \cdot 10^{+107}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -2.1 \cdot 10^{-46}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-230}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-245}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-103}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+90}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 84.7% accurate, 0.7× speedup?

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

        1. Initial program 99.8%

          \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
          8. associate-+r+N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          14. count-2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          18. metadata-eval99.8%

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in y around 0

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

            \[\leadsto 3 \cdot x + \color{blue}{z} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\left(3 \cdot x\right), \color{blue}{z}\right) \]
          3. *-lowering-*.f6483.6%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(3, x\right), z\right) \]
        7. Simplified83.6%

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

        if -1.19999999999999999e27 < x < 2.15000000000000007e-10

        1. Initial program 100.0%

          \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
          8. associate-+r+N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          14. count-2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          18. metadata-eval100.0%

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

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

            \[\leadsto 2 \cdot y + \color{blue}{z} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\left(2 \cdot y\right), \color{blue}{z}\right) \]
          3. *-lowering-*.f6494.1%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, y\right), z\right) \]
        7. Simplified94.1%

          \[\leadsto \color{blue}{2 \cdot y + z} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification89.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+27}:\\ \;\;\;\;z + x \cdot 3\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-10}:\\ \;\;\;\;z + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot 3\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 77.6% accurate, 0.7× speedup?

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

        1. Initial program 99.8%

          \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
          8. associate-+r+N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          14. count-2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          18. metadata-eval99.8%

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
        3. Simplified99.8%

          \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in x around inf

          \[\leadsto \color{blue}{3 \cdot x} \]
        6. Step-by-step derivation
          1. *-lowering-*.f6471.2%

            \[\leadsto \mathsf{*.f64}\left(3, \color{blue}{x}\right) \]
        7. Simplified71.2%

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

        if -2.29999999999999984e28 < x < 1.45000000000000005e156

        1. Initial program 99.9%

          \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
        2. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
          8. associate-+r+N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
          14. count-2N/A

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

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

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          17. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
          18. metadata-eval100.0%

            \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
        4. Add Preprocessing
        5. Taylor expanded in x around 0

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

            \[\leadsto 2 \cdot y + \color{blue}{z} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\left(2 \cdot y\right), \color{blue}{z}\right) \]
          3. *-lowering-*.f6488.7%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, y\right), z\right) \]
        7. Simplified88.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+28}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+156}:\\ \;\;\;\;z + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;x \cdot 3\\ \end{array} \]
      5. Add Preprocessing

      Alternative 6: 58.3% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+80}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 8.1 \cdot 10^{+93}:\\ \;\;\;\;x + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= z -1.16e+80) (+ x z) (if (<= z 8.1e+93) (+ x (* y 2.0)) (+ x z))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (z <= -1.16e+80) {
      		tmp = x + z;
      	} else if (z <= 8.1e+93) {
      		tmp = x + (y * 2.0);
      	} 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.16d+80)) then
              tmp = x + z
          else if (z <= 8.1d+93) then
              tmp = x + (y * 2.0d0)
          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.16e+80) {
      		tmp = x + z;
      	} else if (z <= 8.1e+93) {
      		tmp = x + (y * 2.0);
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if z <= -1.16e+80:
      		tmp = x + z
      	elif z <= 8.1e+93:
      		tmp = x + (y * 2.0)
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (z <= -1.16e+80)
      		tmp = Float64(x + z);
      	elseif (z <= 8.1e+93)
      		tmp = Float64(x + Float64(y * 2.0));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (z <= -1.16e+80)
      		tmp = x + z;
      	elseif (z <= 8.1e+93)
      		tmp = x + (y * 2.0);
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[z, -1.16e+80], N[(x + z), $MachinePrecision], If[LessEqual[z, 8.1e+93], N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1.16 \cdot 10^{+80}:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;z \leq 8.1 \cdot 10^{+93}:\\
      \;\;\;\;x + y \cdot 2\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.15999999999999997e80 or 8.09999999999999983e93 < 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 z around inf

          \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, x\right) \]
        4. Step-by-step derivation
          1. Simplified72.8%

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

          if -1.15999999999999997e80 < z < 8.09999999999999983e93

          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 \mathsf{+.f64}\left(\color{blue}{\left(2 \cdot y\right)}, x\right) \]
          4. Step-by-step derivation
            1. *-lowering-*.f6454.6%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(2, y\right), x\right) \]
          5. Simplified54.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+80}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 8.1 \cdot 10^{+93}:\\ \;\;\;\;x + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
        7. Add Preprocessing

        Alternative 7: 53.6% accurate, 0.8× speedup?

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

          1. Initial program 99.9%

            \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
          2. Step-by-step derivation
            1. associate-+l+N/A

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
            7. associate-+r+N/A

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
            8. associate-+r+N/A

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            14. count-2N/A

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            18. metadata-eval100.0%

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
          3. Simplified100.0%

            \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in z around inf

            \[\leadsto \color{blue}{z} \]
          6. Step-by-step derivation
            1. Simplified69.9%

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

            if -3.30000000000000016e70 < z < 7.5999999999999996e93

            1. Initial program 99.9%

              \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
            2. Step-by-step derivation
              1. associate-+l+N/A

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
              7. associate-+r+N/A

                \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
              8. associate-+r+N/A

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
              13. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
              14. count-2N/A

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

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

                \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
              17. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
              18. metadata-eval99.9%

                \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
            3. Simplified99.9%

              \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
            4. Add Preprocessing
            5. Taylor expanded in y around inf

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

                \[\leadsto \mathsf{*.f64}\left(2, \color{blue}{y}\right) \]
            7. Simplified48.6%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+70}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{+93}:\\ \;\;\;\;y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \]
          9. Add Preprocessing

          Alternative 8: 99.9% accurate, 1.2× speedup?

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

            \[\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x \]
          2. Step-by-step derivation
            1. associate-+l+N/A

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
            7. associate-+r+N/A

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
            8. associate-+r+N/A

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            14. count-2N/A

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            18. metadata-eval99.9%

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
          3. Simplified99.9%

            \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
          4. Add Preprocessing
          5. Final simplification99.9%

            \[\leadsto z + \left(x \cdot 3 + y \cdot 2\right) \]
          6. Add Preprocessing

          Alternative 9: 34.4% accurate, 11.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. Step-by-step derivation
            1. associate-+l+N/A

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(x + \left(x + \color{blue}{\left(y + y\right)}\right)\right)\right)\right) \]
            7. associate-+r+N/A

              \[\leadsto \mathsf{+.f64}\left(z, \left(x + \left(\left(x + x\right) + \color{blue}{\left(y + y\right)}\right)\right)\right) \]
            8. associate-+r+N/A

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\left(y \cdot 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            13. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(\color{blue}{x} + \left(x + x\right)\right)\right)\right) \]
            14. count-2N/A

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

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

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \left(x \cdot \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            17. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, \color{blue}{\left(2 + 1\right)}\right)\right)\right) \]
            18. metadata-eval99.9%

              \[\leadsto \mathsf{+.f64}\left(z, \mathsf{+.f64}\left(\mathsf{*.f64}\left(y, 2\right), \mathsf{*.f64}\left(x, 3\right)\right)\right) \]
          3. Simplified99.9%

            \[\leadsto \color{blue}{z + \left(y \cdot 2 + x \cdot 3\right)} \]
          4. Add Preprocessing
          5. Taylor expanded in z around inf

            \[\leadsto \color{blue}{z} \]
          6. Step-by-step derivation
            1. Simplified34.1%

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

            Alternative 10: 7.8% accurate, 11.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 z around inf

              \[\leadsto \mathsf{+.f64}\left(\color{blue}{z}, x\right) \]
            4. Step-by-step derivation
              1. Simplified39.1%

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

                \[\leadsto \color{blue}{x} \]
              3. Step-by-step derivation
                1. Simplified7.8%

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

                Reproduce

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