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

Percentage Accurate: 99.9% → 99.3%
Time: 9.4s
Alternatives: 11
Speedup: 1.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

Alternative 1: 99.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -125000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.5:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
   (if (<= x -125000.0)
     t_1
     (if (<= x 2.5) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * fma(2.0, (y + z), t);
	double tmp;
	if (x <= -125000.0) {
		tmp = t_1;
	} else if (x <= 2.5) {
		tmp = fma(y, 5.0, (x * (t + (z + z))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
	tmp = 0.0
	if (x <= -125000.0)
		tmp = t_1;
	elseif (x <= 2.5)
		tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -125000.0], t$95$1, If[LessEqual[x, 2.5], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -125000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.5:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -125000 or 2.5 < x

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

    if -125000 < x < 2.5

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t\right)\right) \]
      12. flip-+N/A

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(z + z\right)} + t\right)\right) \]
      13. +-lowering-+.f6499.4

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

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

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

Alternative 2: 66.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{if}\;x \leq -2.9 \cdot 10^{+227}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -5.7 \cdot 10^{+125}:\\ \;\;\;\;x \cdot \left(t + \left(y + y\right)\right)\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-82}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z (+ z t)))))
   (if (<= x -2.9e+227)
     t_1
     (if (<= x -5.7e+125)
       (* x (+ t (+ y y)))
       (if (<= x -1.02e-82) t_1 (if (<= x 3.4e-54) (* y 5.0) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + (z + t));
	double tmp;
	if (x <= -2.9e+227) {
		tmp = t_1;
	} else if (x <= -5.7e+125) {
		tmp = x * (t + (y + y));
	} else if (x <= -1.02e-82) {
		tmp = t_1;
	} else if (x <= 3.4e-54) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (z + (z + t))
    if (x <= (-2.9d+227)) then
        tmp = t_1
    else if (x <= (-5.7d+125)) then
        tmp = x * (t + (y + y))
    else if (x <= (-1.02d-82)) then
        tmp = t_1
    else if (x <= 3.4d-54) then
        tmp = y * 5.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (z + (z + t));
	double tmp;
	if (x <= -2.9e+227) {
		tmp = t_1;
	} else if (x <= -5.7e+125) {
		tmp = x * (t + (y + y));
	} else if (x <= -1.02e-82) {
		tmp = t_1;
	} else if (x <= 3.4e-54) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + (z + t))
	tmp = 0
	if x <= -2.9e+227:
		tmp = t_1
	elif x <= -5.7e+125:
		tmp = x * (t + (y + y))
	elif x <= -1.02e-82:
		tmp = t_1
	elif x <= 3.4e-54:
		tmp = y * 5.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + Float64(z + t)))
	tmp = 0.0
	if (x <= -2.9e+227)
		tmp = t_1;
	elseif (x <= -5.7e+125)
		tmp = Float64(x * Float64(t + Float64(y + y)));
	elseif (x <= -1.02e-82)
		tmp = t_1;
	elseif (x <= 3.4e-54)
		tmp = Float64(y * 5.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + (z + t));
	tmp = 0.0;
	if (x <= -2.9e+227)
		tmp = t_1;
	elseif (x <= -5.7e+125)
		tmp = x * (t + (y + y));
	elseif (x <= -1.02e-82)
		tmp = t_1;
	elseif (x <= 3.4e-54)
		tmp = y * 5.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+227], t$95$1, If[LessEqual[x, -5.7e+125], N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.02e-82], t$95$1, If[LessEqual[x, 3.4e-54], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(z + \left(z + t\right)\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+227}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -5.7 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \left(t + \left(y + y\right)\right)\\

\mathbf{elif}\;x \leq -1.02 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{-54}:\\
\;\;\;\;y \cdot 5\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.8999999999999998e227 or -5.6999999999999996e125 < x < -1.02000000000000007e-82 or 3.39999999999999987e-54 < x

    1. Initial program 100.0%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
      3. accelerator-lowering-fma.f6478.5

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
    5. Simplified78.5%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(t + z\right) + z\right)} \]
      5. +-lowering-+.f6478.5

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

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

    if -2.8999999999999998e227 < x < -5.6999999999999996e125

    1. Initial program 95.8%

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x, \color{blue}{\mathsf{fma}\left(y, 2, t\right)}, 5 \cdot y\right) \]
      6. *-lowering-*.f6483.1

        \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), \color{blue}{5 \cdot y}\right) \]
    5. Simplified83.1%

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

      \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot y\right)} \]
    7. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

        \[\leadsto x \cdot \left(t + \color{blue}{\left(y + y\right)}\right) \]
      4. +-lowering-+.f6487.3

        \[\leadsto x \cdot \left(t + \color{blue}{\left(y + y\right)}\right) \]
    8. Simplified87.3%

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

    if -1.02000000000000007e-82 < x < 3.39999999999999987e-54

    1. Initial program 99.9%

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

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+227}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;x \leq -5.7 \cdot 10^{+125}:\\ \;\;\;\;x \cdot \left(t + \left(y + y\right)\right)\\ \mathbf{elif}\;x \leq -1.02 \cdot 10^{-82}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-54}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 63.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + \left(y + y\right)\right)\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z + t\right)\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-11}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-49}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (+ y y)))))
   (if (<= x -7.5e+228)
     (* x (+ z t))
     (if (<= x -1.12e-11) t_1 (if (<= x 6e-49) (* y 5.0) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y + y));
	double tmp;
	if (x <= -7.5e+228) {
		tmp = x * (z + t);
	} else if (x <= -1.12e-11) {
		tmp = t_1;
	} else if (x <= 6e-49) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t + (y + y))
    if (x <= (-7.5d+228)) then
        tmp = x * (z + t)
    else if (x <= (-1.12d-11)) then
        tmp = t_1
    else if (x <= 6d-49) then
        tmp = y * 5.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y + y));
	double tmp;
	if (x <= -7.5e+228) {
		tmp = x * (z + t);
	} else if (x <= -1.12e-11) {
		tmp = t_1;
	} else if (x <= 6e-49) {
		tmp = y * 5.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y + y))
	tmp = 0
	if x <= -7.5e+228:
		tmp = x * (z + t)
	elif x <= -1.12e-11:
		tmp = t_1
	elif x <= 6e-49:
		tmp = y * 5.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y + y)))
	tmp = 0.0
	if (x <= -7.5e+228)
		tmp = Float64(x * Float64(z + t));
	elseif (x <= -1.12e-11)
		tmp = t_1;
	elseif (x <= 6e-49)
		tmp = Float64(y * 5.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y + y));
	tmp = 0.0;
	if (x <= -7.5e+228)
		tmp = x * (z + t);
	elseif (x <= -1.12e-11)
		tmp = t_1;
	elseif (x <= 6e-49)
		tmp = y * 5.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+228], N[(x * N[(z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.12e-11], t$95$1, If[LessEqual[x, 6e-49], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + y\right)\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+228}:\\
\;\;\;\;x \cdot \left(z + t\right)\\

\mathbf{elif}\;x \leq -1.12 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 6 \cdot 10^{-49}:\\
\;\;\;\;y \cdot 5\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
      3. accelerator-lowering-fma.f6489.9

        \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
    5. Simplified89.9%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(t + z\right) + z\right)} \]
      5. +-lowering-+.f6489.9

        \[\leadsto x \cdot \left(\color{blue}{\left(t + z\right)} + z\right) \]
    7. Applied egg-rr89.9%

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

      \[\leadsto x \cdot \left(\color{blue}{t} + z\right) \]
    9. Step-by-step derivation
      1. Simplified86.4%

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

      if -7.49999999999999994e228 < x < -1.1200000000000001e-11 or 6e-49 < x

      1. Initial program 99.1%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), \color{blue}{5 \cdot y}\right) \]
      5. Simplified67.5%

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

        \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot y\right)} \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

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

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

          \[\leadsto x \cdot \left(t + \color{blue}{\left(y + y\right)}\right) \]
        4. +-lowering-+.f6466.7

          \[\leadsto x \cdot \left(t + \color{blue}{\left(y + y\right)}\right) \]
      8. Simplified66.7%

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

      if -1.1200000000000001e-11 < x < 6e-49

      1. Initial program 99.9%

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

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

          \[\leadsto \color{blue}{5 \cdot y} \]
      5. Simplified60.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+228}:\\ \;\;\;\;x \cdot \left(z + t\right)\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-11}:\\ \;\;\;\;x \cdot \left(t + \left(y + y\right)\right)\\ \mathbf{elif}\;x \leq 6 \cdot 10^{-49}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + y\right)\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 4: 88.2% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -4.9 \cdot 10^{-55}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 20000000000000:\\ \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
       (if (<= x -4.9e-55)
         t_1
         (if (<= x 20000000000000.0) (fma x (fma y 2.0 t) (* y 5.0)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, (y + z), t);
    	double tmp;
    	if (x <= -4.9e-55) {
    		tmp = t_1;
    	} else if (x <= 20000000000000.0) {
    		tmp = fma(x, fma(y, 2.0, t), (y * 5.0));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
    	tmp = 0.0
    	if (x <= -4.9e-55)
    		tmp = t_1;
    	elseif (x <= 20000000000000.0)
    		tmp = fma(x, fma(y, 2.0, t), Float64(y * 5.0));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e-55], t$95$1, If[LessEqual[x, 20000000000000.0], N[(x * N[(y * 2.0 + t), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    \mathbf{if}\;x \leq -4.9 \cdot 10^{-55}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 20000000000000:\\
    \;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), y \cdot 5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -4.90000000000000035e-55 or 2e13 < x

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

      if -4.90000000000000035e-55 < x < 2e13

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 88.4% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -2 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.35 \cdot 10^{-21}:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
       (if (<= x -2e-53) t_1 (if (<= x 3.35e-21) (fma y 5.0 (* x t)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, (y + z), t);
    	double tmp;
    	if (x <= -2e-53) {
    		tmp = t_1;
    	} else if (x <= 3.35e-21) {
    		tmp = fma(y, 5.0, (x * t));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
    	tmp = 0.0
    	if (x <= -2e-53)
    		tmp = t_1;
    	elseif (x <= 3.35e-21)
    		tmp = fma(y, 5.0, Float64(x * t));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e-53], t$95$1, If[LessEqual[x, 3.35e-21], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    \mathbf{if}\;x \leq -2 \cdot 10^{-53}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq 3.35 \cdot 10^{-21}:\\
    \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.00000000000000006e-53 or 3.3499999999999999e-21 < x

      1. Initial program 99.3%

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

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

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

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

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

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, y + z, t\right)} \]
        5. +-lowering-+.f6497.0

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

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

      if -2.00000000000000006e-53 < x < 3.3499999999999999e-21

      1. Initial program 99.9%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(x, \mathsf{fma}\left(y, 2, t\right), \color{blue}{5 \cdot y}\right) \]
      5. Simplified83.8%

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{x \cdot \left(y \cdot 2 + t\right)}\right) \]
        5. accelerator-lowering-fma.f6483.8

          \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\mathsf{fma}\left(y, 2, t\right)}\right) \]
      7. Applied egg-rr83.8%

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

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

          \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{t}\right) \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 6: 99.9% accurate, 1.0× speedup?

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

        \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
      2. Add Preprocessing
      3. Final simplification99.5%

        \[\leadsto x \cdot \left(\left(y + \left(z + \left(y + z\right)\right)\right) + t\right) + y \cdot 5 \]
      4. Add Preprocessing

      Alternative 7: 78.8% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -390:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+36}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* y (fma x 2.0 5.0))))
         (if (<= y -390.0) t_1 (if (<= y 4.5e+36) (* x (fma 2.0 z t)) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = y * fma(x, 2.0, 5.0);
      	double tmp;
      	if (y <= -390.0) {
      		tmp = t_1;
      	} else if (y <= 4.5e+36) {
      		tmp = x * fma(2.0, z, t);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(y * fma(x, 2.0, 5.0))
      	tmp = 0.0
      	if (y <= -390.0)
      		tmp = t_1;
      	elseif (y <= 4.5e+36)
      		tmp = Float64(x * fma(2.0, z, t));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -390.0], t$95$1, If[LessEqual[y, 4.5e+36], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
      \mathbf{if}\;y \leq -390:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 4.5 \cdot 10^{+36}:\\
      \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -390 or 4.49999999999999997e36 < y

        1. Initial program 98.9%

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

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

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

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

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
          4. neg-sub0N/A

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

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          6. neg-sub0N/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
          7. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
          8. neg-sub0N/A

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          9. associate--r-N/A

            \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
          10. neg-sub0N/A

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

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
          12. metadata-evalN/A

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

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

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

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

        if -390 < y < 4.49999999999999997e36

        1. Initial program 100.0%

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

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

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

            \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
          3. accelerator-lowering-fma.f6482.9

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
        5. Simplified82.9%

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

      Alternative 8: 99.9% accurate, 1.1× speedup?

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y + \frac{\color{blue}{0}}{z - z}, x, \left(y + t\right) \cdot x\right) + y \cdot 5 \]
        7. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y + \frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)}, x, \left(y + t\right) \cdot x\right) + y \cdot 5 \]
        18. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(y + \frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, \left(y + t\right) \cdot x\right) + y \cdot 5 \]
        20. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(y + \frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, \left(y + t\right) \cdot x\right) + y \cdot 5 \]
        21. flip-+N/A

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(y + \left(z + z\right)\right) + \left(y + t\right), x, y \cdot 5\right)} \]
        4. count-2N/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(y + \mathsf{fma}\left(z, 2, \color{blue}{y + t}\right), x, y \cdot 5\right) \]
        10. *-lowering-*.f6499.5

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

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

      Alternative 9: 57.6% accurate, 1.2× speedup?

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

        1. Initial program 99.3%

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

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

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

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

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
        5. Simplified74.3%

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

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

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

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

            \[\leadsto x \cdot \color{blue}{\left(\left(t + z\right) + z\right)} \]
          5. +-lowering-+.f6474.3

            \[\leadsto x \cdot \left(\color{blue}{\left(t + z\right)} + z\right) \]
        7. Applied egg-rr74.3%

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

          \[\leadsto x \cdot \left(\color{blue}{t} + z\right) \]
        9. Step-by-step derivation
          1. Simplified60.6%

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

          if -1.8e-80 < x < 3.90000000000000021e-50

          1. Initial program 99.9%

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

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

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

            \[\leadsto \color{blue}{5 \cdot y} \]
        10. Recombined 2 regimes into one program.
        11. Final simplification62.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-80}:\\ \;\;\;\;x \cdot \left(z + t\right)\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-50}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + t\right)\\ \end{array} \]
        12. Add Preprocessing

        Alternative 10: 48.4% accurate, 1.4× speedup?

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

          1. Initial program 99.2%

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

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

              \[\leadsto \color{blue}{x \cdot t} \]
            2. *-lowering-*.f6442.2

              \[\leadsto \color{blue}{x \cdot t} \]
          5. Simplified42.2%

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

          if -4.1000000000000002e-13 < x < 5.8e-49

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{5 \cdot y} \]
          5. Simplified60.3%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.1 \cdot 10^{-13}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-49}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
        5. Add Preprocessing

        Alternative 11: 30.7% accurate, 4.3× speedup?

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

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

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

            \[\leadsto \color{blue}{5 \cdot y} \]
        5. Simplified29.3%

          \[\leadsto \color{blue}{5 \cdot y} \]
        6. Final simplification29.3%

          \[\leadsto y \cdot 5 \]
        7. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024204 
        (FPCore (x y z t)
          :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
          :precision binary64
          (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))