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

Percentage Accurate: 99.9% → 100.0%
Time: 8.6s
Alternatives: 11
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 11 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: 51.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+94}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-134}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-165}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -4.2e+94)
   (* y 2.0)
   (if (<= y -1.15e-134)
     z
     (if (<= y 5.5e-165) (* x 3.0) (if (<= y 3.7e-37) z (* y 2.0))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.2e+94) {
		tmp = y * 2.0;
	} else if (y <= -1.15e-134) {
		tmp = z;
	} else if (y <= 5.5e-165) {
		tmp = x * 3.0;
	} else if (y <= 3.7e-37) {
		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 <= (-4.2d+94)) then
        tmp = y * 2.0d0
    else if (y <= (-1.15d-134)) then
        tmp = z
    else if (y <= 5.5d-165) then
        tmp = x * 3.0d0
    else if (y <= 3.7d-37) 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 <= -4.2e+94) {
		tmp = y * 2.0;
	} else if (y <= -1.15e-134) {
		tmp = z;
	} else if (y <= 5.5e-165) {
		tmp = x * 3.0;
	} else if (y <= 3.7e-37) {
		tmp = z;
	} else {
		tmp = y * 2.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -4.2e+94:
		tmp = y * 2.0
	elif y <= -1.15e-134:
		tmp = z
	elif y <= 5.5e-165:
		tmp = x * 3.0
	elif y <= 3.7e-37:
		tmp = z
	else:
		tmp = y * 2.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -4.2e+94)
		tmp = Float64(y * 2.0);
	elseif (y <= -1.15e-134)
		tmp = z;
	elseif (y <= 5.5e-165)
		tmp = Float64(x * 3.0);
	elseif (y <= 3.7e-37)
		tmp = z;
	else
		tmp = Float64(y * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -4.2e+94)
		tmp = y * 2.0;
	elseif (y <= -1.15e-134)
		tmp = z;
	elseif (y <= 5.5e-165)
		tmp = x * 3.0;
	elseif (y <= 3.7e-37)
		tmp = z;
	else
		tmp = y * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+94], N[(y * 2.0), $MachinePrecision], If[LessEqual[y, -1.15e-134], z, If[LessEqual[y, 5.5e-165], N[(x * 3.0), $MachinePrecision], If[LessEqual[y, 3.7e-37], z, N[(y * 2.0), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.15 \cdot 10^{-134}:\\
\;\;\;\;z\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-165}:\\
\;\;\;\;x \cdot 3\\

\mathbf{elif}\;y \leq 3.7 \cdot 10^{-37}:\\
\;\;\;\;z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.19999999999999979e94 or 3.7e-37 < 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-*.f6470.7%

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

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

    if -4.19999999999999979e94 < y < -1.15e-134 or 5.49999999999999969e-165 < y < 3.7e-37

    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. Simplified60.6%

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

      if -1.15e-134 < y < 5.49999999999999969e-165

      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-*.f6458.1%

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

        \[\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 -4.2 \cdot 10^{+94}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-134}:\\ \;\;\;\;z\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-165}:\\ \;\;\;\;x \cdot 3\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{-37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 84.9% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot 2 + x \cdot 3\\ \mathbf{if}\;x \leq -9.8 \cdot 10^{+109}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+31}:\\ \;\;\;\;z + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (+ (* y 2.0) (* x 3.0))))
       (if (<= x -9.8e+109) t_0 (if (<= x 1.45e+31) (+ z (* y 2.0)) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = (y * 2.0) + (x * 3.0);
    	double tmp;
    	if (x <= -9.8e+109) {
    		tmp = t_0;
    	} else if (x <= 1.45e+31) {
    		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 = (y * 2.0d0) + (x * 3.0d0)
        if (x <= (-9.8d+109)) then
            tmp = t_0
        else if (x <= 1.45d+31) 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 = (y * 2.0) + (x * 3.0);
    	double tmp;
    	if (x <= -9.8e+109) {
    		tmp = t_0;
    	} else if (x <= 1.45e+31) {
    		tmp = z + (y * 2.0);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = (y * 2.0) + (x * 3.0)
    	tmp = 0
    	if x <= -9.8e+109:
    		tmp = t_0
    	elif x <= 1.45e+31:
    		tmp = z + (y * 2.0)
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(Float64(y * 2.0) + Float64(x * 3.0))
    	tmp = 0.0
    	if (x <= -9.8e+109)
    		tmp = t_0;
    	elseif (x <= 1.45e+31)
    		tmp = Float64(z + Float64(y * 2.0));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = (y * 2.0) + (x * 3.0);
    	tmp = 0.0;
    	if (x <= -9.8e+109)
    		tmp = t_0;
    	elseif (x <= 1.45e+31)
    		tmp = z + (y * 2.0);
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y * 2.0), $MachinePrecision] + N[(x * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.8e+109], t$95$0, If[LessEqual[x, 1.45e+31], N[(z + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := y \cdot 2 + x \cdot 3\\
    \mathbf{if}\;x \leq -9.8 \cdot 10^{+109}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 1.45 \cdot 10^{+31}:\\
    \;\;\;\;z + y \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -9.8000000000000007e109 or 1.45e31 < x

      1. Initial program 99.7%

        \[\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.7%

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

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

        \[\leadsto \color{blue}{2 \cdot y + 3 \cdot x} \]
      6. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

      if -9.8000000000000007e109 < x < 1.45e31

      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-*.f6492.0%

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

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

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

    Alternative 4: 85.2% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := z + x \cdot 3\\ \mathbf{if}\;x \leq -3.9 \cdot 10^{+91}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+21}:\\ \;\;\;\;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 -3.9e+91) t_0 (if (<= x 9e+21) (+ 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 <= -3.9e+91) {
    		tmp = t_0;
    	} else if (x <= 9e+21) {
    		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 <= (-3.9d+91)) then
            tmp = t_0
        else if (x <= 9d+21) 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 <= -3.9e+91) {
    		tmp = t_0;
    	} else if (x <= 9e+21) {
    		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 <= -3.9e+91:
    		tmp = t_0
    	elif x <= 9e+21:
    		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 <= -3.9e+91)
    		tmp = t_0;
    	elseif (x <= 9e+21)
    		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 <= -3.9e+91)
    		tmp = t_0;
    	elseif (x <= 9e+21)
    		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, -3.9e+91], t$95$0, If[LessEqual[x, 9e+21], 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 -3.9 \cdot 10^{+91}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 9 \cdot 10^{+21}:\\
    \;\;\;\;z + y \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -3.89999999999999968e91 or 9e21 < x

      1. Initial program 99.7%

        \[\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-*.f6482.6%

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

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

      if -3.89999999999999968e91 < x < 9e21

      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-*.f6492.9%

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

        \[\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 -3.9 \cdot 10^{+91}:\\ \;\;\;\;z + x \cdot 3\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+21}:\\ \;\;\;\;z + y \cdot 2\\ \mathbf{else}:\\ \;\;\;\;z + x \cdot 3\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 78.2% accurate, 0.7× speedup?

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

      1. Initial program 99.7%

        \[\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-*.f6477.5%

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

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

      if -6.1999999999999995e132 < x < 1.6e31

      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 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-*.f6491.1%

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

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

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

    Alternative 6: 57.0% accurate, 0.7× speedup?

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

      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-*.f6475.0%

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

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

      if -4.80000000000000023e100 < y < 1.0000000000000001e-18

      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 z around inf

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

          \[\leadsto \color{blue}{z} + x \]
      5. Recombined 2 regimes into one program.
      6. Final simplification64.5%

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

      Alternative 7: 55.7% accurate, 0.8× speedup?

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

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

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

        if -4.1999999999999997e100 < y < 2.35000000000000007e-20

        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 z around inf

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

            \[\leadsto \color{blue}{z} + x \]
        5. Recombined 2 regimes into one program.
        6. Final simplification63.5%

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

        Alternative 8: 52.0% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+94}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -2.5e+94) (* y 2.0) (if (<= y 4.2e-37) z (* y 2.0))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -2.5e+94) {
        		tmp = y * 2.0;
        	} else if (y <= 4.2e-37) {
        		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 <= (-2.5d+94)) then
                tmp = y * 2.0d0
            else if (y <= 4.2d-37) 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 <= -2.5e+94) {
        		tmp = y * 2.0;
        	} else if (y <= 4.2e-37) {
        		tmp = z;
        	} else {
        		tmp = y * 2.0;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if y <= -2.5e+94:
        		tmp = y * 2.0
        	elif y <= 4.2e-37:
        		tmp = z
        	else:
        		tmp = y * 2.0
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -2.5e+94)
        		tmp = Float64(y * 2.0);
        	elseif (y <= 4.2e-37)
        		tmp = z;
        	else
        		tmp = Float64(y * 2.0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (y <= -2.5e+94)
        		tmp = y * 2.0;
        	elseif (y <= 4.2e-37)
        		tmp = z;
        	else
        		tmp = y * 2.0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -2.5e+94], N[(y * 2.0), $MachinePrecision], If[LessEqual[y, 4.2e-37], z, N[(y * 2.0), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -2.5 \cdot 10^{+94}:\\
        \;\;\;\;y \cdot 2\\
        
        \mathbf{elif}\;y \leq 4.2 \cdot 10^{-37}:\\
        \;\;\;\;z\\
        
        \mathbf{else}:\\
        \;\;\;\;y \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -2.50000000000000005e94 or 4.2000000000000002e-37 < 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-*.f6470.7%

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

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

          if -2.50000000000000005e94 < y < 4.2000000000000002e-37

          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 z around inf

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

              \[\leadsto \color{blue}{z} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification60.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \cdot 10^{+94}:\\ \;\;\;\;y \cdot 2\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-37}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;y \cdot 2\\ \end{array} \]
          9. Add Preprocessing

          Alternative 9: 99.9% accurate, 1.2× speedup?

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

          Alternative 10: 34.8% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 3.5 \cdot 10^{+122}:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z) :precision binary64 (if (<= x 3.5e+122) z x))
          double code(double x, double y, double z) {
          	double tmp;
          	if (x <= 3.5e+122) {
          		tmp = z;
          	} else {
          		tmp = 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 <= 3.5d+122) then
                  tmp = z
              else
                  tmp = x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (x <= 3.5e+122) {
          		tmp = z;
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if x <= 3.5e+122:
          		tmp = z
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (x <= 3.5e+122)
          		tmp = z;
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (x <= 3.5e+122)
          		tmp = z;
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[x, 3.5e+122], z, x]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq 3.5 \cdot 10^{+122}:\\
          \;\;\;\;z\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 3.50000000000000014e122

            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. Simplified38.7%

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

              if 3.50000000000000014e122 < x

              1. Initial program 99.7%

                \[\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. Simplified16.2%

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

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

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

                Alternative 11: 7.9% 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. Simplified38.4%

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

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

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

                    Reproduce

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