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

Percentage Accurate: 99.9% → 100.0%
Time: 7.1s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

      \[\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. distribute-rgt-in96.9%

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

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

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

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

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

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

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

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

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

Alternative 2: 99.9% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 3: 75.6% accurate, 0.7× 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 -1.15 \cdot 10^{+129}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{+89}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-17}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+188}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+202}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
   (if (<= y -1.15e+129)
     t_2
     (if (<= y -2.45e+89)
       t_1
       (if (<= y -1.22e-17)
         t_2
         (if (<= y 6e+104)
           t_1
           (if (<= y 6.5e+178)
             t_2
             (if (<= y 1.85e+188)
               (* 2.0 (* x (+ y z)))
               (if (<= y 2.8e+202) (* x (+ t (* y 2.0))) t_2)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -1.15e+129) {
		tmp = t_2;
	} else if (y <= -2.45e+89) {
		tmp = t_1;
	} else if (y <= -1.22e-17) {
		tmp = t_2;
	} else if (y <= 6e+104) {
		tmp = t_1;
	} else if (y <= 6.5e+178) {
		tmp = t_2;
	} else if (y <= 1.85e+188) {
		tmp = 2.0 * (x * (y + z));
	} else if (y <= 2.8e+202) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (t + (z * 2.0d0))
    t_2 = y * (5.0d0 + (x * 2.0d0))
    if (y <= (-1.15d+129)) then
        tmp = t_2
    else if (y <= (-2.45d+89)) then
        tmp = t_1
    else if (y <= (-1.22d-17)) then
        tmp = t_2
    else if (y <= 6d+104) then
        tmp = t_1
    else if (y <= 6.5d+178) then
        tmp = t_2
    else if (y <= 1.85d+188) then
        tmp = 2.0d0 * (x * (y + z))
    else if (y <= 2.8d+202) then
        tmp = x * (t + (y * 2.0d0))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double t_2 = y * (5.0 + (x * 2.0));
	double tmp;
	if (y <= -1.15e+129) {
		tmp = t_2;
	} else if (y <= -2.45e+89) {
		tmp = t_1;
	} else if (y <= -1.22e-17) {
		tmp = t_2;
	} else if (y <= 6e+104) {
		tmp = t_1;
	} else if (y <= 6.5e+178) {
		tmp = t_2;
	} else if (y <= 1.85e+188) {
		tmp = 2.0 * (x * (y + z));
	} else if (y <= 2.8e+202) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	t_2 = y * (5.0 + (x * 2.0))
	tmp = 0
	if y <= -1.15e+129:
		tmp = t_2
	elif y <= -2.45e+89:
		tmp = t_1
	elif y <= -1.22e-17:
		tmp = t_2
	elif y <= 6e+104:
		tmp = t_1
	elif y <= 6.5e+178:
		tmp = t_2
	elif y <= 1.85e+188:
		tmp = 2.0 * (x * (y + z))
	elif y <= 2.8e+202:
		tmp = x * (t + (y * 2.0))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(z * 2.0)))
	t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0)))
	tmp = 0.0
	if (y <= -1.15e+129)
		tmp = t_2;
	elseif (y <= -2.45e+89)
		tmp = t_1;
	elseif (y <= -1.22e-17)
		tmp = t_2;
	elseif (y <= 6e+104)
		tmp = t_1;
	elseif (y <= 6.5e+178)
		tmp = t_2;
	elseif (y <= 1.85e+188)
		tmp = Float64(2.0 * Float64(x * Float64(y + z)));
	elseif (y <= 2.8e+202)
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (z * 2.0));
	t_2 = y * (5.0 + (x * 2.0));
	tmp = 0.0;
	if (y <= -1.15e+129)
		tmp = t_2;
	elseif (y <= -2.45e+89)
		tmp = t_1;
	elseif (y <= -1.22e-17)
		tmp = t_2;
	elseif (y <= 6e+104)
		tmp = t_1;
	elseif (y <= 6.5e+178)
		tmp = t_2;
	elseif (y <= 1.85e+188)
		tmp = 2.0 * (x * (y + z));
	elseif (y <= 2.8e+202)
		tmp = x * (t + (y * 2.0));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.15e+129], t$95$2, If[LessEqual[y, -2.45e+89], t$95$1, If[LessEqual[y, -1.22e-17], t$95$2, If[LessEqual[y, 6e+104], t$95$1, If[LessEqual[y, 6.5e+178], t$95$2, If[LessEqual[y, 1.85e+188], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+202], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.45 \cdot 10^{+89}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -1.22 \cdot 10^{-17}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+104}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{+178}:\\
\;\;\;\;t_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.14999999999999995e129 or -2.44999999999999998e89 < y < -1.22e-17 or 5.99999999999999937e104 < y < 6.5000000000000005e178 or 2.80000000000000016e202 < y

    1. Initial program 98.7%

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

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

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

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

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

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

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

    if -1.14999999999999995e129 < y < -2.44999999999999998e89 or -1.22e-17 < y < 5.99999999999999937e104

    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-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. Taylor expanded in x around inf 83.5%

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

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

    if 6.5000000000000005e178 < y < 1.85e188

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

    if 1.85e188 < y < 2.80000000000000016e202

    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. Taylor expanded in x around inf 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.15 \cdot 10^{+129}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq -2.45 \cdot 10^{+89}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq -1.22 \cdot 10^{-17}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+104}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+178}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+188}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{+202}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \end{array} \]

Alternative 4: 47.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot x\right)\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{+199}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -9 \cdot 10^{+156}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{+46}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-45}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+229}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (* y x))))
   (if (<= x -6.2e+199)
     (* x t)
     (if (<= x -9e+156)
       t_1
       (if (<= x -1.12e+46)
         (* x t)
         (if (<= x -1.9e+14)
           t_1
           (if (<= x -2.45e-45)
             (* x t)
             (if (<= x 1.9e-9)
               (* y 5.0)
               (if (<= x 1.65e+229) (* x t) t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (y * x);
	double tmp;
	if (x <= -6.2e+199) {
		tmp = x * t;
	} else if (x <= -9e+156) {
		tmp = t_1;
	} else if (x <= -1.12e+46) {
		tmp = x * t;
	} else if (x <= -1.9e+14) {
		tmp = t_1;
	} else if (x <= -2.45e-45) {
		tmp = x * t;
	} else if (x <= 1.9e-9) {
		tmp = y * 5.0;
	} else if (x <= 1.65e+229) {
		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 = 2.0d0 * (y * x)
    if (x <= (-6.2d+199)) then
        tmp = x * t
    else if (x <= (-9d+156)) then
        tmp = t_1
    else if (x <= (-1.12d+46)) then
        tmp = x * t
    else if (x <= (-1.9d+14)) then
        tmp = t_1
    else if (x <= (-2.45d-45)) then
        tmp = x * t
    else if (x <= 1.9d-9) then
        tmp = y * 5.0d0
    else if (x <= 1.65d+229) 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 = 2.0 * (y * x);
	double tmp;
	if (x <= -6.2e+199) {
		tmp = x * t;
	} else if (x <= -9e+156) {
		tmp = t_1;
	} else if (x <= -1.12e+46) {
		tmp = x * t;
	} else if (x <= -1.9e+14) {
		tmp = t_1;
	} else if (x <= -2.45e-45) {
		tmp = x * t;
	} else if (x <= 1.9e-9) {
		tmp = y * 5.0;
	} else if (x <= 1.65e+229) {
		tmp = x * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * (y * x)
	tmp = 0
	if x <= -6.2e+199:
		tmp = x * t
	elif x <= -9e+156:
		tmp = t_1
	elif x <= -1.12e+46:
		tmp = x * t
	elif x <= -1.9e+14:
		tmp = t_1
	elif x <= -2.45e-45:
		tmp = x * t
	elif x <= 1.9e-9:
		tmp = y * 5.0
	elif x <= 1.65e+229:
		tmp = x * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(y * x))
	tmp = 0.0
	if (x <= -6.2e+199)
		tmp = Float64(x * t);
	elseif (x <= -9e+156)
		tmp = t_1;
	elseif (x <= -1.12e+46)
		tmp = Float64(x * t);
	elseif (x <= -1.9e+14)
		tmp = t_1;
	elseif (x <= -2.45e-45)
		tmp = Float64(x * t);
	elseif (x <= 1.9e-9)
		tmp = Float64(y * 5.0);
	elseif (x <= 1.65e+229)
		tmp = Float64(x * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * (y * x);
	tmp = 0.0;
	if (x <= -6.2e+199)
		tmp = x * t;
	elseif (x <= -9e+156)
		tmp = t_1;
	elseif (x <= -1.12e+46)
		tmp = x * t;
	elseif (x <= -1.9e+14)
		tmp = t_1;
	elseif (x <= -2.45e-45)
		tmp = x * t;
	elseif (x <= 1.9e-9)
		tmp = y * 5.0;
	elseif (x <= 1.65e+229)
		tmp = x * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e+199], N[(x * t), $MachinePrecision], If[LessEqual[x, -9e+156], t$95$1, If[LessEqual[x, -1.12e+46], N[(x * t), $MachinePrecision], If[LessEqual[x, -1.9e+14], t$95$1, If[LessEqual[x, -2.45e-45], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.9e-9], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.65e+229], N[(x * t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -9 \cdot 10^{+156}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -1.12 \cdot 10^{+46}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq -1.9 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -2.45 \cdot 10^{-45}:\\
\;\;\;\;x \cdot t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.19999999999999971e199 or -9.00000000000000061e156 < x < -1.12e46 or -1.9e14 < x < -2.4499999999999999e-45 or 1.90000000000000006e-9 < x < 1.65e229

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot t} \]
    7. Simplified47.3%

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

    if -6.19999999999999971e199 < x < -9.00000000000000061e156 or -1.12e46 < x < -1.9e14 or 1.65e229 < 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. Taylor expanded in x around inf 100.0%

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

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

    if -2.4499999999999999e-45 < x < 1.90000000000000006e-9

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+199}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -9 \cdot 10^{+156}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{+46}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+14}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-45}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+229}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \end{array} \]

Alternative 5: 60.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{+259}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-97}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{+180} \lor \neg \left(x \leq 4.3 \cdot 10^{+256}\right):\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* y 2.0)))))
   (if (<= x -1.1e+259)
     (* x (* z 2.0))
     (if (<= x -2.45e-42)
       t_1
       (if (<= x 4.2e-97)
         (* y 5.0)
         (if (or (<= x 5.4e+180) (not (<= x 4.3e+256)))
           (* 2.0 (* x (+ y z)))
           t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1.1e+259) {
		tmp = x * (z * 2.0);
	} else if (x <= -2.45e-42) {
		tmp = t_1;
	} else if (x <= 4.2e-97) {
		tmp = y * 5.0;
	} else if ((x <= 5.4e+180) || !(x <= 4.3e+256)) {
		tmp = 2.0 * (x * (y + z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t + (y * 2.0d0))
    if (x <= (-1.1d+259)) then
        tmp = x * (z * 2.0d0)
    else if (x <= (-2.45d-42)) then
        tmp = t_1
    else if (x <= 4.2d-97) then
        tmp = y * 5.0d0
    else if ((x <= 5.4d+180) .or. (.not. (x <= 4.3d+256))) then
        tmp = 2.0d0 * (x * (y + z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1.1e+259) {
		tmp = x * (z * 2.0);
	} else if (x <= -2.45e-42) {
		tmp = t_1;
	} else if (x <= 4.2e-97) {
		tmp = y * 5.0;
	} else if ((x <= 5.4e+180) || !(x <= 4.3e+256)) {
		tmp = 2.0 * (x * (y + z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -1.1e+259:
		tmp = x * (z * 2.0)
	elif x <= -2.45e-42:
		tmp = t_1
	elif x <= 4.2e-97:
		tmp = y * 5.0
	elif (x <= 5.4e+180) or not (x <= 4.3e+256):
		tmp = 2.0 * (x * (y + z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -1.1e+259)
		tmp = Float64(x * Float64(z * 2.0));
	elseif (x <= -2.45e-42)
		tmp = t_1;
	elseif (x <= 4.2e-97)
		tmp = Float64(y * 5.0);
	elseif ((x <= 5.4e+180) || !(x <= 4.3e+256))
		tmp = Float64(2.0 * Float64(x * Float64(y + z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -1.1e+259)
		tmp = x * (z * 2.0);
	elseif (x <= -2.45e-42)
		tmp = t_1;
	elseif (x <= 4.2e-97)
		tmp = y * 5.0;
	elseif ((x <= 5.4e+180) || ~((x <= 4.3e+256)))
		tmp = 2.0 * (x * (y + z));
	else
		tmp = t_1;
	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, -1.1e+259], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.45e-42], t$95$1, If[LessEqual[x, 4.2e-97], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 5.4e+180], N[Not[LessEqual[x, 4.3e+256]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.45 \cdot 10^{-42}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 5.4 \cdot 10^{+180} \lor \neg \left(x \leq 4.3 \cdot 10^{+256}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.09999999999999996e259

    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. Taylor expanded in x around inf 100.0%

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

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

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

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

    if -1.09999999999999996e259 < x < -2.45e-42 or 5.40000000000000033e180 < x < 4.29999999999999993e256

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

    if -2.45e-42 < x < 4.2000000000000002e-97

    1. Initial program 99.8%

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

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

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

    if 4.2000000000000002e-97 < x < 5.40000000000000033e180 or 4.29999999999999993e256 < 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. Taylor expanded in x around inf 91.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+259}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.45 \cdot 10^{-42}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-97}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{+180} \lor \neg \left(x \leq 4.3 \cdot 10^{+256}\right):\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]

Alternative 6: 60.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + y \cdot 2\right)\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{+259}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.08 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-96}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+259}\right):\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* y 2.0)))))
   (if (<= x -1.1e+259)
     (* x (* z 2.0))
     (if (<= x -1.08e-43)
       t_1
       (if (<= x 3.3e-96)
         (* y (+ 5.0 (* x 2.0)))
         (if (or (<= x 1.7e+181) (not (<= x 4.5e+259)))
           (* 2.0 (* x (+ y z)))
           t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1.1e+259) {
		tmp = x * (z * 2.0);
	} else if (x <= -1.08e-43) {
		tmp = t_1;
	} else if (x <= 3.3e-96) {
		tmp = y * (5.0 + (x * 2.0));
	} else if ((x <= 1.7e+181) || !(x <= 4.5e+259)) {
		tmp = 2.0 * (x * (y + z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t + (y * 2.0d0))
    if (x <= (-1.1d+259)) then
        tmp = x * (z * 2.0d0)
    else if (x <= (-1.08d-43)) then
        tmp = t_1
    else if (x <= 3.3d-96) then
        tmp = y * (5.0d0 + (x * 2.0d0))
    else if ((x <= 1.7d+181) .or. (.not. (x <= 4.5d+259))) then
        tmp = 2.0d0 * (x * (y + z))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (y * 2.0));
	double tmp;
	if (x <= -1.1e+259) {
		tmp = x * (z * 2.0);
	} else if (x <= -1.08e-43) {
		tmp = t_1;
	} else if (x <= 3.3e-96) {
		tmp = y * (5.0 + (x * 2.0));
	} else if ((x <= 1.7e+181) || !(x <= 4.5e+259)) {
		tmp = 2.0 * (x * (y + z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (y * 2.0))
	tmp = 0
	if x <= -1.1e+259:
		tmp = x * (z * 2.0)
	elif x <= -1.08e-43:
		tmp = t_1
	elif x <= 3.3e-96:
		tmp = y * (5.0 + (x * 2.0))
	elif (x <= 1.7e+181) or not (x <= 4.5e+259):
		tmp = 2.0 * (x * (y + z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(y * 2.0)))
	tmp = 0.0
	if (x <= -1.1e+259)
		tmp = Float64(x * Float64(z * 2.0));
	elseif (x <= -1.08e-43)
		tmp = t_1;
	elseif (x <= 3.3e-96)
		tmp = Float64(y * Float64(5.0 + Float64(x * 2.0)));
	elseif ((x <= 1.7e+181) || !(x <= 4.5e+259))
		tmp = Float64(2.0 * Float64(x * Float64(y + z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (y * 2.0));
	tmp = 0.0;
	if (x <= -1.1e+259)
		tmp = x * (z * 2.0);
	elseif (x <= -1.08e-43)
		tmp = t_1;
	elseif (x <= 3.3e-96)
		tmp = y * (5.0 + (x * 2.0));
	elseif ((x <= 1.7e+181) || ~((x <= 4.5e+259)))
		tmp = 2.0 * (x * (y + z));
	else
		tmp = t_1;
	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, -1.1e+259], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.08e-43], t$95$1, If[LessEqual[x, 3.3e-96], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.7e+181], N[Not[LessEqual[x, 4.5e+259]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.08 \cdot 10^{-43}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 1.7 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+259}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.09999999999999996e259

    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. Taylor expanded in x around inf 100.0%

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

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

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

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

    if -1.09999999999999996e259 < x < -1.08e-43 or 1.70000000000000015e181 < x < 4.4999999999999997e259

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

    if -1.08e-43 < x < 3.2999999999999999e-96

    1. Initial program 99.8%

      \[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. Taylor expanded in y around inf 63.5%

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

    if 3.2999999999999999e-96 < x < 1.70000000000000015e181 or 4.4999999999999997e259 < 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. Taylor expanded in x around inf 91.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+259}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -1.08 \cdot 10^{-43}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-96}:\\ \;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+181} \lor \neg \left(x \leq 4.5 \cdot 10^{+259}\right):\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]

Alternative 7: 72.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + z \cdot 2\right)\\ \mathbf{if}\;x \leq -2.6 \cdot 10^{+207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4 \cdot 10^{+162}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{+45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -3500000000000:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* z 2.0)))))
   (if (<= x -2.6e+207)
     t_1
     (if (<= x -4e+162)
       (* x (+ t (* y 2.0)))
       (if (<= x -2.65e+45)
         t_1
         (if (<= x -3500000000000.0)
           (* 2.0 (* x (+ y z)))
           (if (<= x 5.8e-95) (+ (* y 5.0) (* x t)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double tmp;
	if (x <= -2.6e+207) {
		tmp = t_1;
	} else if (x <= -4e+162) {
		tmp = x * (t + (y * 2.0));
	} else if (x <= -2.65e+45) {
		tmp = t_1;
	} else if (x <= -3500000000000.0) {
		tmp = 2.0 * (x * (y + z));
	} else if (x <= 5.8e-95) {
		tmp = (y * 5.0) + (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 = x * (t + (z * 2.0d0))
    if (x <= (-2.6d+207)) then
        tmp = t_1
    else if (x <= (-4d+162)) then
        tmp = x * (t + (y * 2.0d0))
    else if (x <= (-2.65d+45)) then
        tmp = t_1
    else if (x <= (-3500000000000.0d0)) then
        tmp = 2.0d0 * (x * (y + z))
    else if (x <= 5.8d-95) then
        tmp = (y * 5.0d0) + (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 = x * (t + (z * 2.0));
	double tmp;
	if (x <= -2.6e+207) {
		tmp = t_1;
	} else if (x <= -4e+162) {
		tmp = x * (t + (y * 2.0));
	} else if (x <= -2.65e+45) {
		tmp = t_1;
	} else if (x <= -3500000000000.0) {
		tmp = 2.0 * (x * (y + z));
	} else if (x <= 5.8e-95) {
		tmp = (y * 5.0) + (x * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	tmp = 0
	if x <= -2.6e+207:
		tmp = t_1
	elif x <= -4e+162:
		tmp = x * (t + (y * 2.0))
	elif x <= -2.65e+45:
		tmp = t_1
	elif x <= -3500000000000.0:
		tmp = 2.0 * (x * (y + z))
	elif x <= 5.8e-95:
		tmp = (y * 5.0) + (x * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(z * 2.0)))
	tmp = 0.0
	if (x <= -2.6e+207)
		tmp = t_1;
	elseif (x <= -4e+162)
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	elseif (x <= -2.65e+45)
		tmp = t_1;
	elseif (x <= -3500000000000.0)
		tmp = Float64(2.0 * Float64(x * Float64(y + z)));
	elseif (x <= 5.8e-95)
		tmp = Float64(Float64(y * 5.0) + Float64(x * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (z * 2.0));
	tmp = 0.0;
	if (x <= -2.6e+207)
		tmp = t_1;
	elseif (x <= -4e+162)
		tmp = x * (t + (y * 2.0));
	elseif (x <= -2.65e+45)
		tmp = t_1;
	elseif (x <= -3500000000000.0)
		tmp = 2.0 * (x * (y + z));
	elseif (x <= 5.8e-95)
		tmp = (y * 5.0) + (x * t);
	else
		tmp = t_1;
	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]}, If[LessEqual[x, -2.6e+207], t$95$1, If[LessEqual[x, -4e+162], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.65e+45], t$95$1, If[LessEqual[x, -3500000000000.0], N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-95], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -2.65 \cdot 10^{+45}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.5999999999999998e207 or -3.9999999999999998e162 < x < -2.64999999999999996e45 or 5.80000000000000004e-95 < 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. Taylor expanded in x around inf 95.6%

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

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

    if -2.5999999999999998e207 < x < -3.9999999999999998e162

    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. Taylor expanded in x around inf 100.0%

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

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

    if -2.64999999999999996e45 < x < -3.5e12

    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. Taylor expanded in x around inf 100.0%

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

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

    if -3.5e12 < x < 5.80000000000000004e-95

    1. Initial program 98.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+207}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq -4 \cdot 10^{+162}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{+45}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq -3500000000000:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]

Alternative 8: 46.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -7.4 \cdot 10^{+46}:\\
\;\;\;\;x \cdot t\\

\mathbf{elif}\;x \leq -4.5 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\

\mathbf{elif}\;x \leq -7.3 \cdot 10^{-40}:\\
\;\;\;\;x \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -8.5999999999999996e257 or 5.80000000000000004e-95 < 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. Taylor expanded in x around inf 94.3%

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

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

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

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

    if -8.5999999999999996e257 < x < -7.3999999999999998e46 or -4.5e14 < x < -7.30000000000000005e-40

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot t} \]
    7. Simplified53.4%

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

    if -7.3999999999999998e46 < x < -4.5e14

    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. Taylor expanded in x around inf 100.0%

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

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

    if -7.30000000000000005e-40 < x < 5.80000000000000004e-95

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.6 \cdot 10^{+257}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;x \leq -7.4 \cdot 10^{+46}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{+14}:\\ \;\;\;\;2 \cdot \left(y \cdot x\right)\\ \mathbf{elif}\;x \leq -7.3 \cdot 10^{-40}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z \cdot 2\right)\\ \end{array} \]

Alternative 9: 58.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{if}\;t \leq -4.8 \cdot 10^{+141}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -4.1 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -7.8 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+69}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* 2.0 (* x (+ y z)))))
   (if (<= t -4.8e+141)
     (* x t)
     (if (<= t -4.1e-22)
       t_1
       (if (<= t -7.8e-43) (* y 5.0) (if (<= t 6.2e+69) t_1 (* x t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * (y + z));
	double tmp;
	if (t <= -4.8e+141) {
		tmp = x * t;
	} else if (t <= -4.1e-22) {
		tmp = t_1;
	} else if (t <= -7.8e-43) {
		tmp = y * 5.0;
	} else if (t <= 6.2e+69) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (x * (y + z))
    if (t <= (-4.8d+141)) then
        tmp = x * t
    else if (t <= (-4.1d-22)) then
        tmp = t_1
    else if (t <= (-7.8d-43)) then
        tmp = y * 5.0d0
    else if (t <= 6.2d+69) then
        tmp = t_1
    else
        tmp = x * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = 2.0 * (x * (y + z));
	double tmp;
	if (t <= -4.8e+141) {
		tmp = x * t;
	} else if (t <= -4.1e-22) {
		tmp = t_1;
	} else if (t <= -7.8e-43) {
		tmp = y * 5.0;
	} else if (t <= 6.2e+69) {
		tmp = t_1;
	} else {
		tmp = x * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = 2.0 * (x * (y + z))
	tmp = 0
	if t <= -4.8e+141:
		tmp = x * t
	elif t <= -4.1e-22:
		tmp = t_1
	elif t <= -7.8e-43:
		tmp = y * 5.0
	elif t <= 6.2e+69:
		tmp = t_1
	else:
		tmp = x * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(2.0 * Float64(x * Float64(y + z)))
	tmp = 0.0
	if (t <= -4.8e+141)
		tmp = Float64(x * t);
	elseif (t <= -4.1e-22)
		tmp = t_1;
	elseif (t <= -7.8e-43)
		tmp = Float64(y * 5.0);
	elseif (t <= 6.2e+69)
		tmp = t_1;
	else
		tmp = Float64(x * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = 2.0 * (x * (y + z));
	tmp = 0.0;
	if (t <= -4.8e+141)
		tmp = x * t;
	elseif (t <= -4.1e-22)
		tmp = t_1;
	elseif (t <= -7.8e-43)
		tmp = y * 5.0;
	elseif (t <= 6.2e+69)
		tmp = t_1;
	else
		tmp = x * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.8e+141], N[(x * t), $MachinePrecision], If[LessEqual[t, -4.1e-22], t$95$1, If[LessEqual[t, -7.8e-43], N[(y * 5.0), $MachinePrecision], If[LessEqual[t, 6.2e+69], t$95$1, N[(x * t), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -4.1 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+69}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.79999999999999995e141 or 6.1999999999999997e69 < t

    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. Taylor expanded in x around inf 81.9%

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

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

        \[\leadsto \color{blue}{x \cdot t} \]
    7. Simplified67.1%

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

    if -4.79999999999999995e141 < t < -4.0999999999999999e-22 or -7.80000000000000001e-43 < t < 6.1999999999999997e69

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

    if -4.0999999999999999e-22 < t < -7.80000000000000001e-43

    1. Initial program 99.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{+141}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;t \leq -4.1 \cdot 10^{-22}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;t \leq -7.8 \cdot 10^{-43}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+69}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]

Alternative 10: 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 99.5%

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

    \[\leadsto y \cdot 5 + x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) \]

Alternative 11: 88.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \cdot 10^{-31} \lor \neg \left(x \leq 3.4 \cdot 10^{-98}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.52000000000000003e-31 or 3.4000000000000001e-98 < x

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if -1.52000000000000003e-31 < x < 3.4000000000000001e-98

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.52 \cdot 10^{-31} \lor \neg \left(x \leq 3.4 \cdot 10^{-98}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + x \cdot t\\ \end{array} \]

Alternative 12: 88.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-45} \lor \neg \left(x \leq 9.5 \cdot 10^{-12}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.79999999999999997e-45 or 9.4999999999999995e-12 < x

    1. Initial program 99.3%

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

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

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

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

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

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

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

    if -3.79999999999999997e-45 < x < 9.4999999999999995e-12

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-45} \lor \neg \left(x \leq 9.5 \cdot 10^{-12}\right):\\ \;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\ \end{array} \]

Alternative 13: 46.9% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.36 \cdot 10^{-43} \lor \neg \left(x \leq 5.6 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.36000000000000007e-43 or 5.6e-11 < x

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

    if -1.36000000000000007e-43 < x < 5.6e-11

    1. Initial program 99.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.36 \cdot 10^{-43} \lor \neg \left(x \leq 5.6 \cdot 10^{-11}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]

Alternative 14: 29.9% 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 99.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot t} \]
  7. Simplified31.4%

    \[\leadsto \color{blue}{x \cdot t} \]
  8. Final simplification31.4%

    \[\leadsto x \cdot t \]

Reproduce

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