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

Percentage Accurate: 99.9% → 99.9%
Time: 9.0s
Alternatives: 19
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 19 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 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-define99.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) + z\right) + \left(y + t\right)}, y \cdot 5\right) \]
    3. associate-+l+99.9%

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

    \[\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. 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 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-define99.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. Final simplification99.9%

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

Alternative 3: 66.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(t + z \cdot 2\right)\\ \mathbf{if}\;x \leq -8.5 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-49}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-75}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ t (* z 2.0)))))
   (if (<= x -8.5e+175)
     (* x (* 2.0 (+ y z)))
     (if (<= x -8.5e-49)
       t_1
       (if (<= x 1.6e-75)
         (* y 5.0)
         (if (<= x 1.05e+55) t_1 (* x (+ t (* y 2.0)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double tmp;
	if (x <= -8.5e+175) {
		tmp = x * (2.0 * (y + z));
	} else if (x <= -8.5e-49) {
		tmp = t_1;
	} else if (x <= 1.6e-75) {
		tmp = y * 5.0;
	} else if (x <= 1.05e+55) {
		tmp = t_1;
	} else {
		tmp = x * (t + (y * 2.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x * (t + (z * 2.0d0))
    if (x <= (-8.5d+175)) then
        tmp = x * (2.0d0 * (y + z))
    else if (x <= (-8.5d-49)) then
        tmp = t_1
    else if (x <= 1.6d-75) then
        tmp = y * 5.0d0
    else if (x <= 1.05d+55) then
        tmp = t_1
    else
        tmp = x * (t + (y * 2.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (t + (z * 2.0));
	double tmp;
	if (x <= -8.5e+175) {
		tmp = x * (2.0 * (y + z));
	} else if (x <= -8.5e-49) {
		tmp = t_1;
	} else if (x <= 1.6e-75) {
		tmp = y * 5.0;
	} else if (x <= 1.05e+55) {
		tmp = t_1;
	} else {
		tmp = x * (t + (y * 2.0));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (t + (z * 2.0))
	tmp = 0
	if x <= -8.5e+175:
		tmp = x * (2.0 * (y + z))
	elif x <= -8.5e-49:
		tmp = t_1
	elif x <= 1.6e-75:
		tmp = y * 5.0
	elif x <= 1.05e+55:
		tmp = t_1
	else:
		tmp = x * (t + (y * 2.0))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(t + Float64(z * 2.0)))
	tmp = 0.0
	if (x <= -8.5e+175)
		tmp = Float64(x * Float64(2.0 * Float64(y + z)));
	elseif (x <= -8.5e-49)
		tmp = t_1;
	elseif (x <= 1.6e-75)
		tmp = Float64(y * 5.0);
	elseif (x <= 1.05e+55)
		tmp = t_1;
	else
		tmp = Float64(x * Float64(t + Float64(y * 2.0)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (t + (z * 2.0));
	tmp = 0.0;
	if (x <= -8.5e+175)
		tmp = x * (2.0 * (y + z));
	elseif (x <= -8.5e-49)
		tmp = t_1;
	elseif (x <= 1.6e-75)
		tmp = y * 5.0;
	elseif (x <= 1.05e+55)
		tmp = t_1;
	else
		tmp = x * (t + (y * 2.0));
	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, -8.5e+175], N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-49], t$95$1, If[LessEqual[x, 1.6e-75], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.05e+55], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

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


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

    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-define100.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)} \]
    6. Taylor expanded in t around 0 91.0%

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

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

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

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

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

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

    if -8.50000000000000034e175 < x < -8.50000000000000069e-49 or 1.59999999999999988e-75 < x < 1.05e55

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

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

    if -8.50000000000000069e-49 < x < 1.59999999999999988e-75

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

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

    if 1.05e55 < 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-define100.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)} \]
    6. Taylor expanded in z around 0 92.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-75}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+55}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.6% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.65000000000000002e-62 or 4.00000000000000022e-32 < 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-define100.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 + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]

    if -1.65000000000000002e-62 < x < 4.00000000000000022e-32

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

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

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

Alternative 5: 99.6% accurate, 0.6× speedup?

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

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

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

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


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

    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-define100.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 -4.99999999999999976e157 < x < 2.0000000000000001e-27

    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-define99.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 t around 0 99.9%

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

    if 2.0000000000000001e-27 < 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-define100.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 + \left(2 \cdot \left(y + z\right) + 5 \cdot \frac{y}{x}\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.9%

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

Alternative 6: 60.2% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;x \leq 7.8 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.8000000000000004e-37 or 1.44999999999999992e-92 < x < 7.8000000000000002e49

    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-define99.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 90.7%

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

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

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

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

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

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

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

    if -3.8000000000000004e-37 < x < 1.44999999999999992e-92

    1. Initial program 99.9%

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

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

    if 7.8000000000000002e49 < x

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-37}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-92}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;x \leq 7.8 \cdot 10^{+49}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y + t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 99.3% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.5 or 0.00104999999999999994 < 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-define100.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 99.1%

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

    if -2.5 < x < 0.00104999999999999994

    1. Initial program 99.9%

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

      \[\leadsto x \cdot \left(\color{blue}{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 -2.5 \lor \neg \left(x \leq 0.00105\right):\\ \;\;\;\;x \cdot \left(t + 2 \cdot \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right) + y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 46.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq -5.2 \cdot 10^{-38}:\\
\;\;\;\;y \cdot 5\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{+54}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.85e50 or 1.6e54 < z

    1. Initial program 99.9%

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

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

    if -1.85e50 < z < -5.20000000000000022e-38

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

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

    if -5.20000000000000022e-38 < z < 1.6e54

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{t \cdot x} \]
    4. Simplified45.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+50}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;z \leq -5.2 \cdot 10^{-38}:\\ \;\;\;\;y \cdot 5\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+54}:\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.0% accurate, 0.8× speedup?

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

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

    if -1.14999999999999999e-14 < x < 3.00000000000000003e-28

    1. Initial program 99.8%

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

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

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

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

Alternative 10: 88.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-37} \lor \neg \left(x \leq 9.2 \cdot 10^{-94}\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 -2.1e-37) (not (<= x 9.2e-94)))
   (* 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 <= -2.1e-37) || !(x <= 9.2e-94)) {
		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 <= (-2.1d-37)) .or. (.not. (x <= 9.2d-94))) 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 <= -2.1e-37) || !(x <= 9.2e-94)) {
		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 <= -2.1e-37) or not (x <= 9.2e-94):
		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 <= -2.1e-37) || !(x <= 9.2e-94))
		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 <= -2.1e-37) || ~((x <= 9.2e-94)))
		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, -2.1e-37], N[Not[LessEqual[x, 9.2e-94]], $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 -2.1 \cdot 10^{-37} \lor \neg \left(x \leq 9.2 \cdot 10^{-94}\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 < -2.1000000000000001e-37 or 9.1999999999999997e-94 < 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-define100.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 93.8%

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

    if -2.1000000000000001e-37 < x < 9.1999999999999997e-94

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-37} \lor \neg \left(x \leq 9.2 \cdot 10^{-94}\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 11: 47.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+174}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \leq -1 \cdot 10^{-47} \lor \neg \left(x \leq 1.35 \cdot 10^{-24}\right):\\
\;\;\;\;x \cdot t\\

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


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

    1. Initial program 100.0%

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

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

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

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

    if -2.6999999999999999e174 < x < -9.9999999999999997e-48 or 1.35000000000000003e-24 < x

    1. Initial program 100.0%

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

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

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

    if -9.9999999999999997e-48 < x < 1.35000000000000003e-24

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.7 \cdot 10^{+174}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-47} \lor \neg \left(x \leq 1.35 \cdot 10^{-24}\right):\\ \;\;\;\;x \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot 5\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 78.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+17} \lor \neg \left(y \leq 5.8 \cdot 10^{-8}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.2e17 or 5.8000000000000003e-8 < 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 77.6%

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

    if -2.2e17 < y < 5.8000000000000003e-8

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+17} \lor \neg \left(y \leq 5.8 \cdot 10^{-8}\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 13: 63.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.1e-36

    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-define100.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 96.9%

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

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

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

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

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

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

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

    if -1.1e-36 < x < 2.19999999999999996e-28

    1. Initial program 99.8%

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

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

    if 2.19999999999999996e-28 < 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-define100.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 98.4%

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

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

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

Alternative 14: 57.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-15} \lor \neg \left(x \leq 2.1 \cdot 10^{-23}\right):\\
\;\;\;\;x \cdot \left(y + t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.4999999999999996e-15 or 2.1000000000000001e-23 < x

    1. Initial program 100.0%

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

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

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

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

    if -7.4999999999999996e-15 < x < 2.1000000000000001e-23

    1. Initial program 99.8%

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

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

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

Alternative 15: 57.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \left(z + t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.59999999999999991e-47

    1. Initial program 100.0%

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

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

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

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

    if -3.59999999999999991e-47 < x < 1.6000000000000001e-26

    1. Initial program 99.8%

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

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

    if 1.6000000000000001e-26 < x

    1. Initial program 100.0%

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

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

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

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

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

Alternative 16: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 17: 96.6% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 18: 47.8% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-48} \lor \neg \left(x \leq 7.5 \cdot 10^{-28}\right):\\
\;\;\;\;x \cdot t\\

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


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

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{t \cdot x} \]
    4. Simplified39.3%

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

    if -4.9999999999999999e-48 < x < 7.5000000000000003e-28

    1. Initial program 99.8%

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

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

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

Alternative 19: 29.7% accurate, 5.0× speedup?

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

\\
y \cdot 5
\end{array}
Derivation
  1. Initial program 99.9%

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

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

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

Reproduce

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