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

Percentage Accurate: 99.9% → 100.0%
Time: 13.3s
Alternatives: 14
Speedup: 1.2×

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 14 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: 100.0% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(y + z\right) \cdot 2\right)\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. +-commutative100.0%

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

      \[\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. *-un-lft-identity100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
    4. *-un-lft-identity100.0%

      \[\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+100.0%

      \[\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. *-un-lft-identity100.0%

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

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
    8. *-un-lft-identity100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
    9. distribute-rgt-out100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
    10. metadata-eval100.0%

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

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

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

Alternative 2: 78.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + z \cdot 2\right)\\ t_2 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+32}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-29}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-94}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+58}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+107}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{+123}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+128}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -2.9e+32)
     t_2
     (if (<= y -3.9e-29)
       t_1
       (if (<= y -3.8e-29)
         (* y 5.0)
         (if (<= y -1e-80)
           t_1
           (if (<= y -2.2e-94)
             t_2
             (if (<= y 2.95e+58)
               t_1
               (if (<= y 2e+107)
                 t_2
                 (if (<= y 1.18e+123)
                   (* x (* (+ y z) 2.0))
                   (if (<= y 3.2e+128) (* x (+ t (* y 2.0))) t_2)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -2.9e+32) {
		tmp = t_2;
	} else if (y <= -3.9e-29) {
		tmp = t_1;
	} else if (y <= -3.8e-29) {
		tmp = y * 5.0;
	} else if (y <= -1e-80) {
		tmp = t_1;
	} else if (y <= -2.2e-94) {
		tmp = t_2;
	} else if (y <= 2.95e+58) {
		tmp = t_1;
	} else if (y <= 2e+107) {
		tmp = t_2;
	} else if (y <= 1.18e+123) {
		tmp = x * ((y + z) * 2.0);
	} else if (y <= 3.2e+128) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * (t + (z * 2.0d0))
    t_2 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-2.9d+32)) then
        tmp = t_2
    else if (y <= (-3.9d-29)) then
        tmp = t_1
    else if (y <= (-3.8d-29)) then
        tmp = y * 5.0d0
    else if (y <= (-1d-80)) then
        tmp = t_1
    else if (y <= (-2.2d-94)) then
        tmp = t_2
    else if (y <= 2.95d+58) then
        tmp = t_1
    else if (y <= 2d+107) then
        tmp = t_2
    else if (y <= 1.18d+123) then
        tmp = x * ((y + z) * 2.0d0)
    else if (y <= 3.2d+128) then
        tmp = x * (t + (y * 2.0d0))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -2.9e+32) {
		tmp = t_2;
	} else if (y <= -3.9e-29) {
		tmp = t_1;
	} else if (y <= -3.8e-29) {
		tmp = y * 5.0;
	} else if (y <= -1e-80) {
		tmp = t_1;
	} else if (y <= -2.2e-94) {
		tmp = t_2;
	} else if (y <= 2.95e+58) {
		tmp = t_1;
	} else if (y <= 2e+107) {
		tmp = t_2;
	} else if (y <= 1.18e+123) {
		tmp = x * ((y + z) * 2.0);
	} else if (y <= 3.2e+128) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	t_2 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -2.9e+32:
		tmp = t_2
	elif y <= -3.9e-29:
		tmp = t_1
	elif y <= -3.8e-29:
		tmp = y * 5.0
	elif y <= -1e-80:
		tmp = t_1
	elif y <= -2.2e-94:
		tmp = t_2
	elif y <= 2.95e+58:
		tmp = t_1
	elif y <= 2e+107:
		tmp = t_2
	elif y <= 1.18e+123:
		tmp = x * ((y + z) * 2.0)
	elif y <= 3.2e+128:
		tmp = x * (t + (y * 2.0))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(z * 2.0)))
	t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -2.9e+32)
		tmp = t_2;
	elseif (y <= -3.9e-29)
		tmp = t_1;
	elseif (y <= -3.8e-29)
		tmp = Float64(y * 5.0);
	elseif (y <= -1e-80)
		tmp = t_1;
	elseif (y <= -2.2e-94)
		tmp = t_2;
	elseif (y <= 2.95e+58)
		tmp = t_1;
	elseif (y <= 2e+107)
		tmp = t_2;
	elseif (y <= 1.18e+123)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	elseif (y <= 3.2e+128)
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (z * 2.0));
	t_2 = y * (5.0 + (x * 2.0));
	tmp = 0.0;
	if (y <= -2.9e+32)
		tmp = t_2;
	elseif (y <= -3.9e-29)
		tmp = t_1;
	elseif (y <= -3.8e-29)
		tmp = y * 5.0;
	elseif (y <= -1e-80)
		tmp = t_1;
	elseif (y <= -2.2e-94)
		tmp = t_2;
	elseif (y <= 2.95e+58)
		tmp = t_1;
	elseif (y <= 2e+107)
		tmp = t_2;
	elseif (y <= 1.18e+123)
		tmp = x * ((y + z) * 2.0);
	elseif (y <= 3.2e+128)
		tmp = x * (t + (y * 2.0));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.9e+32], t$95$2, If[LessEqual[y, -3.9e-29], t$95$1, If[LessEqual[y, -3.8e-29], N[(y * 5.0), $MachinePrecision], If[LessEqual[y, -1e-80], t$95$1, If[LessEqual[y, -2.2e-94], t$95$2, If[LessEqual[y, 2.95e+58], t$95$1, If[LessEqual[y, 2e+107], t$95$2, If[LessEqual[y, 1.18e+123], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+128], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.9 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -3.9 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.8 \cdot 10^{-29}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;y \leq -1 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.2 \cdot 10^{-94}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.95 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.18 \cdot 10^{+123}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.90000000000000003e32 or -9.99999999999999961e-81 < y < -2.20000000000000001e-94 or 2.94999999999999986e58 < y < 1.9999999999999999e107 or 3.19999999999999986e128 < y

    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 inf 75.2%

      \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
    4. Simplified75.2%

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

    if -2.90000000000000003e32 < y < -3.8999999999999998e-29 or -3.79999999999999976e-29 < y < -9.99999999999999961e-81 or -2.20000000000000001e-94 < y < 2.94999999999999986e58

    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. +-commutative99.9%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define99.8%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/99.9%

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

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

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

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

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

    if -3.8999999999999998e-29 < y < -3.79999999999999976e-29

    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 x around 0 100.0%

      \[\leadsto \color{blue}{5 \cdot y} \]
    4. Simplified100.0%

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

    if 1.9999999999999999e107 < y < 1.18000000000000006e123

    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. Step-by-step derivation
      1. associate-+l+100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
      2. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
      3. +-commutative100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      4. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      5. distribute-rgt-out100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
      6. metadata-eval100.0%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot 2} + t\right) + y \cdot 5 \]
    5. Taylor expanded in t around 0 100.0%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} + y \cdot 5 \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot 2} + y \cdot 5 \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{\left(\left(y + z\right) \cdot x\right)} \cdot 2 + y \cdot 5 \]
      3. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    7. Simplified100.0%

      \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    8. Taylor expanded in x around inf 80.2%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*80.2%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      2. *-commutative80.2%

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

        \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(z + y\right)} \]
      4. associate-*r*80.2%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
    10. Simplified80.2%

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

    if 1.18000000000000006e123 < y < 3.19999999999999986e128

    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 inf 100.0%

      \[\leadsto x \cdot \left(\left(\color{blue}{y} + y\right) + t\right) + y \cdot 5 \]
    4. Taylor expanded in x around inf 94.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+32}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.9 \cdot 10^{-29}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.8 \cdot 10^{-29}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-80}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-94}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+58}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+107}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.18 \cdot 10^{+123}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+128}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 46.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot 2\right)\\ t_2 := x \cdot \left(z \cdot 2\right)\\ \mathbf{if}\;x \leq -4.8 \cdot 10^{+219}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{+178}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-76}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+39}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+89}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+129}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+153}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (* x 2.0))) (t_2 (* x (* z 2.0))))
   (if (<= x -4.8e+219)
     t_1
     (if (<= x -4.8e+178)
       t_2
       (if (<= x -4.5e+22)
         t_1
         (if (<= x 1.15e-76)
           (* y 5.0)
           (if (<= x 1.65e+39)
             (* x t)
             (if (<= x 8.5e+89)
               t_2
               (if (<= x 3.1e+129) t_1 (if (<= x 2e+153) (* x t) t_2))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (x * 2.0);
	double t_2 = x * (z * 2.0);
	double tmp;
	if (x <= -4.8e+219) {
		tmp = t_1;
	} else if (x <= -4.8e+178) {
		tmp = t_2;
	} else if (x <= -4.5e+22) {
		tmp = t_1;
	} else if (x <= 1.15e-76) {
		tmp = y * 5.0;
	} else if (x <= 1.65e+39) {
		tmp = x * t;
	} else if (x <= 8.5e+89) {
		tmp = t_2;
	} else if (x <= 3.1e+129) {
		tmp = t_1;
	} else if (x <= 2e+153) {
		tmp = x * t;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = y * (x * 2.0d0)
    t_2 = x * (z * 2.0d0)
    if (x <= (-4.8d+219)) then
        tmp = t_1
    else if (x <= (-4.8d+178)) then
        tmp = t_2
    else if (x <= (-4.5d+22)) then
        tmp = t_1
    else if (x <= 1.15d-76) then
        tmp = y * 5.0d0
    else if (x <= 1.65d+39) then
        tmp = x * t
    else if (x <= 8.5d+89) then
        tmp = t_2
    else if (x <= 3.1d+129) then
        tmp = t_1
    else if (x <= 2d+153) then
        tmp = x * t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (x * 2.0);
	double t_2 = x * (z * 2.0);
	double tmp;
	if (x <= -4.8e+219) {
		tmp = t_1;
	} else if (x <= -4.8e+178) {
		tmp = t_2;
	} else if (x <= -4.5e+22) {
		tmp = t_1;
	} else if (x <= 1.15e-76) {
		tmp = y * 5.0;
	} else if (x <= 1.65e+39) {
		tmp = x * t;
	} else if (x <= 8.5e+89) {
		tmp = t_2;
	} else if (x <= 3.1e+129) {
		tmp = t_1;
	} else if (x <= 2e+153) {
		tmp = x * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (x * 2.0)
	t_2 = x * (z * 2.0)
	tmp = 0
	if x <= -4.8e+219:
		tmp = t_1
	elif x <= -4.8e+178:
		tmp = t_2
	elif x <= -4.5e+22:
		tmp = t_1
	elif x <= 1.15e-76:
		tmp = y * 5.0
	elif x <= 1.65e+39:
		tmp = x * t
	elif x <= 8.5e+89:
		tmp = t_2
	elif x <= 3.1e+129:
		tmp = t_1
	elif x <= 2e+153:
		tmp = x * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(x * 2.0))
	t_2 = Float64(x * Float64(z * 2.0))
	tmp = 0.0
	if (x <= -4.8e+219)
		tmp = t_1;
	elseif (x <= -4.8e+178)
		tmp = t_2;
	elseif (x <= -4.5e+22)
		tmp = t_1;
	elseif (x <= 1.15e-76)
		tmp = Float64(y * 5.0);
	elseif (x <= 1.65e+39)
		tmp = Float64(x * t);
	elseif (x <= 8.5e+89)
		tmp = t_2;
	elseif (x <= 3.1e+129)
		tmp = t_1;
	elseif (x <= 2e+153)
		tmp = Float64(x * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (x * 2.0);
	t_2 = x * (z * 2.0);
	tmp = 0.0;
	if (x <= -4.8e+219)
		tmp = t_1;
	elseif (x <= -4.8e+178)
		tmp = t_2;
	elseif (x <= -4.5e+22)
		tmp = t_1;
	elseif (x <= 1.15e-76)
		tmp = y * 5.0;
	elseif (x <= 1.65e+39)
		tmp = x * t;
	elseif (x <= 8.5e+89)
		tmp = t_2;
	elseif (x <= 3.1e+129)
		tmp = t_1;
	elseif (x <= 2e+153)
		tmp = x * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+219], t$95$1, If[LessEqual[x, -4.8e+178], t$95$2, If[LessEqual[x, -4.5e+22], t$95$1, If[LessEqual[x, 1.15e-76], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.65e+39], N[(x * t), $MachinePrecision], If[LessEqual[x, 8.5e+89], t$95$2, If[LessEqual[x, 3.1e+129], t$95$1, If[LessEqual[x, 2e+153], N[(x * t), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot 2\right)\\
t_2 := x \cdot \left(z \cdot 2\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+219}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{+178}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -4.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-76}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 1.65 \cdot 10^{+39}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq 8.5 \cdot 10^{+89}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3.1 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2 \cdot 10^{+153}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.8000000000000001e219 or -4.8e178 < x < -4.4999999999999998e22 or 8.50000000000000045e89 < x < 3.1e129

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
      2. *-commutative45.4%

        \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
    7. Simplified45.4%

      \[\leadsto \color{blue}{y \cdot \left(x \cdot 2 + 5\right)} \]
    8. Taylor expanded in x around inf 43.6%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    9. Step-by-step derivation
      1. *-commutative43.6%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. *-commutative43.6%

        \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot 2 \]
      3. associate-*r*45.4%

        \[\leadsto \color{blue}{y \cdot \left(x \cdot 2\right)} \]
    10. Simplified45.4%

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

    if -4.8000000000000001e219 < x < -4.8e178 or 1.6500000000000001e39 < x < 8.50000000000000045e89 or 2e153 < 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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define100.0%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/100.0%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in z around inf 55.3%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
    9. Step-by-step derivation
      1. *-commutative55.3%

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot x\right)} \]
      2. associate-*l*55.3%

        \[\leadsto \color{blue}{\left(2 \cdot z\right) \cdot x} \]
      3. *-commutative55.3%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
    10. Simplified55.3%

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

    if -4.4999999999999998e22 < x < 1.15000000000000003e-76

    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 61.9%

      \[\leadsto \color{blue}{5 \cdot y} \]
    4. Simplified61.9%

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

    if 1.15000000000000003e-76 < x < 1.6500000000000001e39 or 3.1e129 < x < 2e153

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define97.1%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/97.2%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative97.2%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in t around inf 50.1%

      \[\leadsto \color{blue}{t \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative50.1%

        \[\leadsto \color{blue}{x \cdot t} \]
    10. Simplified50.1%

      \[\leadsto \color{blue}{x \cdot t} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+219}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{+178}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{+22}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-76}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+39}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq 3.1 \cdot 10^{+129}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+153}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ t_3 := y \cdot 5 + x \cdot t\\ \mathbf{if}\;x \leq -1.56 \cdot 10^{-9}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-83}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-156}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-247}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9.6 \cdot 10^{-260}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-118}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z))))
        (t_2 (* x (+ t (* (+ y z) 2.0))))
        (t_3 (+ (* y 5.0) (* x t))))
   (if (<= x -1.56e-9)
     t_2
     (if (<= x -7.6e-83)
       t_1
       (if (<= x -3.4e-156)
         t_3
         (if (<= x -6.5e-247)
           t_1
           (if (<= x 9.6e-260)
             t_3
             (if (<= x 9.5e-173) t_1 (if (<= x 5e-118) t_3 t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (2.0 * (x * z));
	double t_2 = x * (t + ((y + z) * 2.0));
	double t_3 = (y * 5.0) + (x * t);
	double tmp;
	if (x <= -1.56e-9) {
		tmp = t_2;
	} else if (x <= -7.6e-83) {
		tmp = t_1;
	} else if (x <= -3.4e-156) {
		tmp = t_3;
	} else if (x <= -6.5e-247) {
		tmp = t_1;
	} else if (x <= 9.6e-260) {
		tmp = t_3;
	} else if (x <= 9.5e-173) {
		tmp = t_1;
	} else if (x <= 5e-118) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (y * 5.0d0) + (2.0d0 * (x * z))
    t_2 = x * (t + ((y + z) * 2.0d0))
    t_3 = (y * 5.0d0) + (x * t)
    if (x <= (-1.56d-9)) then
        tmp = t_2
    else if (x <= (-7.6d-83)) then
        tmp = t_1
    else if (x <= (-3.4d-156)) then
        tmp = t_3
    else if (x <= (-6.5d-247)) then
        tmp = t_1
    else if (x <= 9.6d-260) then
        tmp = t_3
    else if (x <= 9.5d-173) then
        tmp = t_1
    else if (x <= 5d-118) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (2.0 * (x * z));
	double t_2 = x * (t + ((y + z) * 2.0));
	double t_3 = (y * 5.0) + (x * t);
	double tmp;
	if (x <= -1.56e-9) {
		tmp = t_2;
	} else if (x <= -7.6e-83) {
		tmp = t_1;
	} else if (x <= -3.4e-156) {
		tmp = t_3;
	} else if (x <= -6.5e-247) {
		tmp = t_1;
	} else if (x <= 9.6e-260) {
		tmp = t_3;
	} else if (x <= 9.5e-173) {
		tmp = t_1;
	} else if (x <= 5e-118) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * 5.0) + (2.0 * (x * z))
	t_2 = x * (t + ((y + z) * 2.0))
	t_3 = (y * 5.0) + (x * t)
	tmp = 0
	if x <= -1.56e-9:
		tmp = t_2
	elif x <= -7.6e-83:
		tmp = t_1
	elif x <= -3.4e-156:
		tmp = t_3
	elif x <= -6.5e-247:
		tmp = t_1
	elif x <= 9.6e-260:
		tmp = t_3
	elif x <= 9.5e-173:
		tmp = t_1
	elif x <= 5e-118:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z)))
	t_2 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))
	t_3 = Float64(Float64(y * 5.0) + Float64(x * t))
	tmp = 0.0
	if (x <= -1.56e-9)
		tmp = t_2;
	elseif (x <= -7.6e-83)
		tmp = t_1;
	elseif (x <= -3.4e-156)
		tmp = t_3;
	elseif (x <= -6.5e-247)
		tmp = t_1;
	elseif (x <= 9.6e-260)
		tmp = t_3;
	elseif (x <= 9.5e-173)
		tmp = t_1;
	elseif (x <= 5e-118)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * 5.0) + (2.0 * (x * z));
	t_2 = x * (t + ((y + z) * 2.0));
	t_3 = (y * 5.0) + (x * t);
	tmp = 0.0;
	if (x <= -1.56e-9)
		tmp = t_2;
	elseif (x <= -7.6e-83)
		tmp = t_1;
	elseif (x <= -3.4e-156)
		tmp = t_3;
	elseif (x <= -6.5e-247)
		tmp = t_1;
	elseif (x <= 9.6e-260)
		tmp = t_3;
	elseif (x <= 9.5e-173)
		tmp = t_1;
	elseif (x <= 5e-118)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.56e-9], t$95$2, If[LessEqual[x, -7.6e-83], t$95$1, If[LessEqual[x, -3.4e-156], t$95$3, If[LessEqual[x, -6.5e-247], t$95$1, If[LessEqual[x, 9.6e-260], t$95$3, If[LessEqual[x, 9.5e-173], t$95$1, If[LessEqual[x, 5e-118], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -1.56 \cdot 10^{-9}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -7.6 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -3.4 \cdot 10^{-156}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 9.6 \cdot 10^{-260}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 5 \cdot 10^{-118}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.56e-9 or 5.00000000000000015e-118 < 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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define98.7%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/98.8%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative98.8%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in x around inf 92.6%

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

    if -1.56e-9 < x < -7.59999999999999953e-83 or -3.3999999999999999e-156 < x < -6.4999999999999996e-247 or 9.6000000000000002e-260 < x < 9.49999999999999967e-173

    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 inf 90.1%

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

    if -7.59999999999999953e-83 < x < -3.3999999999999999e-156 or -6.4999999999999996e-247 < x < 9.6000000000000002e-260 or 9.49999999999999967e-173 < x < 5.00000000000000015e-118

    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 t around inf 90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.56 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-83}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-156}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-247}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq 9.6 \cdot 10^{-260}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-173}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-118}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot 5 + x \cdot t\\ t_2 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -0.048:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-50}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+73} \lor \neg \left(x \leq 1.85 \cdot 10^{+122}\right):\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* x (* (+ y z) 2.0))))
   (if (<= x -0.048)
     t_2
     (if (<= x -5e-34)
       t_1
       (if (<= x -1.8e-50)
         (* x (* z 2.0))
         (if (<= x 3e-8)
           t_1
           (if (or (<= x 2.2e+73) (not (<= x 1.85e+122)))
             (* x (+ t (* z 2.0)))
             t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (x * t);
	double t_2 = x * ((y + z) * 2.0);
	double tmp;
	if (x <= -0.048) {
		tmp = t_2;
	} else if (x <= -5e-34) {
		tmp = t_1;
	} else if (x <= -1.8e-50) {
		tmp = x * (z * 2.0);
	} else if (x <= 3e-8) {
		tmp = t_1;
	} else if ((x <= 2.2e+73) || !(x <= 1.85e+122)) {
		tmp = x * (t + (z * 2.0));
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (y * 5.0d0) + (x * t)
    t_2 = x * ((y + z) * 2.0d0)
    if (x <= (-0.048d0)) then
        tmp = t_2
    else if (x <= (-5d-34)) then
        tmp = t_1
    else if (x <= (-1.8d-50)) then
        tmp = x * (z * 2.0d0)
    else if (x <= 3d-8) then
        tmp = t_1
    else if ((x <= 2.2d+73) .or. (.not. (x <= 1.85d+122))) then
        tmp = x * (t + (z * 2.0d0))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (x * t);
	double t_2 = x * ((y + z) * 2.0);
	double tmp;
	if (x <= -0.048) {
		tmp = t_2;
	} else if (x <= -5e-34) {
		tmp = t_1;
	} else if (x <= -1.8e-50) {
		tmp = x * (z * 2.0);
	} else if (x <= 3e-8) {
		tmp = t_1;
	} else if ((x <= 2.2e+73) || !(x <= 1.85e+122)) {
		tmp = x * (t + (z * 2.0));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * 5.0) + (x * t)
	t_2 = x * ((y + z) * 2.0)
	tmp = 0
	if x <= -0.048:
		tmp = t_2
	elif x <= -5e-34:
		tmp = t_1
	elif x <= -1.8e-50:
		tmp = x * (z * 2.0)
	elif x <= 3e-8:
		tmp = t_1
	elif (x <= 2.2e+73) or not (x <= 1.85e+122):
		tmp = x * (t + (z * 2.0))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y * 5.0) + Float64(x * t))
	t_2 = Float64(x * Float64(Float64(y + z) * 2.0))
	tmp = 0.0
	if (x <= -0.048)
		tmp = t_2;
	elseif (x <= -5e-34)
		tmp = t_1;
	elseif (x <= -1.8e-50)
		tmp = Float64(x * Float64(z * 2.0));
	elseif (x <= 3e-8)
		tmp = t_1;
	elseif ((x <= 2.2e+73) || !(x <= 1.85e+122))
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y * 5.0) + (x * t);
	t_2 = x * ((y + z) * 2.0);
	tmp = 0.0;
	if (x <= -0.048)
		tmp = t_2;
	elseif (x <= -5e-34)
		tmp = t_1;
	elseif (x <= -1.8e-50)
		tmp = x * (z * 2.0);
	elseif (x <= 3e-8)
		tmp = t_1;
	elseif ((x <= 2.2e+73) || ~((x <= 1.85e+122)))
		tmp = x * (t + (z * 2.0));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.048], t$95$2, If[LessEqual[x, -5e-34], t$95$1, If[LessEqual[x, -1.8e-50], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e-8], t$95$1, If[Or[LessEqual[x, 2.2e+73], N[Not[LessEqual[x, 1.85e+122]], $MachinePrecision]], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -0.048:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.8 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\

\mathbf{elif}\;x \leq 3 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{+73} \lor \neg \left(x \leq 1.85 \cdot 10^{+122}\right):\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -0.048000000000000001 or 2.2e73 < x < 1.8499999999999998e122

    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. Step-by-step derivation
      1. associate-+l+100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
      2. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
      3. +-commutative100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      4. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      5. distribute-rgt-out100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
      6. metadata-eval100.0%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot 2} + t\right) + y \cdot 5 \]
    5. Taylor expanded in t around 0 77.8%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} + y \cdot 5 \]
    6. Step-by-step derivation
      1. *-commutative77.8%

        \[\leadsto \color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot 2} + y \cdot 5 \]
      2. *-commutative77.8%

        \[\leadsto \color{blue}{\left(\left(y + z\right) \cdot x\right)} \cdot 2 + y \cdot 5 \]
      3. associate-*l*77.8%

        \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    7. Simplified77.8%

      \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    8. Taylor expanded in x around inf 77.1%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*77.1%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      2. *-commutative77.1%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      3. +-commutative77.1%

        \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(z + y\right)} \]
      4. associate-*r*77.1%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
    10. Simplified77.1%

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

    if -0.048000000000000001 < x < -5.0000000000000003e-34 or -1.7999999999999999e-50 < x < 2.99999999999999973e-8

    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 t around inf 84.6%

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

    if -5.0000000000000003e-34 < x < -1.7999999999999999e-50

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define100.0%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/100.0%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in z around inf 100.0%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
    9. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot x\right)} \]
      2. associate-*l*100.0%

        \[\leadsto \color{blue}{\left(2 \cdot z\right) \cdot x} \]
      3. *-commutative100.0%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
    10. Simplified100.0%

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

    if 2.99999999999999973e-8 < x < 2.2e73 or 1.8499999999999998e122 < 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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define100.0%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/100.0%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification81.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.048:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-34}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-50}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+73} \lor \neg \left(x \leq 1.85 \cdot 10^{+122}\right):\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;z \leq -5.7 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-176}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-192}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-133}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-104}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* y 2.0)))))
   (if (<= z -1e+17)
     (* x (+ t (* z 2.0)))
     (if (<= z -5.7e-11)
       (* y 5.0)
       (if (<= z -2.5e-176)
         t_1
         (if (<= z -1.55e-192)
           (* y 5.0)
           (if (<= z 6.8e-133)
             t_1
             (if (<= z 1.05e-104) (* y 5.0) (* x (* (+ y z) 2.0))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (z <= -1e+17) {
		tmp = x * (t + (z * 2.0));
	} else if (z <= -5.7e-11) {
		tmp = y * 5.0;
	} else if (z <= -2.5e-176) {
		tmp = t_1;
	} else if (z <= -1.55e-192) {
		tmp = y * 5.0;
	} else if (z <= 6.8e-133) {
		tmp = t_1;
	} else if (z <= 1.05e-104) {
		tmp = y * 5.0;
	} else {
		tmp = x * ((y + z) * 2.0);
	}
	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 * 2.0d0))
    if (z <= (-1d+17)) then
        tmp = x * (t + (z * 2.0d0))
    else if (z <= (-5.7d-11)) then
        tmp = y * 5.0d0
    else if (z <= (-2.5d-176)) then
        tmp = t_1
    else if (z <= (-1.55d-192)) then
        tmp = y * 5.0d0
    else if (z <= 6.8d-133) then
        tmp = t_1
    else if (z <= 1.05d-104) then
        tmp = y * 5.0d0
    else
        tmp = x * ((y + z) * 2.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (z <= -1e+17) {
		tmp = x * (t + (z * 2.0));
	} else if (z <= -5.7e-11) {
		tmp = y * 5.0;
	} else if (z <= -2.5e-176) {
		tmp = t_1;
	} else if (z <= -1.55e-192) {
		tmp = y * 5.0;
	} else if (z <= 6.8e-133) {
		tmp = t_1;
	} else if (z <= 1.05e-104) {
		tmp = y * 5.0;
	} else {
		tmp = x * ((y + z) * 2.0);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y * 2.0))
	tmp = 0
	if z <= -1e+17:
		tmp = x * (t + (z * 2.0))
	elif z <= -5.7e-11:
		tmp = y * 5.0
	elif z <= -2.5e-176:
		tmp = t_1
	elif z <= -1.55e-192:
		tmp = y * 5.0
	elif z <= 6.8e-133:
		tmp = t_1
	elif z <= 1.05e-104:
		tmp = y * 5.0
	else:
		tmp = x * ((y + z) * 2.0)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (z <= -1e+17)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	elseif (z <= -5.7e-11)
		tmp = Float64(y * 5.0);
	elseif (z <= -2.5e-176)
		tmp = t_1;
	elseif (z <= -1.55e-192)
		tmp = Float64(y * 5.0);
	elseif (z <= 6.8e-133)
		tmp = t_1;
	elseif (z <= 1.05e-104)
		tmp = Float64(y * 5.0);
	else
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (z <= -1e+17)
		tmp = x * (t + (z * 2.0));
	elseif (z <= -5.7e-11)
		tmp = y * 5.0;
	elseif (z <= -2.5e-176)
		tmp = t_1;
	elseif (z <= -1.55e-192)
		tmp = y * 5.0;
	elseif (z <= 6.8e-133)
		tmp = t_1;
	elseif (z <= 1.05e-104)
		tmp = y * 5.0;
	else
		tmp = x * ((y + z) * 2.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+17], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.7e-11], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, -2.5e-176], t$95$1, If[LessEqual[z, -1.55e-192], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 6.8e-133], t$95$1, If[LessEqual[z, 1.05e-104], N[(y * 5.0), $MachinePrecision], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.7 \cdot 10^{-11}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-176}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-192}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.05 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 5\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1e17

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define84.3%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/84.3%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative84.3%

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

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

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

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

    if -1e17 < z < -5.6999999999999997e-11 or -2.5e-176 < z < -1.55e-192 or 6.80000000000000012e-133 < z < 1.04999999999999999e-104

    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 94.3%

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

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

    if -5.6999999999999997e-11 < z < -2.5e-176 or -1.55e-192 < z < 6.80000000000000012e-133

    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 inf 95.8%

      \[\leadsto x \cdot \left(\left(\color{blue}{y} + y\right) + t\right) + y \cdot 5 \]
    4. Taylor expanded in x around inf 68.4%

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

    if 1.04999999999999999e-104 < z

    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. associate-+l+99.9%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
      2. *-un-lft-identity99.9%

        \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
      3. +-commutative99.9%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      4. *-un-lft-identity99.9%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      5. distribute-rgt-out99.9%

        \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
      6. metadata-eval99.9%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot 2} + t\right) + y \cdot 5 \]
    5. Taylor expanded in t around 0 87.5%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} + y \cdot 5 \]
    6. Step-by-step derivation
      1. *-commutative87.5%

        \[\leadsto \color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot 2} + y \cdot 5 \]
      2. *-commutative87.5%

        \[\leadsto \color{blue}{\left(\left(y + z\right) \cdot x\right)} \cdot 2 + y \cdot 5 \]
      3. associate-*l*87.5%

        \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    7. Simplified87.5%

      \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    8. Taylor expanded in x around inf 64.4%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*64.4%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      2. *-commutative64.4%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      3. +-commutative64.4%

        \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(z + y\right)} \]
      4. associate-*r*64.4%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
    10. Simplified64.4%

      \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification69.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;z \leq -5.7 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-176}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-192}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-133}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{-104}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 43.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{+89} \lor \neg \left(t \leq -3.3 \cdot 10^{-14} \lor \neg \left(t \leq -1.9 \cdot 10^{-17}\right) \land t \leq 6.2 \cdot 10^{-52}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -3.5e+89)
         (not (or (<= t -3.3e-14) (and (not (<= t -1.9e-17)) (<= t 6.2e-52)))))
   (* x t)
   (* y 5.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.5e+89) || !((t <= -3.3e-14) || (!(t <= -1.9e-17) && (t <= 6.2e-52)))) {
		tmp = x * t;
	} else {
		tmp = y * 5.0;
	}
	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 ((t <= (-3.5d+89)) .or. (.not. (t <= (-3.3d-14)) .or. (.not. (t <= (-1.9d-17))) .and. (t <= 6.2d-52))) then
        tmp = x * t
    else
        tmp = y * 5.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.5e+89) || !((t <= -3.3e-14) || (!(t <= -1.9e-17) && (t <= 6.2e-52)))) {
		tmp = x * t;
	} else {
		tmp = y * 5.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -3.5e+89) or not ((t <= -3.3e-14) or (not (t <= -1.9e-17) and (t <= 6.2e-52))):
		tmp = x * t
	else:
		tmp = y * 5.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -3.5e+89) || !((t <= -3.3e-14) || (!(t <= -1.9e-17) && (t <= 6.2e-52))))
		tmp = Float64(x * t);
	else
		tmp = Float64(y * 5.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -3.5e+89) || ~(((t <= -3.3e-14) || (~((t <= -1.9e-17)) && (t <= 6.2e-52)))))
		tmp = x * t;
	else
		tmp = y * 5.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.5e+89], N[Not[Or[LessEqual[t, -3.3e-14], And[N[Not[LessEqual[t, -1.9e-17]], $MachinePrecision], LessEqual[t, 6.2e-52]]]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+89} \lor \neg \left(t \leq -3.3 \cdot 10^{-14} \lor \neg \left(t \leq -1.9 \cdot 10^{-17}\right) \land t \leq 6.2 \cdot 10^{-52}\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.5000000000000001e89 or -3.2999999999999998e-14 < t < -1.9000000000000001e-17 or 6.1999999999999998e-52 < t

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define85.8%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/85.8%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative85.8%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in t around inf 55.8%

      \[\leadsto \color{blue}{t \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative55.8%

        \[\leadsto \color{blue}{x \cdot t} \]
    10. Simplified55.8%

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

    if -3.5000000000000001e89 < t < -3.2999999999999998e-14 or -1.9000000000000001e-17 < t < 6.1999999999999998e-52

    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 x around 0 39.4%

      \[\leadsto \color{blue}{5 \cdot y} \]
    4. Simplified39.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{+89} \lor \neg \left(t \leq -3.3 \cdot 10^{-14} \lor \neg \left(t \leq -1.9 \cdot 10^{-17}\right) \land t \leq 6.2 \cdot 10^{-52}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{if}\;x \leq -0.22:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-77}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+63}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (* (+ y z) 2.0))))
   (if (<= x -0.22)
     t_1
     (if (<= x 2.3e-77)
       (* y 5.0)
       (if (<= x 6e+63) (* x (+ t (* y 2.0))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y + z) * 2.0);
	double tmp;
	if (x <= -0.22) {
		tmp = t_1;
	} else if (x <= 2.3e-77) {
		tmp = y * 5.0;
	} else if (x <= 6e+63) {
		tmp = x * (t + (y * 2.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 * ((y + z) * 2.0d0)
    if (x <= (-0.22d0)) then
        tmp = t_1
    else if (x <= 2.3d-77) then
        tmp = y * 5.0d0
    else if (x <= 6d+63) then
        tmp = x * (t + (y * 2.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 * ((y + z) * 2.0);
	double tmp;
	if (x <= -0.22) {
		tmp = t_1;
	} else if (x <= 2.3e-77) {
		tmp = y * 5.0;
	} else if (x <= 6e+63) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y + z) * 2.0)
	tmp = 0
	if x <= -0.22:
		tmp = t_1
	elif x <= 2.3e-77:
		tmp = y * 5.0
	elif x <= 6e+63:
		tmp = x * (t + (y * 2.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y + z) * 2.0))
	tmp = 0.0
	if (x <= -0.22)
		tmp = t_1;
	elseif (x <= 2.3e-77)
		tmp = Float64(y * 5.0);
	elseif (x <= 6e+63)
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y + z) * 2.0);
	tmp = 0.0;
	if (x <= -0.22)
		tmp = t_1;
	elseif (x <= 2.3e-77)
		tmp = y * 5.0;
	elseif (x <= 6e+63)
		tmp = x * (t + (y * 2.0));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.22], t$95$1, If[LessEqual[x, 2.3e-77], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6e+63], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 2.3 \cdot 10^{-77}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 6 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.220000000000000001 or 5.99999999999999998e63 < 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. Step-by-step derivation
      1. associate-+l+100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
      2. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
      3. +-commutative100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      4. *-un-lft-identity100.0%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      5. distribute-rgt-out100.0%

        \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
      6. metadata-eval100.0%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot 2} + t\right) + y \cdot 5 \]
    5. Taylor expanded in t around 0 73.4%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} + y \cdot 5 \]
    6. Step-by-step derivation
      1. *-commutative73.4%

        \[\leadsto \color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot 2} + y \cdot 5 \]
      2. *-commutative73.4%

        \[\leadsto \color{blue}{\left(\left(y + z\right) \cdot x\right)} \cdot 2 + y \cdot 5 \]
      3. associate-*l*73.4%

        \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    7. Simplified73.4%

      \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    8. Taylor expanded in x around inf 73.0%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*73.0%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      2. *-commutative73.0%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      3. +-commutative73.0%

        \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(z + y\right)} \]
      4. associate-*r*73.0%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
    10. Simplified73.0%

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

    if -0.220000000000000001 < x < 2.29999999999999999e-77

    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 64.4%

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

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

    if 2.29999999999999999e-77 < x < 5.99999999999999998e63

    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 y around inf 73.6%

      \[\leadsto x \cdot \left(\left(\color{blue}{y} + y\right) + t\right) + y \cdot 5 \]
    4. Taylor expanded in x around inf 54.3%

      \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot y\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.22:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-77}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6 \cdot 10^{+63}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{+88}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-14}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+94}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -5.6e+88)
   (* x t)
   (if (<= t -3.1e-14)
     (* y 5.0)
     (if (<= t 1.25e+94) (* x (* (+ y z) 2.0)) (* x t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -5.6e+88) {
		tmp = x * t;
	} else if (t <= -3.1e-14) {
		tmp = y * 5.0;
	} else if (t <= 1.25e+94) {
		tmp = x * ((y + z) * 2.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 (t <= (-5.6d+88)) then
        tmp = x * t
    else if (t <= (-3.1d-14)) then
        tmp = y * 5.0d0
    else if (t <= 1.25d+94) then
        tmp = x * ((y + z) * 2.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 (t <= -5.6e+88) {
		tmp = x * t;
	} else if (t <= -3.1e-14) {
		tmp = y * 5.0;
	} else if (t <= 1.25e+94) {
		tmp = x * ((y + z) * 2.0);
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -5.6e+88:
		tmp = x * t
	elif t <= -3.1e-14:
		tmp = y * 5.0
	elif t <= 1.25e+94:
		tmp = x * ((y + z) * 2.0)
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -5.6e+88)
		tmp = Float64(x * t);
	elseif (t <= -3.1e-14)
		tmp = Float64(y * 5.0);
	elseif (t <= 1.25e+94)
		tmp = Float64(x * Float64(Float64(y + z) * 2.0));
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -5.6e+88)
		tmp = x * t;
	elseif (t <= -3.1e-14)
		tmp = y * 5.0;
	elseif (t <= 1.25e+94)
		tmp = x * ((y + z) * 2.0);
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.6e+88], N[(x * t), $MachinePrecision], If[LessEqual[t, -3.1e-14], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 1.25e+94], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.6 \cdot 10^{+88}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-14}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq 1.25 \cdot 10^{+94}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.59999999999999977e88 or 1.25000000000000003e94 < t

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define81.6%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/81.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in t around inf 66.1%

      \[\leadsto \color{blue}{t \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative66.1%

        \[\leadsto \color{blue}{x \cdot t} \]
    10. Simplified66.1%

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

    if -5.59999999999999977e88 < t < -3.10000000000000004e-14

    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 x around 0 55.7%

      \[\leadsto \color{blue}{5 \cdot y} \]
    4. Simplified55.7%

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

    if -3.10000000000000004e-14 < t < 1.25000000000000003e94

    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. associate-+l+99.9%

        \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
      2. *-un-lft-identity99.9%

        \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
      3. +-commutative99.9%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      4. *-un-lft-identity99.9%

        \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
      5. distribute-rgt-out99.9%

        \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
      6. metadata-eval99.9%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot 2} + t\right) + y \cdot 5 \]
    5. Taylor expanded in t around 0 94.7%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} + y \cdot 5 \]
    6. Step-by-step derivation
      1. *-commutative94.7%

        \[\leadsto \color{blue}{\left(x \cdot \left(y + z\right)\right) \cdot 2} + y \cdot 5 \]
      2. *-commutative94.7%

        \[\leadsto \color{blue}{\left(\left(y + z\right) \cdot x\right)} \cdot 2 + y \cdot 5 \]
      3. associate-*l*94.7%

        \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    7. Simplified94.7%

      \[\leadsto \color{blue}{\left(y + z\right) \cdot \left(x \cdot 2\right)} + y \cdot 5 \]
    8. Taylor expanded in x around inf 64.6%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot \left(y + z\right)\right)} \]
    9. Step-by-step derivation
      1. associate-*r*64.6%

        \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot \left(y + z\right)} \]
      2. *-commutative64.6%

        \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot \left(y + z\right) \]
      3. +-commutative64.6%

        \[\leadsto \left(x \cdot 2\right) \cdot \color{blue}{\left(z + y\right)} \]
      4. associate-*r*64.6%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
    10. Simplified64.6%

      \[\leadsto \color{blue}{x \cdot \left(2 \cdot \left(z + y\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.6 \cdot 10^{+88}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-14}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+94}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 98.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -31000000 \lor \neg \left(x \leq 6 \cdot 10^{-34}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -31000000.0) (not (<= x 6e-34)))
   (* x (+ t (* (+ y z) 2.0)))
   (+ (* y 5.0) (* x (+ t (* z 2.0))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -31000000.0) || !(x <= 6e-34)) {
		tmp = x * (t + ((y + z) * 2.0));
	} else {
		tmp = (y * 5.0) + (x * (t + (z * 2.0)));
	}
	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 <= (-31000000.0d0)) .or. (.not. (x <= 6d-34))) then
        tmp = x * (t + ((y + z) * 2.0d0))
    else
        tmp = (y * 5.0d0) + (x * (t + (z * 2.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -31000000.0) || !(x <= 6e-34)) {
		tmp = x * (t + ((y + z) * 2.0));
	} else {
		tmp = (y * 5.0) + (x * (t + (z * 2.0)));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -31000000.0) or not (x <= 6e-34):
		tmp = x * (t + ((y + z) * 2.0))
	else:
		tmp = (y * 5.0) + (x * (t + (z * 2.0)))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -31000000.0) || !(x <= 6e-34))
		tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(z * 2.0))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -31000000.0) || ~((x <= 6e-34)))
		tmp = x * (t + ((y + z) * 2.0));
	else
		tmp = (y * 5.0) + (x * (t + (z * 2.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -31000000.0], N[Not[LessEqual[x, 6e-34]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -31000000 \lor \neg \left(x \leq 6 \cdot 10^{-34}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.1e7 or 6e-34 < 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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define100.0%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/100.0%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in x around inf 97.6%

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

    if -3.1e7 < x < 6e-34

    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 y around 0 98.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -31000000 \lor \neg \left(x \leq 6 \cdot 10^{-34}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 47.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{+87}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -6.3 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 160000000000:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -7.2e+87)
   (* x t)
   (if (<= t -6.3e-15)
     (* y 5.0)
     (if (<= t 160000000000.0) (* x (* z 2.0)) (* x t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -7.2e+87) {
		tmp = x * t;
	} else if (t <= -6.3e-15) {
		tmp = y * 5.0;
	} else if (t <= 160000000000.0) {
		tmp = x * (z * 2.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 (t <= (-7.2d+87)) then
        tmp = x * t
    else if (t <= (-6.3d-15)) then
        tmp = y * 5.0d0
    else if (t <= 160000000000.0d0) then
        tmp = x * (z * 2.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 (t <= -7.2e+87) {
		tmp = x * t;
	} else if (t <= -6.3e-15) {
		tmp = y * 5.0;
	} else if (t <= 160000000000.0) {
		tmp = x * (z * 2.0);
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -7.2e+87:
		tmp = x * t
	elif t <= -6.3e-15:
		tmp = y * 5.0
	elif t <= 160000000000.0:
		tmp = x * (z * 2.0)
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -7.2e+87)
		tmp = Float64(x * t);
	elseif (t <= -6.3e-15)
		tmp = Float64(y * 5.0);
	elseif (t <= 160000000000.0)
		tmp = Float64(x * Float64(z * 2.0));
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -7.2e+87)
		tmp = x * t;
	elseif (t <= -6.3e-15)
		tmp = y * 5.0;
	elseif (t <= 160000000000.0)
		tmp = x * (z * 2.0);
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.2e+87], N[(x * t), $MachinePrecision], If[LessEqual[t, -6.3e-15], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 160000000000.0], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+87}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;t \leq -6.3 \cdot 10^{-15}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;t \leq 160000000000:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.19999999999999988e87 or 1.6e11 < t

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define83.7%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/83.7%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative83.7%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in t around inf 61.6%

      \[\leadsto \color{blue}{t \cdot x} \]
    9. Step-by-step derivation
      1. *-commutative61.6%

        \[\leadsto \color{blue}{x \cdot t} \]
    10. Simplified61.6%

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

    if -7.19999999999999988e87 < t < -6.29999999999999982e-15

    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 x around 0 55.7%

      \[\leadsto \color{blue}{5 \cdot y} \]
    4. Simplified55.7%

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

    if -6.29999999999999982e-15 < t < 1.6e11

    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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define94.0%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/94.1%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative94.1%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in z around inf 40.6%

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

        \[\leadsto 2 \cdot \color{blue}{\left(z \cdot x\right)} \]
      2. associate-*l*40.6%

        \[\leadsto \color{blue}{\left(2 \cdot z\right) \cdot x} \]
      3. *-commutative40.6%

        \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
    10. Simplified40.6%

      \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification50.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -7.2 \cdot 10^{+87}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -6.3 \cdot 10^{-15}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 160000000000:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 87.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-7} \lor \neg \left(x \leq 1.4 \cdot 10^{-76}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -2.1e-7) (not (<= x 1.4e-76)))
   (* x (+ t (* (+ y z) 2.0)))
   (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.1e-7) || !(x <= 1.4e-76)) {
		tmp = x * (t + ((y + z) * 2.0));
	} else {
		tmp = (y * 5.0) + (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 <= (-2.1d-7)) .or. (.not. (x <= 1.4d-76))) then
        tmp = x * (t + ((y + z) * 2.0d0))
    else
        tmp = (y * 5.0d0) + (x * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.1e-7) || !(x <= 1.4e-76)) {
		tmp = x * (t + ((y + z) * 2.0));
	} else {
		tmp = (y * 5.0) + (x * t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -2.1e-7) or not (x <= 1.4e-76):
		tmp = x * (t + ((y + z) * 2.0))
	else:
		tmp = (y * 5.0) + (x * t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -2.1e-7) || !(x <= 1.4e-76))
		tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(x * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -2.1e-7) || ~((x <= 1.4e-76)))
		tmp = x * (t + ((y + z) * 2.0));
	else
		tmp = (y * 5.0) + (x * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.1e-7], N[Not[LessEqual[x, 1.4e-76]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-7} \lor \neg \left(x \leq 1.4 \cdot 10^{-76}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\

\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1e-7 or 1.40000000000000005e-76 < 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. Step-by-step derivation
      1. +-commutative100.0%

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

        \[\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. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
      4. *-un-lft-identity100.0%

        \[\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+100.0%

        \[\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. *-un-lft-identity100.0%

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

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
      8. *-un-lft-identity100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
      9. distribute-rgt-out100.0%

        \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
      10. metadata-eval100.0%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
    6. Step-by-step derivation
      1. fma-define99.3%

        \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
      2. associate-*r/99.3%

        \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
      3. *-commutative99.3%

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

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

      \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
    8. Taylor expanded in x around inf 95.4%

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

    if -2.1e-7 < x < 1.40000000000000005e-76

    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 t around inf 83.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-7} \lor \neg \left(x \leq 1.4 \cdot 10^{-76}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 99.9% accurate, 1.2× speedup?

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

\\
y \cdot 5 + x \cdot \left(t + \left(y + z\right) \cdot 2\right)
\end{array}
Derivation
  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. Step-by-step derivation
    1. associate-+l+100.0%

      \[\leadsto x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right) + y \cdot 5 \]
    2. *-un-lft-identity100.0%

      \[\leadsto x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right) + y \cdot 5 \]
    3. +-commutative100.0%

      \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right) + y \cdot 5 \]
    4. *-un-lft-identity100.0%

      \[\leadsto x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right) + y \cdot 5 \]
    5. distribute-rgt-out100.0%

      \[\leadsto x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right) + y \cdot 5 \]
    6. metadata-eval100.0%

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

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

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

Alternative 14: 30.7% accurate, 5.0× speedup?

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

\\
x \cdot t
\end{array}
Derivation
  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. Step-by-step derivation
    1. +-commutative100.0%

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

      \[\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. *-un-lft-identity100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right) \]
    4. *-un-lft-identity100.0%

      \[\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+100.0%

      \[\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. *-un-lft-identity100.0%

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

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right) \]
    8. *-un-lft-identity100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right) \]
    9. distribute-rgt-out100.0%

      \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right) \]
    10. metadata-eval100.0%

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

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

    \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
  6. Step-by-step derivation
    1. fma-define90.4%

      \[\leadsto x \cdot \left(t + \color{blue}{\mathsf{fma}\left(2, y + z, 5 \cdot \frac{y}{x}\right)}\right) \]
    2. associate-*r/90.5%

      \[\leadsto x \cdot \left(t + \mathsf{fma}\left(2, y + z, \color{blue}{\frac{5 \cdot y}{x}}\right)\right) \]
    3. *-commutative90.5%

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

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

    \[\leadsto \color{blue}{x \cdot \left(t + \mathsf{fma}\left(2, y + z, y \cdot \frac{5}{x}\right)\right)} \]
  8. Taylor expanded in t around inf 29.9%

    \[\leadsto \color{blue}{t \cdot x} \]
  9. Step-by-step derivation
    1. *-commutative29.9%

      \[\leadsto \color{blue}{x \cdot t} \]
  10. Simplified29.9%

    \[\leadsto \color{blue}{x \cdot t} \]
  11. Add Preprocessing

Reproduce

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