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

Percentage Accurate: 99.9% → 99.9%
Time: 12.7s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.1× speedup?

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

\\
\mathsf{fma}\left(x, \left(y + \left(z + z\right)\right) + \left(y + t\right), y \cdot 5\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Step-by-step derivation
    1. fma-def100.0%

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

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

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

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

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

Alternative 2: 99.9% accurate, 0.1× speedup?

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

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

    \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
  2. Step-by-step derivation
    1. fma-def100.0%

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

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

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

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

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

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

Alternative 3: 53.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x \cdot 2\right)\\ t_2 := y \cdot \left(x + 5\right)\\ \mathbf{if}\;y \leq -5 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-122}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{-302}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-217}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-74}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-52}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \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 5.0))))
   (if (<= y -5e+86)
     t_2
     (if (<= y -2.9e-122)
       (* x t)
       (if (<= y 1.08e-302)
         t_1
         (if (<= y 3.8e-217)
           (* x t)
           (if (<= y 6.3e-74)
             t_1
             (if (<= y 8e-52) (* x t) (if (<= y 1.45e-22) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x * 2.0);
	double t_2 = y * (x + 5.0);
	double tmp;
	if (y <= -5e+86) {
		tmp = t_2;
	} else if (y <= -2.9e-122) {
		tmp = x * t;
	} else if (y <= 1.08e-302) {
		tmp = t_1;
	} else if (y <= 3.8e-217) {
		tmp = x * t;
	} else if (y <= 6.3e-74) {
		tmp = t_1;
	} else if (y <= 8e-52) {
		tmp = x * t;
	} else if (y <= 1.45e-22) {
		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 = z * (x * 2.0d0)
    t_2 = y * (x + 5.0d0)
    if (y <= (-5d+86)) then
        tmp = t_2
    else if (y <= (-2.9d-122)) then
        tmp = x * t
    else if (y <= 1.08d-302) then
        tmp = t_1
    else if (y <= 3.8d-217) then
        tmp = x * t
    else if (y <= 6.3d-74) then
        tmp = t_1
    else if (y <= 8d-52) then
        tmp = x * t
    else if (y <= 1.45d-22) 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 = z * (x * 2.0);
	double t_2 = y * (x + 5.0);
	double tmp;
	if (y <= -5e+86) {
		tmp = t_2;
	} else if (y <= -2.9e-122) {
		tmp = x * t;
	} else if (y <= 1.08e-302) {
		tmp = t_1;
	} else if (y <= 3.8e-217) {
		tmp = x * t;
	} else if (y <= 6.3e-74) {
		tmp = t_1;
	} else if (y <= 8e-52) {
		tmp = x * t;
	} else if (y <= 1.45e-22) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x * 2.0)
	t_2 = y * (x + 5.0)
	tmp = 0
	if y <= -5e+86:
		tmp = t_2
	elif y <= -2.9e-122:
		tmp = x * t
	elif y <= 1.08e-302:
		tmp = t_1
	elif y <= 3.8e-217:
		tmp = x * t
	elif y <= 6.3e-74:
		tmp = t_1
	elif y <= 8e-52:
		tmp = x * t
	elif y <= 1.45e-22:
		tmp = t_1
	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 + 5.0))
	tmp = 0.0
	if (y <= -5e+86)
		tmp = t_2;
	elseif (y <= -2.9e-122)
		tmp = Float64(x * t);
	elseif (y <= 1.08e-302)
		tmp = t_1;
	elseif (y <= 3.8e-217)
		tmp = Float64(x * t);
	elseif (y <= 6.3e-74)
		tmp = t_1;
	elseif (y <= 8e-52)
		tmp = Float64(x * t);
	elseif (y <= 1.45e-22)
		tmp = t_1;
	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 + 5.0);
	tmp = 0.0;
	if (y <= -5e+86)
		tmp = t_2;
	elseif (y <= -2.9e-122)
		tmp = x * t;
	elseif (y <= 1.08e-302)
		tmp = t_1;
	elseif (y <= 3.8e-217)
		tmp = x * t;
	elseif (y <= 6.3e-74)
		tmp = t_1;
	elseif (y <= 8e-52)
		tmp = x * t;
	elseif (y <= 1.45e-22)
		tmp = t_1;
	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 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e+86], t$95$2, If[LessEqual[y, -2.9e-122], N[(x * t), $MachinePrecision], If[LessEqual[y, 1.08e-302], t$95$1, If[LessEqual[y, 3.8e-217], N[(x * t), $MachinePrecision], If[LessEqual[y, 6.3e-74], t$95$1, If[LessEqual[y, 8e-52], N[(x * t), $MachinePrecision], If[LessEqual[y, 1.45e-22], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.9 \cdot 10^{-122}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;y \leq 1.08 \cdot 10^{-302}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-217}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;y \leq 6.3 \cdot 10^{-74}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.45 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.9999999999999998e86 or 1.4500000000000001e-22 < 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. Step-by-step derivation
      1. associate-+r+99.9%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(y + \left(z + z\right)\right)} + y\right) + t\right) + y \cdot 5 \]
      2. add-cube-cbrt99.7%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(\sqrt[3]{y + \left(z + z\right)} \cdot \sqrt[3]{y + \left(z + z\right)}\right) \cdot \sqrt[3]{y + \left(z + z\right)}} + y\right) + t\right) + y \cdot 5 \]
      3. pow399.7%

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

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{\left(z + z\right) + y}}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      5. count-299.7%

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{2 \cdot z} + y}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      6. fma-def99.7%

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

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

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

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

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

    if -4.9999999999999998e86 < y < -2.9000000000000002e-122 or 1.07999999999999994e-302 < y < 3.79999999999999987e-217 or 6.30000000000000003e-74 < y < 8.0000000000000001e-52

    1. Initial program 100.0%

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

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

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

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

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

    if -2.9000000000000002e-122 < y < 1.07999999999999994e-302 or 3.79999999999999987e-217 < y < 6.30000000000000003e-74 or 8.0000000000000001e-52 < y < 1.4500000000000001e-22

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \left(x + 5\right)\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-122}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.08 \cdot 10^{-302}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-217}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-74}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-52}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-22}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x + 5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot 5 + x \cdot t\\ t_2 := x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{-76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-252}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;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 (* x (+ t (* 2.0 (+ y z))))))
   (if (<= x -2.1e-76)
     t_2
     (if (<= x -9.5e-169)
       t_1
       (if (<= x 1.3e-252)
         (+ (* y 5.0) (* 2.0 (* x z)))
         (if (<= x 8.5e-162) 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 = x * (t + (2.0 * (y + z)));
	double tmp;
	if (x <= -2.1e-76) {
		tmp = t_2;
	} else if (x <= -9.5e-169) {
		tmp = t_1;
	} else if (x <= 1.3e-252) {
		tmp = (y * 5.0) + (2.0 * (x * z));
	} else if (x <= 8.5e-162) {
		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 = x * (t + (2.0d0 * (y + z)))
    if (x <= (-2.1d-76)) then
        tmp = t_2
    else if (x <= (-9.5d-169)) then
        tmp = t_1
    else if (x <= 1.3d-252) then
        tmp = (y * 5.0d0) + (2.0d0 * (x * z))
    else if (x <= 8.5d-162) 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 = x * (t + (2.0 * (y + z)));
	double tmp;
	if (x <= -2.1e-76) {
		tmp = t_2;
	} else if (x <= -9.5e-169) {
		tmp = t_1;
	} else if (x <= 1.3e-252) {
		tmp = (y * 5.0) + (2.0 * (x * z));
	} else if (x <= 8.5e-162) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y * 5.0) + (x * t)
	t_2 = x * (t + (2.0 * (y + z)))
	tmp = 0
	if x <= -2.1e-76:
		tmp = t_2
	elif x <= -9.5e-169:
		tmp = t_1
	elif x <= 1.3e-252:
		tmp = (y * 5.0) + (2.0 * (x * z))
	elif x <= 8.5e-162:
		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(x * Float64(t + Float64(2.0 * Float64(y + z))))
	tmp = 0.0
	if (x <= -2.1e-76)
		tmp = t_2;
	elseif (x <= -9.5e-169)
		tmp = t_1;
	elseif (x <= 1.3e-252)
		tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z)));
	elseif (x <= 8.5e-162)
		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 = x * (t + (2.0 * (y + z)));
	tmp = 0.0;
	if (x <= -2.1e-76)
		tmp = t_2;
	elseif (x <= -9.5e-169)
		tmp = t_1;
	elseif (x <= 1.3e-252)
		tmp = (y * 5.0) + (2.0 * (x * z));
	elseif (x <= 8.5e-162)
		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[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e-76], t$95$2, If[LessEqual[x, -9.5e-169], t$95$1, If[LessEqual[x, 1.3e-252], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.5e-162], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -9.5 \cdot 10^{-169}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 8.5 \cdot 10^{-162}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.09999999999999992e-76 or 8.49999999999999955e-162 < x

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-def99.9%

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

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

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

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

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

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

    if -2.09999999999999992e-76 < x < -9.5000000000000001e-169 or 1.3e-252 < x < 8.49999999999999955e-162

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

      \[\leadsto \color{blue}{t \cdot x} + y \cdot 5 \]
    4. Simplified85.5%

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

    if -9.5000000000000001e-169 < x < 1.3e-252

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-76}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-169}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-252}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-162}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.7% accurate, 0.6× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.50000000000000023e24 or 1.05e-161 < 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. Step-by-step derivation
      1. fma-def100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000023e24 < x < -2.9000000000000002e-8

    1. Initial program 99.6%

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

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

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

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

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

    if -2.9000000000000002e-8 < x < -1.3499999999999999e-104

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -1.3499999999999999e-104 < x < 1.05e-161

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+24}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-8}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-104}:\\ \;\;\;\;z \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{-161}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(y + z\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{+86} \lor \neg \left(y \leq 1.95 \cdot 10^{-46}\right):\\
\;\;\;\;y \cdot 5 + x \cdot t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.9999999999999998e86 or 1.9500000000000001e-46 < 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 t around 0 94.3%

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

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

    if -4.9999999999999998e86 < y < 1.9500000000000001e-46

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-def100.0%

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

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

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

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

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

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

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

Alternative 7: 98.1% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-def99.9%

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

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

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

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

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

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

    if -3.1e41 < x < 2.5

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

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

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

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

Alternative 8: 98.1% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-def100.0%

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

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

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

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

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

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

    if -3.9999999999999999e99 < x

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

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

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

Alternative 9: 85.9% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.50000000000000021e-86 or 1.79999999999999997e-164 < x

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Step-by-step derivation
      1. fma-def99.9%

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

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

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

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

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

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

    if -3.50000000000000021e-86 < x < 1.79999999999999997e-164

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

      \[\leadsto \color{blue}{t \cdot x} + y \cdot 5 \]
    4. Simplified80.1%

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

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

Alternative 10: 74.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+86} \lor \neg \left(y \leq 2.8 \cdot 10^{+89}\right):\\
\;\;\;\;y \cdot \left(x + 5\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 < -4.9999999999999998e86 or 2.7999999999999998e89 < 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. Step-by-step derivation
      1. associate-+r+99.9%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(y + \left(z + z\right)\right)} + y\right) + t\right) + y \cdot 5 \]
      2. add-cube-cbrt99.7%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(\sqrt[3]{y + \left(z + z\right)} \cdot \sqrt[3]{y + \left(z + z\right)}\right) \cdot \sqrt[3]{y + \left(z + z\right)}} + y\right) + t\right) + y \cdot 5 \]
      3. pow399.7%

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

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{\left(z + z\right) + y}}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      5. count-299.7%

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{2 \cdot z} + y}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      6. fma-def99.7%

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

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

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

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

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

    if -4.9999999999999998e86 < y < 2.7999999999999998e89

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

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

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

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

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

Alternative 11: 77.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+86} \lor \neg \left(y \leq 2.3 \cdot 10^{-19}\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 -5.5e+86) (not (<= y 2.3e-19)))
   (* 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 <= -5.5e+86) || !(y <= 2.3e-19)) {
		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 <= (-5.5d+86)) .or. (.not. (y <= 2.3d-19))) 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 <= -5.5e+86) || !(y <= 2.3e-19)) {
		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 <= -5.5e+86) or not (y <= 2.3e-19):
		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 <= -5.5e+86) || !(y <= 2.3e-19))
		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 <= -5.5e+86) || ~((y <= 2.3e-19)))
		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, -5.5e+86], N[Not[LessEqual[y, 2.3e-19]], $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 -5.5 \cdot 10^{+86} \lor \neg \left(y \leq 2.3 \cdot 10^{-19}\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 < -5.5000000000000002e86 or 2.2999999999999998e-19 < 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 79.8%

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

    if -5.5000000000000002e86 < y < 2.2999999999999998e-19

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+86} \lor \neg \left(y \leq 2.3 \cdot 10^{-19}\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 12: 52.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+86} \lor \neg \left(y \leq 1.38 \cdot 10^{-58}\right):\\
\;\;\;\;y \cdot \left(x + 5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.00000000000000038e86 or 1.37999999999999996e-58 < 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. Step-by-step derivation
      1. associate-+r+99.9%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(y + \left(z + z\right)\right)} + y\right) + t\right) + y \cdot 5 \]
      2. add-cube-cbrt99.6%

        \[\leadsto x \cdot \left(\left(\color{blue}{\left(\sqrt[3]{y + \left(z + z\right)} \cdot \sqrt[3]{y + \left(z + z\right)}\right) \cdot \sqrt[3]{y + \left(z + z\right)}} + y\right) + t\right) + y \cdot 5 \]
      3. pow399.6%

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

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{\left(z + z\right) + y}}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      5. count-299.6%

        \[\leadsto x \cdot \left(\left({\left(\sqrt[3]{\color{blue}{2 \cdot z} + y}\right)}^{3} + y\right) + t\right) + y \cdot 5 \]
      6. fma-def99.6%

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

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

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

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

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

    if -7.00000000000000038e86 < y < 1.37999999999999996e-58

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

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

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

        \[\leadsto \color{blue}{x \cdot t} \]
    6. Simplified43.7%

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

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

Alternative 13: 99.9% accurate, 1.0× speedup?

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

\\
y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

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

Alternative 14: 42.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+86} \lor \neg \left(y \leq 2.1 \cdot 10^{+75}\right):\\
\;\;\;\;y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.0000000000000001e86 or 2.09999999999999999e75 < 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 x around 0 45.7%

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

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

    if -8.0000000000000001e86 < y < 2.09999999999999999e75

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

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

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

        \[\leadsto \color{blue}{x \cdot t} \]
    6. Simplified41.8%

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

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

Alternative 15: 30.4% accurate, 5.0× speedup?

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

\\
x \cdot t
\end{array}
Derivation
  1. Initial program 100.0%

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

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

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

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

    \[\leadsto \color{blue}{x \cdot t} \]
  7. Final simplification30.6%

    \[\leadsto x \cdot t \]
  8. Add Preprocessing

Reproduce

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