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

Percentage Accurate: 99.8% → 99.9%
Time: 11.2s
Alternatives: 21
Speedup: 1.0×

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 21 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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% 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 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. 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: 45.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x \cdot 2\right)\\ t_2 := y \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \leq -1.5 \cdot 10^{+260}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{+225}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{+115}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.58 \cdot 10^{-68}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{-207}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-5}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+28}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 9.6 \cdot 10^{+141}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+207}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (* x 2.0))) (t_2 (* y (* x 2.0))))
   (if (<= x -1.5e+260)
     t_2
     (if (<= x -2.5e+225)
       (* x t)
       (if (<= x -1.2e+115)
         t_2
         (if (<= x -1.58e-68)
           t_1
           (if (<= x 1.12e-207)
             (* y 5.0)
             (if (<= x 3.8e-145)
               t_1
               (if (<= x 5.5e-5)
                 (* y 5.0)
                 (if (<= x 8.5e+28)
                   (* x t)
                   (if (<= x 9.6e+141)
                     t_1
                     (if (<= x 4.4e+207) (* x t) t_2))))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x * 2.0);
	double t_2 = y * (x * 2.0);
	double tmp;
	if (x <= -1.5e+260) {
		tmp = t_2;
	} else if (x <= -2.5e+225) {
		tmp = x * t;
	} else if (x <= -1.2e+115) {
		tmp = t_2;
	} else if (x <= -1.58e-68) {
		tmp = t_1;
	} else if (x <= 1.12e-207) {
		tmp = y * 5.0;
	} else if (x <= 3.8e-145) {
		tmp = t_1;
	} else if (x <= 5.5e-5) {
		tmp = y * 5.0;
	} else if (x <= 8.5e+28) {
		tmp = x * t;
	} else if (x <= 9.6e+141) {
		tmp = t_1;
	} else if (x <= 4.4e+207) {
		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 = z * (x * 2.0d0)
    t_2 = y * (x * 2.0d0)
    if (x <= (-1.5d+260)) then
        tmp = t_2
    else if (x <= (-2.5d+225)) then
        tmp = x * t
    else if (x <= (-1.2d+115)) then
        tmp = t_2
    else if (x <= (-1.58d-68)) then
        tmp = t_1
    else if (x <= 1.12d-207) then
        tmp = y * 5.0d0
    else if (x <= 3.8d-145) then
        tmp = t_1
    else if (x <= 5.5d-5) then
        tmp = y * 5.0d0
    else if (x <= 8.5d+28) then
        tmp = x * t
    else if (x <= 9.6d+141) then
        tmp = t_1
    else if (x <= 4.4d+207) 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 = z * (x * 2.0);
	double t_2 = y * (x * 2.0);
	double tmp;
	if (x <= -1.5e+260) {
		tmp = t_2;
	} else if (x <= -2.5e+225) {
		tmp = x * t;
	} else if (x <= -1.2e+115) {
		tmp = t_2;
	} else if (x <= -1.58e-68) {
		tmp = t_1;
	} else if (x <= 1.12e-207) {
		tmp = y * 5.0;
	} else if (x <= 3.8e-145) {
		tmp = t_1;
	} else if (x <= 5.5e-5) {
		tmp = y * 5.0;
	} else if (x <= 8.5e+28) {
		tmp = x * t;
	} else if (x <= 9.6e+141) {
		tmp = t_1;
	} else if (x <= 4.4e+207) {
		tmp = x * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x * 2.0)
	t_2 = y * (x * 2.0)
	tmp = 0
	if x <= -1.5e+260:
		tmp = t_2
	elif x <= -2.5e+225:
		tmp = x * t
	elif x <= -1.2e+115:
		tmp = t_2
	elif x <= -1.58e-68:
		tmp = t_1
	elif x <= 1.12e-207:
		tmp = y * 5.0
	elif x <= 3.8e-145:
		tmp = t_1
	elif x <= 5.5e-5:
		tmp = y * 5.0
	elif x <= 8.5e+28:
		tmp = x * t
	elif x <= 9.6e+141:
		tmp = t_1
	elif x <= 4.4e+207:
		tmp = x * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x * 2.0))
	t_2 = Float64(y * Float64(x * 2.0))
	tmp = 0.0
	if (x <= -1.5e+260)
		tmp = t_2;
	elseif (x <= -2.5e+225)
		tmp = Float64(x * t);
	elseif (x <= -1.2e+115)
		tmp = t_2;
	elseif (x <= -1.58e-68)
		tmp = t_1;
	elseif (x <= 1.12e-207)
		tmp = Float64(y * 5.0);
	elseif (x <= 3.8e-145)
		tmp = t_1;
	elseif (x <= 5.5e-5)
		tmp = Float64(y * 5.0);
	elseif (x <= 8.5e+28)
		tmp = Float64(x * t);
	elseif (x <= 9.6e+141)
		tmp = t_1;
	elseif (x <= 4.4e+207)
		tmp = Float64(x * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x * 2.0);
	t_2 = y * (x * 2.0);
	tmp = 0.0;
	if (x <= -1.5e+260)
		tmp = t_2;
	elseif (x <= -2.5e+225)
		tmp = x * t;
	elseif (x <= -1.2e+115)
		tmp = t_2;
	elseif (x <= -1.58e-68)
		tmp = t_1;
	elseif (x <= 1.12e-207)
		tmp = y * 5.0;
	elseif (x <= 3.8e-145)
		tmp = t_1;
	elseif (x <= 5.5e-5)
		tmp = y * 5.0;
	elseif (x <= 8.5e+28)
		tmp = x * t;
	elseif (x <= 9.6e+141)
		tmp = t_1;
	elseif (x <= 4.4e+207)
		tmp = x * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e+260], t$95$2, If[LessEqual[x, -2.5e+225], N[(x * t), $MachinePrecision], If[LessEqual[x, -1.2e+115], t$95$2, If[LessEqual[x, -1.58e-68], t$95$1, If[LessEqual[x, 1.12e-207], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.8e-145], t$95$1, If[LessEqual[x, 5.5e-5], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8.5e+28], N[(x * t), $MachinePrecision], If[LessEqual[x, 9.6e+141], t$95$1, If[LessEqual[x, 4.4e+207], N[(x * t), $MachinePrecision], t$95$2]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.5 \cdot 10^{+225}:\\
\;\;\;\;x \cdot t\\

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

\mathbf{elif}\;x \leq -1.58 \cdot 10^{-68}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.12 \cdot 10^{-207}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;x \leq 9.6 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 4.4 \cdot 10^{+207}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.4999999999999999e260 or -2.4999999999999999e225 < x < -1.2e115 or 4.40000000000000017e207 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.4999999999999999e260 < x < -2.4999999999999999e225 or 5.5000000000000002e-5 < x < 8.49999999999999954e28 or 9.59999999999999989e141 < x < 4.40000000000000017e207

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

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

    if -1.2e115 < x < -1.58e-68 or 1.12000000000000001e-207 < x < 3.8000000000000002e-145 or 8.49999999999999954e28 < x < 9.59999999999999989e141

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

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

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

    if -1.58e-68 < x < 1.12000000000000001e-207 or 3.8000000000000002e-145 < x < 5.5000000000000002e-5

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{+260}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{+225}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{+115}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.58 \cdot 10^{-68}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{-207}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-145}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-5}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+28}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 9.6 \cdot 10^{+141}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 4.4 \cdot 10^{+207}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(x \cdot 2\right)\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{+261}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{+213}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -520000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-76}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 0.00011:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+27} \lor \neg \left(x \leq 1.95 \cdot 10^{+120}\right) \land x \leq 6.5 \cdot 10^{+206}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (* x 2.0))))
   (if (<= x -2.2e+261)
     t_1
     (if (<= x -1.05e+213)
       (* x t)
       (if (<= x -520000000.0)
         t_1
         (if (<= x -8e-76)
           (* x t)
           (if (<= x 0.00011)
             (* y 5.0)
             (if (or (<= x 8.2e+27)
                     (and (not (<= x 1.95e+120)) (<= x 6.5e+206)))
               (* x t)
               t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (x * 2.0);
	double tmp;
	if (x <= -2.2e+261) {
		tmp = t_1;
	} else if (x <= -1.05e+213) {
		tmp = x * t;
	} else if (x <= -520000000.0) {
		tmp = t_1;
	} else if (x <= -8e-76) {
		tmp = x * t;
	} else if (x <= 0.00011) {
		tmp = y * 5.0;
	} else if ((x <= 8.2e+27) || (!(x <= 1.95e+120) && (x <= 6.5e+206))) {
		tmp = x * t;
	} 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 = y * (x * 2.0d0)
    if (x <= (-2.2d+261)) then
        tmp = t_1
    else if (x <= (-1.05d+213)) then
        tmp = x * t
    else if (x <= (-520000000.0d0)) then
        tmp = t_1
    else if (x <= (-8d-76)) then
        tmp = x * t
    else if (x <= 0.00011d0) then
        tmp = y * 5.0d0
    else if ((x <= 8.2d+27) .or. (.not. (x <= 1.95d+120)) .and. (x <= 6.5d+206)) then
        tmp = x * t
    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 = y * (x * 2.0);
	double tmp;
	if (x <= -2.2e+261) {
		tmp = t_1;
	} else if (x <= -1.05e+213) {
		tmp = x * t;
	} else if (x <= -520000000.0) {
		tmp = t_1;
	} else if (x <= -8e-76) {
		tmp = x * t;
	} else if (x <= 0.00011) {
		tmp = y * 5.0;
	} else if ((x <= 8.2e+27) || (!(x <= 1.95e+120) && (x <= 6.5e+206))) {
		tmp = x * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (x * 2.0)
	tmp = 0
	if x <= -2.2e+261:
		tmp = t_1
	elif x <= -1.05e+213:
		tmp = x * t
	elif x <= -520000000.0:
		tmp = t_1
	elif x <= -8e-76:
		tmp = x * t
	elif x <= 0.00011:
		tmp = y * 5.0
	elif (x <= 8.2e+27) or (not (x <= 1.95e+120) and (x <= 6.5e+206)):
		tmp = x * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(x * 2.0))
	tmp = 0.0
	if (x <= -2.2e+261)
		tmp = t_1;
	elseif (x <= -1.05e+213)
		tmp = Float64(x * t);
	elseif (x <= -520000000.0)
		tmp = t_1;
	elseif (x <= -8e-76)
		tmp = Float64(x * t);
	elseif (x <= 0.00011)
		tmp = Float64(y * 5.0);
	elseif ((x <= 8.2e+27) || (!(x <= 1.95e+120) && (x <= 6.5e+206)))
		tmp = Float64(x * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (x * 2.0);
	tmp = 0.0;
	if (x <= -2.2e+261)
		tmp = t_1;
	elseif (x <= -1.05e+213)
		tmp = x * t;
	elseif (x <= -520000000.0)
		tmp = t_1;
	elseif (x <= -8e-76)
		tmp = x * t;
	elseif (x <= 0.00011)
		tmp = y * 5.0;
	elseif ((x <= 8.2e+27) || (~((x <= 1.95e+120)) && (x <= 6.5e+206)))
		tmp = x * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+261], t$95$1, If[LessEqual[x, -1.05e+213], N[(x * t), $MachinePrecision], If[LessEqual[x, -520000000.0], t$95$1, If[LessEqual[x, -8e-76], N[(x * t), $MachinePrecision], If[LessEqual[x, 0.00011], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 8.2e+27], And[N[Not[LessEqual[x, 1.95e+120]], $MachinePrecision], LessEqual[x, 6.5e+206]]], N[(x * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.05 \cdot 10^{+213}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq -520000000:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 0.00011:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;x \leq 8.2 \cdot 10^{+27} \lor \neg \left(x \leq 1.95 \cdot 10^{+120}\right) \land x \leq 6.5 \cdot 10^{+206}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.19999999999999984e261 or -1.05e213 < x < -5.2e8 or 8.2000000000000005e27 < x < 1.9499999999999999e120 or 6.4999999999999995e206 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -2.19999999999999984e261 < x < -1.05e213 or -5.2e8 < x < -7.99999999999999942e-76 or 1.10000000000000004e-4 < x < 8.2000000000000005e27 or 1.9499999999999999e120 < x < 6.4999999999999995e206

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

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

    if -7.99999999999999942e-76 < x < 1.10000000000000004e-4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+261}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{+213}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -520000000:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-76}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 0.00011:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+27} \lor \neg \left(x \leq 1.95 \cdot 10^{+120}\right) \land x \leq 6.5 \cdot 10^{+206}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 64.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + z \cdot 2\right)\\ t_2 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -1 \cdot 10^{+120}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -7 \cdot 10^{+57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -950000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-78}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-208}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-145}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-5}:\\ \;\;\;\;y \cdot 5\\ \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 (* x (+ t (* y 2.0)))))
   (if (<= x -1e+120)
     t_2
     (if (<= x -7e+57)
       t_1
       (if (<= x -950000000.0)
         t_2
         (if (<= x -3.3e-78)
           t_1
           (if (<= x 9.5e-208)
             (* y 5.0)
             (if (<= x 6.5e-145) t_1 (if (<= x 5.5e-5) (* y 5.0) t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1e+120) {
		tmp = t_2;
	} else if (x <= -7e+57) {
		tmp = t_1;
	} else if (x <= -950000000.0) {
		tmp = t_2;
	} else if (x <= -3.3e-78) {
		tmp = t_1;
	} else if (x <= 9.5e-208) {
		tmp = y * 5.0;
	} else if (x <= 6.5e-145) {
		tmp = t_1;
	} else if (x <= 5.5e-5) {
		tmp = y * 5.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 = x * (t + (y * 2.0d0))
    if (x <= (-1d+120)) then
        tmp = t_2
    else if (x <= (-7d+57)) then
        tmp = t_1
    else if (x <= (-950000000.0d0)) then
        tmp = t_2
    else if (x <= (-3.3d-78)) then
        tmp = t_1
    else if (x <= 9.5d-208) then
        tmp = y * 5.0d0
    else if (x <= 6.5d-145) then
        tmp = t_1
    else if (x <= 5.5d-5) then
        tmp = y * 5.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 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1e+120) {
		tmp = t_2;
	} else if (x <= -7e+57) {
		tmp = t_1;
	} else if (x <= -950000000.0) {
		tmp = t_2;
	} else if (x <= -3.3e-78) {
		tmp = t_1;
	} else if (x <= 9.5e-208) {
		tmp = y * 5.0;
	} else if (x <= 6.5e-145) {
		tmp = t_1;
	} else if (x <= 5.5e-5) {
		tmp = y * 5.0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	t_2 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -1e+120:
		tmp = t_2
	elif x <= -7e+57:
		tmp = t_1
	elif x <= -950000000.0:
		tmp = t_2
	elif x <= -3.3e-78:
		tmp = t_1
	elif x <= 9.5e-208:
		tmp = y * 5.0
	elif x <= 6.5e-145:
		tmp = t_1
	elif x <= 5.5e-5:
		tmp = y * 5.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(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -1e+120)
		tmp = t_2;
	elseif (x <= -7e+57)
		tmp = t_1;
	elseif (x <= -950000000.0)
		tmp = t_2;
	elseif (x <= -3.3e-78)
		tmp = t_1;
	elseif (x <= 9.5e-208)
		tmp = Float64(y * 5.0);
	elseif (x <= 6.5e-145)
		tmp = t_1;
	elseif (x <= 5.5e-5)
		tmp = Float64(y * 5.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 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -1e+120)
		tmp = t_2;
	elseif (x <= -7e+57)
		tmp = t_1;
	elseif (x <= -950000000.0)
		tmp = t_2;
	elseif (x <= -3.3e-78)
		tmp = t_1;
	elseif (x <= 9.5e-208)
		tmp = y * 5.0;
	elseif (x <= 6.5e-145)
		tmp = t_1;
	elseif (x <= 5.5e-5)
		tmp = y * 5.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[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+120], t$95$2, If[LessEqual[x, -7e+57], t$95$1, If[LessEqual[x, -950000000.0], t$95$2, If[LessEqual[x, -3.3e-78], t$95$1, If[LessEqual[x, 9.5e-208], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.5e-145], t$95$1, If[LessEqual[x, 5.5e-5], N[(y * 5.0), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -950000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-208}:\\
\;\;\;\;y \cdot 5\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -9.9999999999999998e119 or -6.9999999999999995e57 < x < -9.5e8 or 5.5000000000000002e-5 < x

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999998e119 < x < -6.9999999999999995e57 or -9.5e8 < x < -3.29999999999999982e-78 or 9.5000000000000001e-208 < x < 6.5000000000000002e-145

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

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

    if -3.29999999999999982e-78 < x < 9.5000000000000001e-208 or 6.5000000000000002e-145 < x < 5.5000000000000002e-5

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+120}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -7 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq -950000000:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-78}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-208}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{-145}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{-5}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+45}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(z \cdot 2 + y \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+145}:\\ \;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(y \cdot x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.2e+45)
   (* y (+ 5.0 (* x 2.0)))
   (if (<= y -3.5e-43)
     (+ (* y 5.0) (* x t))
     (if (<= y 9.2e-69)
       (* x (+ t (* z 2.0)))
       (if (<= y 2.7e+106)
         (* x (+ (* z 2.0) (* y 2.0)))
         (if (<= y 2.1e+145)
           (* t (+ x (* y (/ 5.0 t))))
           (+ (* y 5.0) (* 2.0 (* y x)))))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.2e+45) {
		tmp = y * (5.0 + (x * 2.0));
	} else if (y <= -3.5e-43) {
		tmp = (y * 5.0) + (x * t);
	} else if (y <= 9.2e-69) {
		tmp = x * (t + (z * 2.0));
	} else if (y <= 2.7e+106) {
		tmp = x * ((z * 2.0) + (y * 2.0));
	} else if (y <= 2.1e+145) {
		tmp = t * (x + (y * (5.0 / t)));
	} else {
		tmp = (y * 5.0) + (2.0 * (y * x));
	}
	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 (y <= (-1.2d+45)) then
        tmp = y * (5.0d0 + (x * 2.0d0))
    else if (y <= (-3.5d-43)) then
        tmp = (y * 5.0d0) + (x * t)
    else if (y <= 9.2d-69) then
        tmp = x * (t + (z * 2.0d0))
    else if (y <= 2.7d+106) then
        tmp = x * ((z * 2.0d0) + (y * 2.0d0))
    else if (y <= 2.1d+145) then
        tmp = t * (x + (y * (5.0d0 / t)))
    else
        tmp = (y * 5.0d0) + (2.0d0 * (y * x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.2e+45) {
		tmp = y * (5.0 + (x * 2.0));
	} else if (y <= -3.5e-43) {
		tmp = (y * 5.0) + (x * t);
	} else if (y <= 9.2e-69) {
		tmp = x * (t + (z * 2.0));
	} else if (y <= 2.7e+106) {
		tmp = x * ((z * 2.0) + (y * 2.0));
	} else if (y <= 2.1e+145) {
		tmp = t * (x + (y * (5.0 / t)));
	} else {
		tmp = (y * 5.0) + (2.0 * (y * x));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.2e+45:
		tmp = y * (5.0 + (x * 2.0))
	elif y <= -3.5e-43:
		tmp = (y * 5.0) + (x * t)
	elif y <= 9.2e-69:
		tmp = x * (t + (z * 2.0))
	elif y <= 2.7e+106:
		tmp = x * ((z * 2.0) + (y * 2.0))
	elif y <= 2.1e+145:
		tmp = t * (x + (y * (5.0 / t)))
	else:
		tmp = (y * 5.0) + (2.0 * (y * x))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.2e+45)
		tmp = Float64(y * Float64(5.0 + Float64(x * 2.0)));
	elseif (y <= -3.5e-43)
		tmp = Float64(Float64(y * 5.0) + Float64(x * t));
	elseif (y <= 9.2e-69)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	elseif (y <= 2.7e+106)
		tmp = Float64(x * Float64(Float64(z * 2.0) + Float64(y * 2.0)));
	elseif (y <= 2.1e+145)
		tmp = Float64(t * Float64(x + Float64(y * Float64(5.0 / t))));
	else
		tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(y * x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.2e+45)
		tmp = y * (5.0 + (x * 2.0));
	elseif (y <= -3.5e-43)
		tmp = (y * 5.0) + (x * t);
	elseif (y <= 9.2e-69)
		tmp = x * (t + (z * 2.0));
	elseif (y <= 2.7e+106)
		tmp = x * ((z * 2.0) + (y * 2.0));
	elseif (y <= 2.1e+145)
		tmp = t * (x + (y * (5.0 / t)));
	else
		tmp = (y * 5.0) + (2.0 * (y * x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.2e+45], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-43], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-69], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+106], N[(x * N[(N[(z * 2.0), $MachinePrecision] + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+145], N[(t * N[(x + N[(y * N[(5.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+45}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\

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

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

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+145}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.19999999999999995e45

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

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

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

    if -1.19999999999999995e45 < y < -3.49999999999999997e-43

    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. Taylor expanded in x around 0 71.4%

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

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

    if -3.49999999999999997e-43 < y < 9.2000000000000003e-69

    1. Initial program 100.0%

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

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

    if 9.2000000000000003e-69 < y < 2.70000000000000006e106

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

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

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

    if 2.70000000000000006e106 < y < 2.09999999999999989e145

    1. Initial program 99.7%

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

        \[\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 t around inf 88.7%

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

      \[\leadsto t \cdot \left(x + \color{blue}{5 \cdot \frac{y}{t}}\right) \]
    7. Step-by-step derivation
      1. associate-*r/92.8%

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

        \[\leadsto t \cdot \left(x + \frac{\color{blue}{y \cdot 5}}{t}\right) \]
      3. associate-/l*92.8%

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

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

    if 2.09999999999999989e145 < 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 97.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+45}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(z \cdot 2 + y \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+145}:\\ \;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(y \cdot x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 75.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.35 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-43}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\

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

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+144}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.35000000000000001e45 or 8.4999999999999998e144 < y

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

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

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

    if -2.35000000000000001e45 < y < -2.7999999999999998e-43

    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. Taylor expanded in x around 0 71.4%

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

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

    if -2.7999999999999998e-43 < y < 9.2000000000000003e-69

    1. Initial program 100.0%

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

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

    if 9.2000000000000003e-69 < y < 1.1500000000000001e106

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

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

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

    if 1.1500000000000001e106 < y < 8.4999999999999998e144

    1. Initial program 99.7%

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

        \[\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 t around inf 88.7%

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

      \[\leadsto t \cdot \left(x + \color{blue}{5 \cdot \frac{y}{t}}\right) \]
    7. Step-by-step derivation
      1. associate-*r/92.8%

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

        \[\leadsto t \cdot \left(x + \frac{\color{blue}{y \cdot 5}}{t}\right) \]
      3. associate-/l*92.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.35 \cdot 10^{+45}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(z \cdot 2 + y \cdot 2\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+144}:\\ \;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -8.2 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\

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

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

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

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+148}:\\
\;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -8.1999999999999993e44 or 1.50000000000000007e148 < y

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

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

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

    if -8.1999999999999993e44 < y < -2.2999999999999999e-43

    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. Taylor expanded in x around 0 71.4%

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

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

    if -2.2999999999999999e-43 < y < 9.2000000000000003e-69

    1. Initial program 100.0%

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

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

    if 9.2000000000000003e-69 < y < 2.8000000000000001e105

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

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

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

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

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

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

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

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

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

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

    if 2.8000000000000001e105 < y < 1.50000000000000007e148

    1. Initial program 99.7%

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

        \[\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 t around inf 88.7%

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

      \[\leadsto t \cdot \left(x + \color{blue}{5 \cdot \frac{y}{t}}\right) \]
    7. Step-by-step derivation
      1. associate-*r/92.8%

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

        \[\leadsto t \cdot \left(x + \frac{\color{blue}{y \cdot 5}}{t}\right) \]
      3. associate-/l*92.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+44}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+105}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+148}:\\ \;\;\;\;t \cdot \left(x + y \cdot \frac{5}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot 5 + x \cdot t\\ t_2 := y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{if}\;y \leq -5.4 \cdot 10^{+44}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+105}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+145}:\\ \;\;\;\;t\_1\\ \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 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -5.4e+44)
     t_2
     (if (<= y -4e-43)
       t_1
       (if (<= y 5.6e-69)
         (* x (+ t (* z 2.0)))
         (if (<= y 4.1e+105)
           (* (+ y z) (* x 2.0))
           (if (<= y 1.05e+145) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y * 5.0) + (x * t);
	double t_2 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -5.4e+44) {
		tmp = t_2;
	} else if (y <= -4e-43) {
		tmp = t_1;
	} else if (y <= 5.6e-69) {
		tmp = x * (t + (z * 2.0));
	} else if (y <= 4.1e+105) {
		tmp = (y + z) * (x * 2.0);
	} else if (y <= 1.05e+145) {
		tmp = t_1;
	} 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 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-5.4d+44)) then
        tmp = t_2
    else if (y <= (-4d-43)) then
        tmp = t_1
    else if (y <= 5.6d-69) then
        tmp = x * (t + (z * 2.0d0))
    else if (y <= 4.1d+105) then
        tmp = (y + z) * (x * 2.0d0)
    else if (y <= 1.05d+145) then
        tmp = t_1
    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 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -5.4e+44) {
		tmp = t_2;
	} else if (y <= -4e-43) {
		tmp = t_1;
	} else if (y <= 5.6e-69) {
		tmp = x * (t + (z * 2.0));
	} else if (y <= 4.1e+105) {
		tmp = (y + z) * (x * 2.0);
	} else if (y <= 1.05e+145) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * 5.0) + (x * t)
	t_2 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -5.4e+44:
		tmp = t_2
	elif y <= -4e-43:
		tmp = t_1
	elif y <= 5.6e-69:
		tmp = x * (t + (z * 2.0))
	elif y <= 4.1e+105:
		tmp = (y + z) * (x * 2.0)
	elif y <= 1.05e+145:
		tmp = t_1
	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(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -5.4e+44)
		tmp = t_2;
	elseif (y <= -4e-43)
		tmp = t_1;
	elseif (y <= 5.6e-69)
		tmp = Float64(x * Float64(t + Float64(z * 2.0)));
	elseif (y <= 4.1e+105)
		tmp = Float64(Float64(y + z) * Float64(x * 2.0));
	elseif (y <= 1.05e+145)
		tmp = t_1;
	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 = y * (5.0 + (x * 2.0));
	tmp = 0.0;
	if (y <= -5.4e+44)
		tmp = t_2;
	elseif (y <= -4e-43)
		tmp = t_1;
	elseif (y <= 5.6e-69)
		tmp = x * (t + (z * 2.0));
	elseif (y <= 4.1e+105)
		tmp = (y + z) * (x * 2.0);
	elseif (y <= 1.05e+145)
		tmp = t_1;
	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[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.4e+44], t$95$2, If[LessEqual[y, -4e-43], t$95$1, If[LessEqual[y, 5.6e-69], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+105], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+145], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.4e44 or 1.04999999999999995e145 < y

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

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

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

    if -5.4e44 < y < -4.00000000000000031e-43 or 4.1000000000000002e105 < y < 1.04999999999999995e145

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

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

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

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

    if -4.00000000000000031e-43 < y < 5.59999999999999959e-69

    1. Initial program 100.0%

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

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

    if 5.59999999999999959e-69 < y < 4.1000000000000002e105

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.4 \cdot 10^{+44}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+105}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+145}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.8% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.25e-68 or 1.12000000000000001e-207 < x < 3.8000000000000002e-145 or 1.12e10 < x

    1. Initial program 100.0%

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

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

    if -2.25e-68 < x < 1.12000000000000001e-207 or 3.8000000000000002e-145 < x < 1.12e10

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-68} \lor \neg \left(x \leq 1.12 \cdot 10^{-207} \lor \neg \left(x \leq 3.8 \cdot 10^{-145}\right) \land x \leq 11200000000\right):\\ \;\;\;\;x \cdot \left(t + \left(z \cdot 2 + y \cdot 2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 62.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq -3 \cdot 10^{+59}:\\
\;\;\;\;z \cdot \left(x \cdot 2\right)\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-28} \lor \neg \left(x \leq 5.5 \cdot 10^{-5}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.19999999999999992e103 or -3e59 < x < -2.90000000000000013e-28 or 5.5000000000000002e-5 < x

    1. Initial program 100.0%

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

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

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

    if -2.19999999999999992e103 < x < -3e59

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
    4. Simplified70.9%

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

    if -2.90000000000000013e-28 < x < 5.5000000000000002e-5

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+103}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -3 \cdot 10^{+59}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-28} \lor \neg \left(x \leq 5.5 \cdot 10^{-5}\right):\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 74.3% accurate, 0.6× 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 -3 \cdot 10^{-31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+107}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+124}:\\ \;\;\;\;t\_1\\ \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 -3e-31)
     t_2
     (if (<= y 9.2e-69)
       t_1
       (if (<= y 2e+107)
         (* (+ y z) (* x 2.0))
         (if (<= y 1.25e+124) t_1 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 <= -3e-31) {
		tmp = t_2;
	} else if (y <= 9.2e-69) {
		tmp = t_1;
	} else if (y <= 2e+107) {
		tmp = (y + z) * (x * 2.0);
	} else if (y <= 1.25e+124) {
		tmp = t_1;
	} 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 <= (-3d-31)) then
        tmp = t_2
    else if (y <= 9.2d-69) then
        tmp = t_1
    else if (y <= 2d+107) then
        tmp = (y + z) * (x * 2.0d0)
    else if (y <= 1.25d+124) then
        tmp = t_1
    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 <= -3e-31) {
		tmp = t_2;
	} else if (y <= 9.2e-69) {
		tmp = t_1;
	} else if (y <= 2e+107) {
		tmp = (y + z) * (x * 2.0);
	} else if (y <= 1.25e+124) {
		tmp = t_1;
	} 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 <= -3e-31:
		tmp = t_2
	elif y <= 9.2e-69:
		tmp = t_1
	elif y <= 2e+107:
		tmp = (y + z) * (x * 2.0)
	elif y <= 1.25e+124:
		tmp = t_1
	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 <= -3e-31)
		tmp = t_2;
	elseif (y <= 9.2e-69)
		tmp = t_1;
	elseif (y <= 2e+107)
		tmp = Float64(Float64(y + z) * Float64(x * 2.0));
	elseif (y <= 1.25e+124)
		tmp = t_1;
	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 <= -3e-31)
		tmp = t_2;
	elseif (y <= 9.2e-69)
		tmp = t_1;
	elseif (y <= 2e+107)
		tmp = (y + z) * (x * 2.0);
	elseif (y <= 1.25e+124)
		tmp = t_1;
	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, -3e-31], t$95$2, If[LessEqual[y, 9.2e-69], t$95$1, If[LessEqual[y, 2e+107], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+124], t$95$1, 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 -3 \cdot 10^{-31}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.99999999999999981e-31 or 1.2499999999999999e124 < y

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

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

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

    if -2.99999999999999981e-31 < y < 9.2000000000000003e-69 or 1.9999999999999999e107 < y < 1.2499999999999999e124

    1. Initial program 100.0%

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

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

    if 9.2000000000000003e-69 < y < 1.9999999999999999e107

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+107}:\\ \;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+124}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 88.2% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \leq 0.00079:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.25e-68 or 7.90000000000000012e-4 < x

    1. Initial program 100.0%

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

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

    if -2.25e-68 < x < 2.1499999999999999e-172

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

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

    if 2.1499999999999999e-172 < x < 7.90000000000000012e-4

    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 t around 0 93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-68}:\\ \;\;\;\;x \cdot \left(t + \left(z \cdot 2 + y \cdot 2\right)\right)\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-172}:\\ \;\;\;\;x \cdot \left(t + \left(y + y\right)\right) + y \cdot 5\\ \mathbf{elif}\;x \leq 0.00079:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(z \cdot 2 + y \cdot 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 88.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 1.8 \cdot 10^{-172}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\

\mathbf{elif}\;x \leq 0.00064:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.25e-68 or 6.40000000000000052e-4 < x

    1. Initial program 100.0%

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

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

    if -2.25e-68 < x < 1.80000000000000007e-172

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

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

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

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

    if 1.80000000000000007e-172 < x < 6.40000000000000052e-4

    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 t around 0 93.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-68}:\\ \;\;\;\;x \cdot \left(t + \left(z \cdot 2 + y \cdot 2\right)\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-172}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 0.00064:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right) + y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + \left(z \cdot 2 + y \cdot 2\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-10} \lor \neg \left(x \leq 1.7 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(t + \left(\left(y + z\right) \cdot 2 + 5 \cdot \frac{y}{x}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.10000000000000015e-10 or 1.70000000000000008e-13 < 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)} \]

    if -3.10000000000000015e-10 < x < 1.70000000000000008e-13

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

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

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

Alternative 15: 99.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.55000000000000002e-9 or 1.12e10 < x

    1. Initial program 100.0%

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

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

    if -1.55000000000000002e-9 < x < 1.12e10

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

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

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

Alternative 16: 95.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.90000000000000013e-28 or 8800 < x

    1. Initial program 100.0%

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

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

    if -2.90000000000000013e-28 < x < 8800

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

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

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

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

Alternative 17: 98.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot \left(5 + x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2e15

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

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

    if 2e15 < 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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.6%

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

Alternative 18: 76.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-31} \lor \neg \left(y \leq 1.16 \cdot 10^{+123}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.59999999999999995e-31 or 1.16e123 < y

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

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

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

    if -2.59999999999999995e-31 < y < 1.16e123

    1. Initial program 100.0%

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

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

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

Alternative 19: 99.8% accurate, 1.0× speedup?

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

\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Derivation
  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. Final simplification99.9%

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

Alternative 20: 47.5% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-76} \lor \neg \left(x \leq 0.00022\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.20000000000000007e-76 or 2.20000000000000008e-4 < x

    1. Initial program 100.0%

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

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

    if -1.20000000000000007e-76 < x < 2.20000000000000008e-4

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

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

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

Alternative 21: 30.5% accurate, 5.0× speedup?

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

\\
y \cdot 5
\end{array}
Derivation
  1. Initial program 99.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 30.9%

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

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

Reproduce

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