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

Percentage Accurate: 99.8% → 99.9%
Time: 7.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, 5, x \cdot \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.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.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/59.8%

      \[\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-def62.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+62.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. +-commutative62.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-262.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+62.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. +-commutative62.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-262.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-def59.8%

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

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

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

      \[\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. Add Preprocessing

Alternative 2: 99.8% 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.9%

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

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

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

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

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

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

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

Alternative 3: 99.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-16} \lor \neg \left(x \leq 7 \cdot 10^{-16}\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 \left(z \cdot 2\right) + x \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.50000000000000017e-16 or 7.00000000000000035e-16 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -3.50000000000000017e-16 < x < 7.00000000000000035e-16

    1. Initial program 99.9%

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

      \[\leadsto x \cdot \left(\color{blue}{2 \cdot z} + t\right) + y \cdot 5 \]
    4. Step-by-step derivation
      1. distribute-rgt-in99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{-16} \lor \neg \left(x \leq 7 \cdot 10^{-16}\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 \left(z \cdot 2\right) + x \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \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 \left(z \cdot 2\right) + x \cdot t\right)\\


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

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

    if -2.5 < x < 2.5

    1. Initial program 99.9%

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

      \[\leadsto x \cdot \left(\color{blue}{2 \cdot z} + t\right) + y \cdot 5 \]
    4. Step-by-step derivation
      1. distribute-rgt-in99.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \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 \left(z \cdot 2\right) + x \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 63.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -1.45 \cdot 10^{+53} \lor \neg \left(y \leq 6 \cdot 10^{+39}\right):\\
\;\;\;\;y \cdot 5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.09999999999999992e261

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -1.09999999999999992e261 < y < -1.4500000000000001e53 or 5.9999999999999999e39 < y

    1. Initial program 99.9%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. +-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-+46.2%

        \[\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/41.9%

        \[\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.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+46.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. +-commutative46.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-246.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+46.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. +-commutative46.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-246.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-def41.9%

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

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

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

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

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

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

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

    if -1.4500000000000001e53 < y < 5.9999999999999999e39

    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/73.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-def75.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+75.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. +-commutative75.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-275.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+75.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. +-commutative75.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-275.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-def73.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+73.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. +-commutative73.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-273.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 79.7%

      \[\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}\;y \leq -1.1 \cdot 10^{+261}:\\ \;\;\;\;x \cdot \left(t + y \cdot 2\right)\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{+53} \lor \neg \left(y \leq 6 \cdot 10^{+39}\right):\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t + z \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 99.2% accurate, 0.7× speedup?

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

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

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


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

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

    if -2.5 < x < 2.5

    1. Initial program 99.9%

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

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

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

Alternative 7: 86.6% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.49999999999999966e136

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

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

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

    if -8.49999999999999966e136 < z < 1.75000000000000009e53

    1. Initial program 99.9%

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

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

    if 1.75000000000000009e53 < z

    1. Initial program 99.9%

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

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

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

Alternative 8: 89.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

    if -9.9999999999999998e-17 < x < 8.5000000000000002e-24

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

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

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

Alternative 9: 89.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-18} \lor \neg \left(x \leq 0.000108\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.8e-18) (not (<= x 0.000108)))
   (* 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.8e-18) || !(x <= 0.000108)) {
		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.8d-18)) .or. (.not. (x <= 0.000108d0))) 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.8e-18) || !(x <= 0.000108)) {
		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.8e-18) or not (x <= 0.000108):
		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.8e-18) || !(x <= 0.000108))
		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.8e-18) || ~((x <= 0.000108)))
		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.8e-18], N[Not[LessEqual[x, 0.000108]], $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.8 \cdot 10^{-18} \lor \neg \left(x \leq 0.000108\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.80000000000000005e-18 or 1.08e-4 < x

    1. Initial program 100.0%

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

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

    if -1.80000000000000005e-18 < x < 1.08e-4

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-18} \lor \neg \left(x \leq 0.000108\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 10: 78.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+53} \lor \neg \left(y \leq 3.1 \cdot 10^{+38}\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 -1e+53) (not (<= y 3.1e+38)))
   (* 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 <= -1e+53) || !(y <= 3.1e+38)) {
		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 <= (-1d+53)) .or. (.not. (y <= 3.1d+38))) 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 <= -1e+53) || !(y <= 3.1e+38)) {
		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 <= -1e+53) or not (y <= 3.1e+38):
		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 <= -1e+53) || !(y <= 3.1e+38))
		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 <= -1e+53) || ~((y <= 3.1e+38)))
		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, -1e+53], N[Not[LessEqual[y, 3.1e+38]], $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 \cdot 10^{+53} \lor \neg \left(y \leq 3.1 \cdot 10^{+38}\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 < -9.9999999999999999e52 or 3.10000000000000018e38 < y

    1. Initial program 99.9%

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

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

    if -9.9999999999999999e52 < y < 3.10000000000000018e38

    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/73.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-def75.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+75.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. +-commutative75.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-275.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+75.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. +-commutative75.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-275.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-def73.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+73.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. +-commutative73.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-273.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 79.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+53} \lor \neg \left(y \leq 3.1 \cdot 10^{+38}\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 11: 64.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-19} \lor \neg \left(x \leq 2.5 \cdot 10^{-19}\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 -5e-19) (not (<= x 2.5e-19))) (* x (+ t (* y 2.0))) (* y 5.0)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -5e-19) || !(x <= 2.5e-19)) {
		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 <= (-5d-19)) .or. (.not. (x <= 2.5d-19))) 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 <= -5e-19) || !(x <= 2.5e-19)) {
		tmp = x * (t + (y * 2.0));
	} else {
		tmp = y * 5.0;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -5e-19) or not (x <= 2.5e-19):
		tmp = x * (t + (y * 2.0))
	else:
		tmp = y * 5.0
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -5e-19) || !(x <= 2.5e-19))
		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 <= -5e-19) || ~((x <= 2.5e-19)))
		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, -5e-19], N[Not[LessEqual[x, 2.5e-19]], $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 -5 \cdot 10^{-19} \lor \neg \left(x \leq 2.5 \cdot 10^{-19}\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 < -5.0000000000000004e-19 or 2.5000000000000002e-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. 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.2%

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

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

    if -5.0000000000000004e-19 < x < 2.5000000000000002e-19

    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-+49.9%

        \[\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/49.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 48.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-19}:\\
\;\;\;\;x \cdot t\\

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

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


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

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Add Preprocessing
    3. 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-+80.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/72.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-def79.2%

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

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

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

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

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

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

        \[\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-def72.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+72.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. +-commutative72.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-272.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-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 48.8%

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

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

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

    if -2.5000000000000002e-19 < x < 7.6000000000000004e-4

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)} \]
      3. flip-+48.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/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 x around 0 63.2%

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

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

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

    if 7.6000000000000004e-4 < x

    1. Initial program 100.0%

      \[x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5 \]
    2. Add Preprocessing
    3. 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-+79.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/74.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-def78.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+78.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. +-commutative78.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-278.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+78.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. +-commutative78.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-278.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-def74.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+74.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. +-commutative74.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-274.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 z around inf 44.4%

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

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

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

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

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

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

Alternative 13: 99.8% 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.9%

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

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

Alternative 14: 48.4% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.60000000000000013e-19 or 1.4e17 < 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-+80.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/73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000013e-19 < x < 1.4e17

    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-+48.2%

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

        \[\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.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+48.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. +-commutative48.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-248.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+48.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. +-commutative48.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-248.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-def48.1%

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

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

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

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

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

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

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

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

Alternative 15: 30.9% accurate, 5.0× speedup?

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

\\
x \cdot t
\end{array}
Derivation
  1. Initial program 99.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.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/59.8%

      \[\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-def62.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+62.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. +-commutative62.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-262.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+62.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. +-commutative62.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-262.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-def59.8%

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

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

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

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

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

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

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

Reproduce

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