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

Percentage Accurate: 99.9% → 99.9%
Time: 7.5s
Alternatives: 16
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 16 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(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. Add Preprocessing
  3. 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-define99.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. flip-+61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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-define99.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. Add Preprocessing
  5. Final simplification99.5%

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

Alternative 3: 99.5% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.4e7 or 9.99999999999999924e-25 < 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-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 99.9%

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

    if -3.4e7 < x < 9.99999999999999924e-25

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 88.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 0.017:\\
\;\;\;\;y \cdot 5 + x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2e-3 or 0.017000000000000001 < 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 -2e-3 < x < -7.5999999999999997e-150

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

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

    if -7.5999999999999997e-150 < x < 0.017000000000000001

    1. Initial program 98.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 t around inf 81.9%

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

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

Alternative 5: 99.1% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. 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 -3.4e7 < x < 2.5

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e-17 or 0.017000000000000001 < 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.2%

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

    if -1.25e-17 < x < 0.017000000000000001

    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-define99.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. Add Preprocessing
    5. Taylor expanded in y around 0 98.4%

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

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

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

Alternative 7: 65.1% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.8e-21 or 1.6e16 < 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.8%

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

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

    if -5.8e-21 < x < 3e-157

    1. Initial program 98.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. +-commutative98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative63.7%

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

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

    if 3e-157 < x < 1.6e16

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 46.8% accurate, 0.7× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+51}:\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1999999999999999e40 or 5.7999999999999997e51 < z

    1. Initial program 98.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. +-commutative98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e40 < z < -5.2e-254

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative52.4%

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

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

    if -5.2e-254 < z < 5.7999999999999997e51

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.0% accurate, 0.7× speedup?

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

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

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


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

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

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

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

    if -5.0000000000000001e85 < x

    1. Initial program 99.4%

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

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

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

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

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

      \[\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 y around 0 97.9%

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

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

Alternative 10: 88.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-17} \lor \neg \left(x \leq 0.017\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.25e-17) (not (<= x 0.017)))
   (* 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.25e-17) || !(x <= 0.017)) {
		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.25d-17)) .or. (.not. (x <= 0.017d0))) 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.25e-17) || !(x <= 0.017)) {
		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.25e-17) or not (x <= 0.017):
		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.25e-17) || !(x <= 0.017))
		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.25e-17) || ~((x <= 0.017)))
		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.25e-17], N[Not[LessEqual[x, 0.017]], $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.25 \cdot 10^{-17} \lor \neg \left(x \leq 0.017\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.25e-17 or 0.017000000000000001 < 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.2%

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

    if -1.25e-17 < x < 0.017000000000000001

    1. Initial program 99.1%

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

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

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

Alternative 11: 77.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.06 \cdot 10^{+61} \lor \neg \left(y \leq 4 \cdot 10^{-58}\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 -1.06e+61) (not (<= y 4e-58)))
   (* 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 <= -1.06e+61) || !(y <= 4e-58)) {
		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 <= (-1.06d+61)) .or. (.not. (y <= 4d-58))) 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 <= -1.06e+61) || !(y <= 4e-58)) {
		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 <= -1.06e+61) or not (y <= 4e-58):
		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 <= -1.06e+61) || !(y <= 4e-58))
		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 <= -1.06e+61) || ~((y <= 4e-58)))
		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, -1.06e+61], N[Not[LessEqual[y, 4e-58]], $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 -1.06 \cdot 10^{+61} \lor \neg \left(y \leq 4 \cdot 10^{-58}\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 < -1.0599999999999999e61 or 4.0000000000000001e-58 < y

    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-define99.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. Add Preprocessing
    5. Taylor expanded in y around inf 83.2%

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

    if -1.0599999999999999e61 < y < 4.0000000000000001e-58

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-17} \lor \neg \left(x \leq 6.2 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1e-17 or 6.20000000000000014e-18 < 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 97.8%

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

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

    if -1.1e-17 < x < 6.20000000000000014e-18

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 46.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-17} \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.25e-17 or 2.5 < x

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. 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 y around inf 47.0%

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

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

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

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

    if -1.25e-17 < x < 2.5

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{5 \cdot y} \]
    6. Step-by-step derivation
      1. *-commutative57.8%

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

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

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

Alternative 14: 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. Add Preprocessing
  3. Final simplification99.5%

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

Alternative 15: 48.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{-17} \lor \neg \left(x \leq 4.5 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.04999999999999996e-17 or 4.50000000000000013e-19 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999996e-17 < x < 4.50000000000000013e-19

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 30.8% 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. Add Preprocessing
  3. 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-define99.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. flip-+61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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