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

Percentage Accurate: 99.8% → 99.8%
Time: 8.5s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 99.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.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 87.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -650:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(y, 2, t\right)\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
   (if (<= x -650.0)
     t_1
     (if (<= x -1.05e-278)
       (fma 5.0 y (* x (fma y 2.0 t)))
       (if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x * fma(2.0, (y + z), t);
	double tmp;
	if (x <= -650.0) {
		tmp = t_1;
	} else if (x <= -1.05e-278) {
		tmp = fma(5.0, y, (x * fma(y, 2.0, t)));
	} else if (x <= 1.4e-8) {
		tmp = fma((z + z), x, (y * 5.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
	tmp = 0.0
	if (x <= -650.0)
		tmp = t_1;
	elseif (x <= -1.05e-278)
		tmp = fma(5.0, y, Float64(x * fma(y, 2.0, t)));
	elseif (x <= 1.4e-8)
		tmp = fma(Float64(z + z), x, Float64(y * 5.0));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -650.0], t$95$1, If[LessEqual[x, -1.05e-278], N[(5.0 * y + N[(x * N[(y * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -650:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(y, 2, t\right)\right)\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -650 or 1.4e-8 < x

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
      3. distribute-lft-outN/A

        \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
      4. lower-fma.f64N/A

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

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

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

    if -650 < x < -1.05000000000000007e-278

    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 0

      \[\leadsto \color{blue}{5 \cdot y + x \cdot \left(t + 2 \cdot y\right)} \]
    4. Step-by-step derivation
      1. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot \left(t + 2 \cdot y\right)\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot \left(t + 2 \cdot y\right)}\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(5, y, x \cdot \color{blue}{\left(2 \cdot y + t\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(5, y, x \cdot \left(\color{blue}{y \cdot 2} + t\right)\right) \]
      5. lower-fma.f6480.1

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

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

    if -1.05000000000000007e-278 < x < 1.4e-8

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
      2. lift-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
      3. lift-+.f64N/A

        \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
      4. distribute-rgt-inN/A

        \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
      5. associate-+l+N/A

        \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
      6. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
      7. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
      8. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
      9. associate-+l+N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
      11. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
      12. flip-+N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
      13. +-inversesN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
      15. +-inversesN/A

        \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
      16. +-inversesN/A

        \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
      17. flip-+N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
      18. lower-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
      19. *-commutativeN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(z + z, x, \color{blue}{5 \cdot y}\right) \]
    6. Step-by-step derivation
      1. lower-*.f6488.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -650:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(y, 2, t\right)\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 87.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) + \left(\left(y + z\right) + t\right)\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -3.4e-28)
   (* x (+ (+ y z) (+ (+ y z) t)))
   (if (<= x -1.05e-278)
     (fma x t (* y 5.0))
     (if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) (* x (fma 2.0 (+ y z) t))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -3.4e-28) {
		tmp = x * ((y + z) + ((y + z) + t));
	} else if (x <= -1.05e-278) {
		tmp = fma(x, t, (y * 5.0));
	} else if (x <= 1.4e-8) {
		tmp = fma((z + z), x, (y * 5.0));
	} else {
		tmp = x * fma(2.0, (y + z), t);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -3.4e-28)
		tmp = Float64(x * Float64(Float64(y + z) + Float64(Float64(y + z) + t)));
	elseif (x <= -1.05e-278)
		tmp = fma(x, t, Float64(y * 5.0));
	elseif (x <= 1.4e-8)
		tmp = fma(Float64(z + z), x, Float64(y * 5.0));
	else
		tmp = Float64(x * fma(2.0, Float64(y + z), t));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e-28], N[(x * N[(N[(y + z), $MachinePrecision] + N[(N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.05e-278], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
\;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.4000000000000001e-28

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      2. +-commutativeN/A

        \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
      3. distribute-lft-outN/A

        \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
      4. lower-fma.f64N/A

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

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

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites95.8%

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

      if -3.4000000000000001e-28 < x < -1.05000000000000007e-278

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        4. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
        5. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
        8. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
        9. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        11. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
        13. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        15. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
        16. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
        17. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        18. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        19. *-commutativeN/A

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

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

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

        \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{t \cdot x + 5 \cdot y} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot t} + 5 \cdot y \]
        3. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
        4. lower-*.f6482.3

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]

      if -1.05000000000000007e-278 < x < 1.4e-8

      1. Initial program 99.9%

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

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        4. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
        5. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
        8. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
        9. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        11. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
        13. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        15. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
        16. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
        17. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        18. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        19. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(z + z, x, \color{blue}{5 \cdot y}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6488.3

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

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

      if 1.4e-8 < x

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

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

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

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, y + z, t\right)} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification91.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \left(\left(y + z\right) + \left(\left(y + z\right) + t\right)\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 4: 87.7% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
       (if (<= x -3.4e-28)
         t_1
         (if (<= x -1.05e-278)
           (fma x t (* y 5.0))
           (if (<= x 1.4e-8) (fma (+ z z) x (* y 5.0)) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * fma(2.0, (y + z), t);
    	double tmp;
    	if (x <= -3.4e-28) {
    		tmp = t_1;
    	} else if (x <= -1.05e-278) {
    		tmp = fma(x, t, (y * 5.0));
    	} else if (x <= 1.4e-8) {
    		tmp = fma((z + z), x, (y * 5.0));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
    	tmp = 0.0
    	if (x <= -3.4e-28)
    		tmp = t_1;
    	elseif (x <= -1.05e-278)
    		tmp = fma(x, t, Float64(y * 5.0));
    	elseif (x <= 1.4e-8)
    		tmp = fma(Float64(z + z), x, Float64(y * 5.0));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-28], t$95$1, If[LessEqual[x, -1.05e-278], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(N[(z + z), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
    \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\
    \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
    
    \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
    \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -3.4000000000000001e-28 or 1.4e-8 < x

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
      4. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
        3. distribute-lft-outN/A

          \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
        4. lower-fma.f64N/A

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

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

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

      if -3.4000000000000001e-28 < x < -1.05000000000000007e-278

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        4. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
        5. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
        8. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
        9. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        11. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
        13. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        15. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
        16. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
        17. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        18. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        19. *-commutativeN/A

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

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

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

        \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{t \cdot x + 5 \cdot y} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{x \cdot t} + 5 \cdot y \]
        3. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
        4. lower-*.f6482.3

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]

      if -1.05000000000000007e-278 < x < 1.4e-8

      1. Initial program 99.9%

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

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        4. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
        5. associate-+l+N/A

          \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
        6. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
        8. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
        9. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
        10. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        11. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        12. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
        13. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
        15. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
        16. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
        17. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        18. lower-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
        19. *-commutativeN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(z + z, x, \color{blue}{5 \cdot y}\right) \]
      6. Step-by-step derivation
        1. lower-*.f6488.3

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-278}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;\mathsf{fma}\left(z + z, x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 76.6% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* y (fma x 2.0 5.0))))
       (if (<= y -6.2e+17)
         t_1
         (if (<= y 1.75e-112)
           (* x (+ z (+ z t)))
           (if (<= y 1.45e+179) (fma 5.0 y (* x t)) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = y * fma(x, 2.0, 5.0);
    	double tmp;
    	if (y <= -6.2e+17) {
    		tmp = t_1;
    	} else if (y <= 1.75e-112) {
    		tmp = x * (z + (z + t));
    	} else if (y <= 1.45e+179) {
    		tmp = fma(5.0, y, (x * t));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(y * fma(x, 2.0, 5.0))
    	tmp = 0.0
    	if (y <= -6.2e+17)
    		tmp = t_1;
    	elseif (y <= 1.75e-112)
    		tmp = Float64(x * Float64(z + Float64(z + t)));
    	elseif (y <= 1.45e+179)
    		tmp = fma(5.0, y, Float64(x * t));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(5.0 * y + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
    \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
    \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\
    
    \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
    \;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -6.2e17 or 1.45000000000000009e179 < y

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
        2. metadata-evalN/A

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right)} \cdot x + 5\right) \]
        3. distribute-lft-neg-inN/A

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
        4. neg-sub0N/A

          \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
        5. associate--r-N/A

          \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
        6. neg-sub0N/A

          \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
        7. lower-*.f64N/A

          \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
        8. neg-sub0N/A

          \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
        9. associate--r-N/A

          \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
        10. neg-sub0N/A

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
        11. distribute-lft-neg-inN/A

          \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
        12. metadata-evalN/A

          \[\leadsto y \cdot \left(\color{blue}{2} \cdot x + 5\right) \]
        13. *-commutativeN/A

          \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
        14. lower-fma.f6485.7

          \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
      5. Applied rewrites85.7%

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

      if -6.2e17 < y < 1.74999999999999997e-112

      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. lift-+.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
        3. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
        4. lower-fma.f6499.9

          \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t, x, y \cdot 5\right)} \]
        5. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t, x, y \cdot 5\right) \]
        6. lift-+.f64N/A

          \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
        7. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t, x, y \cdot 5\right) \]
        8. +-commutativeN/A

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

          \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
        10. flip-+N/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}} + t, x, y \cdot 5\right) \]
        11. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
        12. +-inversesN/A

          \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
        13. +-inversesN/A

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

          \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t, x, y \cdot 5\right) \]
        15. flip-+N/A

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

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

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

        \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
        2. +-commutativeN/A

          \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
        3. lower-fma.f6483.2

          \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
      7. Applied rewrites83.2%

        \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]
      8. Step-by-step derivation
        1. Applied rewrites83.2%

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

        if 1.74999999999999997e-112 < y < 1.45000000000000009e179

        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. lift-+.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
          4. lower-fma.f6499.9

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t, x, y \cdot 5\right)} \]
          5. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t, x, y \cdot 5\right) \]
          6. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
          7. associate-+l+N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t, x, y \cdot 5\right) \]
          8. +-commutativeN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
          10. flip-+N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}} + t, x, y \cdot 5\right) \]
          11. +-inversesN/A

            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
          12. +-inversesN/A

            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
          13. +-inversesN/A

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

            \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t, x, y \cdot 5\right) \]
          15. flip-+N/A

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

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

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

          \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
        6. Step-by-step derivation
          1. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, t \cdot x\right)} \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot t}\right) \]
          3. lower-*.f6469.6

            \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot t}\right) \]
        7. Applied rewrites69.6%

          \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot t\right)} \]
      9. Recombined 3 regimes into one program.
      10. Final simplification81.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 6: 76.6% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* y (fma x 2.0 5.0))))
         (if (<= y -6.2e+17)
           t_1
           (if (<= y 1.75e-112)
             (* x (+ z (+ z t)))
             (if (<= y 1.45e+179) (fma x t (* y 5.0)) t_1)))))
      double code(double x, double y, double z, double t) {
      	double t_1 = y * fma(x, 2.0, 5.0);
      	double tmp;
      	if (y <= -6.2e+17) {
      		tmp = t_1;
      	} else if (y <= 1.75e-112) {
      		tmp = x * (z + (z + t));
      	} else if (y <= 1.45e+179) {
      		tmp = fma(x, t, (y * 5.0));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(y * fma(x, 2.0, 5.0))
      	tmp = 0.0
      	if (y <= -6.2e+17)
      		tmp = t_1;
      	elseif (y <= 1.75e-112)
      		tmp = Float64(x * Float64(z + Float64(z + t)));
      	elseif (y <= 1.45e+179)
      		tmp = fma(x, t, Float64(y * 5.0));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
      \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
      \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\
      
      \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
      \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -6.2e17 or 1.45000000000000009e179 < y

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
          2. metadata-evalN/A

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right)} \cdot x + 5\right) \]
          3. distribute-lft-neg-inN/A

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
          4. neg-sub0N/A

            \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
          5. associate--r-N/A

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          6. neg-sub0N/A

            \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
          7. lower-*.f64N/A

            \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
          8. neg-sub0N/A

            \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
          9. associate--r-N/A

            \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
          10. neg-sub0N/A

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
          11. distribute-lft-neg-inN/A

            \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
          12. metadata-evalN/A

            \[\leadsto y \cdot \left(\color{blue}{2} \cdot x + 5\right) \]
          13. *-commutativeN/A

            \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
          14. lower-fma.f6485.7

            \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
        5. Applied rewrites85.7%

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

        if -6.2e17 < y < 1.74999999999999997e-112

        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. lift-+.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
          3. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
          4. lower-fma.f6499.9

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t, x, y \cdot 5\right)} \]
          5. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t, x, y \cdot 5\right) \]
          6. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
          7. associate-+l+N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t, x, y \cdot 5\right) \]
          8. +-commutativeN/A

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

            \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
          10. flip-+N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}} + t, x, y \cdot 5\right) \]
          11. +-inversesN/A

            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
          12. +-inversesN/A

            \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
          13. +-inversesN/A

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

            \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t, x, y \cdot 5\right) \]
          15. flip-+N/A

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

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

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

          \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
          2. +-commutativeN/A

            \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
          3. lower-fma.f6483.2

            \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
        7. Applied rewrites83.2%

          \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]
        8. Step-by-step derivation
          1. Applied rewrites83.2%

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

          if 1.74999999999999997e-112 < y < 1.45000000000000009e179

          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. lift-+.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            3. lift-+.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            4. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
            5. associate-+l+N/A

              \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
            7. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
            8. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
            9. associate-+l+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
            10. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            11. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            12. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
            13. +-inversesN/A

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

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            15. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
            16. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
            17. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            18. lower-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            19. *-commutativeN/A

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

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

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

            \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{t \cdot x + 5 \cdot y} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{x \cdot t} + 5 \cdot y \]
            3. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
            4. lower-*.f6469.6

              \[\leadsto \mathsf{fma}\left(x, t, \color{blue}{5 \cdot y}\right) \]
          7. Applied rewrites69.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
        9. Recombined 3 regimes into one program.
        10. Final simplification81.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \left(z + \left(z + t\right)\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \end{array} \]
        11. Add Preprocessing

        Alternative 7: 76.6% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* y (fma x 2.0 5.0))))
           (if (<= y -6.2e+17)
             t_1
             (if (<= y 1.75e-112)
               (* x (fma 2.0 z t))
               (if (<= y 1.45e+179) (fma x t (* y 5.0)) t_1)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = y * fma(x, 2.0, 5.0);
        	double tmp;
        	if (y <= -6.2e+17) {
        		tmp = t_1;
        	} else if (y <= 1.75e-112) {
        		tmp = x * fma(2.0, z, t);
        	} else if (y <= 1.45e+179) {
        		tmp = fma(x, t, (y * 5.0));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(y * fma(x, 2.0, 5.0))
        	tmp = 0.0
        	if (y <= -6.2e+17)
        		tmp = t_1;
        	elseif (y <= 1.75e-112)
        		tmp = Float64(x * fma(2.0, z, t));
        	elseif (y <= 1.45e+179)
        		tmp = fma(x, t, Float64(y * 5.0));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 1.75e-112], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+179], N[(x * t + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
        \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\
        \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
        
        \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\
        \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -6.2e17 or 1.45000000000000009e179 < y

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
            2. metadata-evalN/A

              \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right)} \cdot x + 5\right) \]
            3. distribute-lft-neg-inN/A

              \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
            4. neg-sub0N/A

              \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
            5. associate--r-N/A

              \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
            6. neg-sub0N/A

              \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
            7. lower-*.f64N/A

              \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
            8. neg-sub0N/A

              \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
            9. associate--r-N/A

              \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
            10. neg-sub0N/A

              \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
            11. distribute-lft-neg-inN/A

              \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
            12. metadata-evalN/A

              \[\leadsto y \cdot \left(\color{blue}{2} \cdot x + 5\right) \]
            13. *-commutativeN/A

              \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
            14. lower-fma.f6485.7

              \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
          5. Applied rewrites85.7%

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

          if -6.2e17 < y < 1.74999999999999997e-112

          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

            \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
            2. +-commutativeN/A

              \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
            3. lower-fma.f6483.2

              \[\leadsto x \cdot \color{blue}{\mathsf{fma}\left(2, z, t\right)} \]
          5. Applied rewrites83.2%

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

          if 1.74999999999999997e-112 < y < 1.45000000000000009e179

          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. lift-+.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            3. lift-+.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            4. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
            5. associate-+l+N/A

              \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
            7. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
            8. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
            9. associate-+l+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
            10. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            11. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            12. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
            13. +-inversesN/A

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

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            15. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
            16. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
            17. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            18. lower-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            19. *-commutativeN/A

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

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

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

            \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{t \cdot x + 5 \cdot y} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{x \cdot t} + 5 \cdot y \]
            3. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(x, t, 5 \cdot y\right)} \]
            4. lower-*.f6469.6

              \[\leadsto \mathsf{fma}\left(x, t, \color{blue}{5 \cdot y}\right) \]
          7. Applied rewrites69.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-112}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+179}:\\ \;\;\;\;\mathsf{fma}\left(x, t, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 99.0% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -5700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(z + \left(z + t\right), x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
           (if (<= x -5700.0)
             t_1
             (if (<= x 1.8e-6) (fma (+ z (+ z t)) x (* y 5.0)) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * fma(2.0, (y + z), t);
        	double tmp;
        	if (x <= -5700.0) {
        		tmp = t_1;
        	} else if (x <= 1.8e-6) {
        		tmp = fma((z + (z + t)), x, (y * 5.0));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
        	tmp = 0.0
        	if (x <= -5700.0)
        		tmp = t_1;
        	elseif (x <= 1.8e-6)
        		tmp = fma(Float64(z + Float64(z + t)), x, Float64(y * 5.0));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5700.0], t$95$1, If[LessEqual[x, 1.8e-6], N[(N[(z + N[(z + t), $MachinePrecision]), $MachinePrecision] * x + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
        \mathbf{if}\;x \leq -5700:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\
        \;\;\;\;\mathsf{fma}\left(z + \left(z + t\right), x, y \cdot 5\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -5700 or 1.79999999999999992e-6 < x

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
            2. +-commutativeN/A

              \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
            3. distribute-lft-outN/A

              \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
            4. lower-fma.f64N/A

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

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

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

          if -5700 < x < 1.79999999999999992e-6

          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. lift-+.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            3. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
            4. lower-fma.f6499.9

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t, x, y \cdot 5\right)} \]
            5. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t, x, y \cdot 5\right) \]
            6. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
            7. associate-+l+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t, x, y \cdot 5\right) \]
            8. +-commutativeN/A

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

              \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
            10. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}} + t, x, y \cdot 5\right) \]
            11. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
            12. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
            13. +-inversesN/A

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

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t, x, y \cdot 5\right) \]
            15. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(z + z\right)} + t, x, y \cdot 5\right) \]
            16. lower-+.f6498.8

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\left(z + z\right) + t, x, y \cdot 5\right)} \]
          5. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(z + z\right) + t}, x, y \cdot 5\right) \]
            2. lift-+.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(z + t\right) + z}, x, y \cdot 5\right) \]
            5. lower-+.f64N/A

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5700:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(z + \left(z + t\right), x, y \cdot 5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 99.0% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -5700:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
           (if (<= x -5700.0)
             t_1
             (if (<= x 1.8e-6) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * fma(2.0, (y + z), t);
        	double tmp;
        	if (x <= -5700.0) {
        		tmp = t_1;
        	} else if (x <= 1.8e-6) {
        		tmp = fma(y, 5.0, (x * (t + (z + z))));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
        	tmp = 0.0
        	if (x <= -5700.0)
        		tmp = t_1;
        	elseif (x <= 1.8e-6)
        		tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z))));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5700.0], t$95$1, If[LessEqual[x, 1.8e-6], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
        \mathbf{if}\;x \leq -5700:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\
        \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -5700 or 1.79999999999999992e-6 < x

          1. Initial program 99.9%

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

            \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
            2. +-commutativeN/A

              \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
            3. distribute-lft-outN/A

              \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
            4. lower-fma.f64N/A

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

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

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

          if -5700 < x < 1.79999999999999992e-6

          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. lift-+.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
            2. lift-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            3. lift-+.f64N/A

              \[\leadsto x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
            4. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + t \cdot x\right)} + y \cdot 5 \]
            5. associate-+l+N/A

              \[\leadsto \color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right) \cdot x + \left(t \cdot x + y \cdot 5\right)} \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(y + z\right) + z\right) + y, x, t \cdot x + y \cdot 5\right)} \]
            7. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right) + y}, x, t \cdot x + y \cdot 5\right) \]
            8. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y, x, t \cdot x + y \cdot 5\right) \]
            9. associate-+l+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\left(y + z\right) + \left(z + y\right)}, x, t \cdot x + y \cdot 5\right) \]
            10. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            11. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            12. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}}, x, t \cdot x + y \cdot 5\right) \]
            13. +-inversesN/A

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

              \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)}, x, t \cdot x + y \cdot 5\right) \]
            15. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{0}}, x, t \cdot x + y \cdot 5\right) \]
            16. +-inversesN/A

              \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}}, x, t \cdot x + y \cdot 5\right) \]
            17. flip-+N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            18. lower-+.f64N/A

              \[\leadsto \mathsf{fma}\left(\color{blue}{z + z}, x, t \cdot x + y \cdot 5\right) \]
            19. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z + z, x, \color{blue}{x \cdot t} + y \cdot 5\right) \]
            20. lower-fma.f6498.8

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(z + z, x, \mathsf{fma}\left(x, t, y \cdot 5\right)\right)} \]
          5. Step-by-step derivation
            1. lift-fma.f64N/A

              \[\leadsto \color{blue}{\left(z + z\right) \cdot x + \mathsf{fma}\left(x, t, y \cdot 5\right)} \]
            2. lift-fma.f64N/A

              \[\leadsto \left(z + z\right) \cdot x + \color{blue}{\left(x \cdot t + y \cdot 5\right)} \]
            3. associate-+r+N/A

              \[\leadsto \color{blue}{\left(\left(z + z\right) \cdot x + x \cdot t\right) + y \cdot 5} \]
            4. +-commutativeN/A

              \[\leadsto \color{blue}{y \cdot 5 + \left(\left(z + z\right) \cdot x + x \cdot t\right)} \]
            5. lift-*.f64N/A

              \[\leadsto \color{blue}{y \cdot 5} + \left(\left(z + z\right) \cdot x + x \cdot t\right) \]
            6. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(y, 5, \left(z + z\right) \cdot x + x \cdot t\right)} \]
            7. lift-+.f64N/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{\left(z + z\right)} \cdot x + x \cdot t\right) \]
            8. count-2N/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{\left(2 \cdot z\right)} \cdot x + x \cdot t\right) \]
            9. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{\left(2 \cdot z\right)} \cdot x + x \cdot t\right) \]
            10. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{x \cdot \left(2 \cdot z\right)} + x \cdot t\right) \]
            11. distribute-lft-outN/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{x \cdot \left(2 \cdot z + t\right)}\right) \]
            12. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(y, 5, \color{blue}{x \cdot \left(2 \cdot z + t\right)}\right) \]
            13. lower-+.f6498.7

              \[\leadsto \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(2 \cdot z + t\right)}\right) \]
            14. lift-*.f64N/A

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5700:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 10: 42.9% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + z\right)\\ \mathbf{if}\;x \leq -8.5 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (* x (+ z z))))
           (if (<= x -8.5e+36)
             t_1
             (if (<= x -6.6e-224) (* x t) (if (<= x 2.8e-9) (* y 5.0) t_1)))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x * (z + z);
        	double tmp;
        	if (x <= -8.5e+36) {
        		tmp = t_1;
        	} else if (x <= -6.6e-224) {
        		tmp = x * t;
        	} else if (x <= 2.8e-9) {
        		tmp = y * 5.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: tmp
            t_1 = x * (z + z)
            if (x <= (-8.5d+36)) then
                tmp = t_1
            else if (x <= (-6.6d-224)) then
                tmp = x * t
            else if (x <= 2.8d-9) then
                tmp = y * 5.0d0
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = x * (z + z);
        	double tmp;
        	if (x <= -8.5e+36) {
        		tmp = t_1;
        	} else if (x <= -6.6e-224) {
        		tmp = x * t;
        	} else if (x <= 2.8e-9) {
        		tmp = y * 5.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = x * (z + z)
        	tmp = 0
        	if x <= -8.5e+36:
        		tmp = t_1
        	elif x <= -6.6e-224:
        		tmp = x * t
        	elif x <= 2.8e-9:
        		tmp = y * 5.0
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(x * Float64(z + z))
        	tmp = 0.0
        	if (x <= -8.5e+36)
        		tmp = t_1;
        	elseif (x <= -6.6e-224)
        		tmp = Float64(x * t);
        	elseif (x <= 2.8e-9)
        		tmp = Float64(y * 5.0);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = x * (z + z);
        	tmp = 0.0;
        	if (x <= -8.5e+36)
        		tmp = t_1;
        	elseif (x <= -6.6e-224)
        		tmp = x * t;
        	elseif (x <= 2.8e-9)
        		tmp = y * 5.0;
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+36], t$95$1, If[LessEqual[x, -6.6e-224], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.8e-9], N[(y * 5.0), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x \cdot \left(z + z\right)\\
        \mathbf{if}\;x \leq -8.5 \cdot 10^{+36}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq -6.6 \cdot 10^{-224}:\\
        \;\;\;\;x \cdot t\\
        
        \mathbf{elif}\;x \leq 2.8 \cdot 10^{-9}:\\
        \;\;\;\;y \cdot 5\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < -8.50000000000000014e36 or 2.79999999999999984e-9 < x

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{2 \cdot \left(x \cdot z\right)} \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \color{blue}{\left(2 \cdot x\right) \cdot z} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\left(x \cdot 2\right)} \cdot z \]
            3. associate-*r*N/A

              \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \color{blue}{x \cdot \left(2 \cdot z\right)} \]
            5. lower-*.f6449.5

              \[\leadsto x \cdot \color{blue}{\left(2 \cdot z\right)} \]
          5. Applied rewrites49.5%

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

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

            if -8.50000000000000014e36 < x < -6.6000000000000003e-224

            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

              \[\leadsto \color{blue}{t \cdot x} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{x \cdot t} \]
              2. lower-*.f6441.1

                \[\leadsto \color{blue}{x \cdot t} \]
            5. Applied rewrites41.1%

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

            if -6.6000000000000003e-224 < x < 2.79999999999999984e-9

            1. Initial program 99.9%

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

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

                \[\leadsto \color{blue}{5 \cdot y} \]
            5. Applied rewrites70.5%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{+36}:\\ \;\;\;\;x \cdot \left(z + z\right)\\ \mathbf{elif}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-9}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(z + z\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 11: 88.1% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-10}:\\ \;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* x (fma 2.0 (+ y z) t))))
             (if (<= x -3.4e-28) t_1 (if (<= x 4.3e-10) (fma 5.0 y (* x t)) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x * fma(2.0, (y + z), t);
          	double tmp;
          	if (x <= -3.4e-28) {
          		tmp = t_1;
          	} else if (x <= 4.3e-10) {
          		tmp = fma(5.0, y, (x * t));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(x * fma(2.0, Float64(y + z), t))
          	tmp = 0.0
          	if (x <= -3.4e-28)
          		tmp = t_1;
          	elseif (x <= 4.3e-10)
          		tmp = fma(5.0, y, Float64(x * t));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-28], t$95$1, If[LessEqual[x, 4.3e-10], N[(5.0 * y + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
          \mathbf{if}\;x \leq -3.4 \cdot 10^{-28}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 4.3 \cdot 10^{-10}:\\
          \;\;\;\;\mathsf{fma}\left(5, y, x \cdot t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -3.4000000000000001e-28 or 4.30000000000000014e-10 < x

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
              2. +-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
              3. distribute-lft-outN/A

                \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
              4. lower-fma.f64N/A

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

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

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

            if -3.4000000000000001e-28 < x < 4.30000000000000014e-10

            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. lift-+.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5} \]
              2. lift-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)} + y \cdot 5 \]
              3. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) \cdot x} + y \cdot 5 \]
              4. lower-fma.f6499.9

                \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t, x, y \cdot 5\right)} \]
              5. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(\left(y + z\right) + z\right) + y\right)} + t, x, y \cdot 5\right) \]
              6. lift-+.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(\color{blue}{\left(\left(y + z\right) + z\right)} + y\right) + t, x, y \cdot 5\right) \]
              7. associate-+l+N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t, x, y \cdot 5\right) \]
              8. +-commutativeN/A

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

                \[\leadsto \mathsf{fma}\left(\left(\left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t, x, y \cdot 5\right) \]
              10. flip-+N/A

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{\left(y + z\right) \cdot \left(y + z\right) - \left(y + z\right) \cdot \left(y + z\right)}{\left(y + z\right) - \left(y + z\right)}} + t, x, y \cdot 5\right) \]
              11. +-inversesN/A

                \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{0}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
              12. +-inversesN/A

                \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{z \cdot z - z \cdot z}}{\left(y + z\right) - \left(y + z\right)} + t, x, y \cdot 5\right) \]
              13. +-inversesN/A

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

                \[\leadsto \mathsf{fma}\left(\frac{z \cdot z - z \cdot z}{\color{blue}{z - z}} + t, x, y \cdot 5\right) \]
              15. flip-+N/A

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

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

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

              \[\leadsto \color{blue}{5 \cdot y + t \cdot x} \]
            6. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, t \cdot x\right)} \]
              2. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot t}\right) \]
              3. lower-*.f6479.7

                \[\leadsto \mathsf{fma}\left(5, y, \color{blue}{x \cdot t}\right) \]
            7. Applied rewrites79.7%

              \[\leadsto \color{blue}{\mathsf{fma}\left(5, y, x \cdot t\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 12: 78.2% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\ \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* y (fma x 2.0 5.0))))
             (if (<= y -6.2e+17) t_1 (if (<= y 4.7e+41) (* x (fma 2.0 z t)) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = y * fma(x, 2.0, 5.0);
          	double tmp;
          	if (y <= -6.2e+17) {
          		tmp = t_1;
          	} else if (y <= 4.7e+41) {
          		tmp = x * fma(2.0, z, t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(y * fma(x, 2.0, 5.0))
          	tmp = 0.0
          	if (y <= -6.2e+17)
          		tmp = t_1;
          	elseif (y <= 4.7e+41)
          		tmp = Float64(x * fma(2.0, z, t));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$1, If[LessEqual[y, 4.7e+41], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
          \mathbf{if}\;y \leq -6.2 \cdot 10^{+17}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq 4.7 \cdot 10^{+41}:\\
          \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -6.2e17 or 4.70000000000000001e41 < y

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{y \cdot \left(5 + 2 \cdot x\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto y \cdot \color{blue}{\left(2 \cdot x + 5\right)} \]
              2. metadata-evalN/A

                \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right)} \cdot x + 5\right) \]
              3. distribute-lft-neg-inN/A

                \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
              4. neg-sub0N/A

                \[\leadsto y \cdot \left(\color{blue}{\left(0 - -2 \cdot x\right)} + 5\right) \]
              5. associate--r-N/A

                \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
              6. neg-sub0N/A

                \[\leadsto y \cdot \color{blue}{\left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \color{blue}{y \cdot \left(\mathsf{neg}\left(\left(-2 \cdot x - 5\right)\right)\right)} \]
              8. neg-sub0N/A

                \[\leadsto y \cdot \color{blue}{\left(0 - \left(-2 \cdot x - 5\right)\right)} \]
              9. associate--r-N/A

                \[\leadsto y \cdot \color{blue}{\left(\left(0 - -2 \cdot x\right) + 5\right)} \]
              10. neg-sub0N/A

                \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2 \cdot x\right)\right)} + 5\right) \]
              11. distribute-lft-neg-inN/A

                \[\leadsto y \cdot \left(\color{blue}{\left(\mathsf{neg}\left(-2\right)\right) \cdot x} + 5\right) \]
              12. metadata-evalN/A

                \[\leadsto y \cdot \left(\color{blue}{2} \cdot x + 5\right) \]
              13. *-commutativeN/A

                \[\leadsto y \cdot \left(\color{blue}{x \cdot 2} + 5\right) \]
              14. lower-fma.f6479.1

                \[\leadsto y \cdot \color{blue}{\mathsf{fma}\left(x, 2, 5\right)} \]
            5. Applied rewrites79.1%

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

            if -6.2e17 < y < 4.70000000000000001e41

            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

              \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
              2. +-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
              3. lower-fma.f6479.4

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

              \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(2, z, t\right)} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 13: 64.1% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* x (fma 2.0 z t))))
             (if (<= x -6.6e-224) t_1 (if (<= x 5.4e-11) (* y 5.0) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x * fma(2.0, z, t);
          	double tmp;
          	if (x <= -6.6e-224) {
          		tmp = t_1;
          	} else if (x <= 5.4e-11) {
          		tmp = y * 5.0;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(x * fma(2.0, z, t))
          	tmp = 0.0
          	if (x <= -6.6e-224)
          		tmp = t_1;
          	elseif (x <= 5.4e-11)
          		tmp = Float64(y * 5.0);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.6e-224], t$95$1, If[LessEqual[x, 5.4e-11], N[(y * 5.0), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
          \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 5.4 \cdot 10^{-11}:\\
          \;\;\;\;y \cdot 5\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -6.6000000000000003e-224 or 5.40000000000000009e-11 < x

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(t + 2 \cdot z\right)} \]
              2. +-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(2 \cdot z + t\right)} \]
              3. lower-fma.f6471.0

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

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

            if -6.6000000000000003e-224 < x < 5.40000000000000009e-11

            1. Initial program 99.9%

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

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

                \[\leadsto \color{blue}{5 \cdot y} \]
            5. Applied rewrites70.5%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \mathbf{elif}\;x \leq 5.4 \cdot 10^{-11}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 14: 58.2% accurate, 1.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \mathsf{fma}\left(2, y, t\right)\\ \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* x (fma 2.0 y t))))
             (if (<= x -6.6e-224) t_1 (if (<= x 1.1e-8) (* y 5.0) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x * fma(2.0, y, t);
          	double tmp;
          	if (x <= -6.6e-224) {
          		tmp = t_1;
          	} else if (x <= 1.1e-8) {
          		tmp = y * 5.0;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(x * fma(2.0, y, t))
          	tmp = 0.0
          	if (x <= -6.6e-224)
          		tmp = t_1;
          	elseif (x <= 1.1e-8)
          		tmp = Float64(y * 5.0);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.6e-224], t$95$1, If[LessEqual[x, 1.1e-8], N[(y * 5.0), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x \cdot \mathsf{fma}\left(2, y, t\right)\\
          \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 1.1 \cdot 10^{-8}:\\
          \;\;\;\;y \cdot 5\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -6.6000000000000003e-224 or 1.0999999999999999e-8 < x

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
            4. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \color{blue}{x \cdot \left(t + \left(2 \cdot y + 2 \cdot z\right)\right)} \]
              2. +-commutativeN/A

                \[\leadsto x \cdot \color{blue}{\left(\left(2 \cdot y + 2 \cdot z\right) + t\right)} \]
              3. distribute-lft-outN/A

                \[\leadsto x \cdot \left(\color{blue}{2 \cdot \left(y + z\right)} + t\right) \]
              4. lower-fma.f64N/A

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

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

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

              \[\leadsto x \cdot \left(t + \color{blue}{2 \cdot y}\right) \]
            7. Step-by-step derivation
              1. Applied rewrites56.8%

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

              if -6.6000000000000003e-224 < x < 1.0999999999999999e-8

              1. Initial program 99.9%

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

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

                  \[\leadsto \color{blue}{5 \cdot y} \]
              5. Applied rewrites70.5%

                \[\leadsto \color{blue}{5 \cdot y} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification62.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y, t\right)\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(2, y, t\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 15: 43.2% accurate, 1.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \end{array} \]
            (FPCore (x y z t)
             :precision binary64
             (if (<= x -6.6e-224) (* x t) (if (<= x 1.4e-8) (* y 5.0) (* x t))))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if (x <= -6.6e-224) {
            		tmp = x * t;
            	} else if (x <= 1.4e-8) {
            		tmp = y * 5.0;
            	} else {
            		tmp = x * t;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if (x <= (-6.6d-224)) then
                    tmp = x * t
                else if (x <= 1.4d-8) then
                    tmp = y * 5.0d0
                else
                    tmp = x * t
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t) {
            	double tmp;
            	if (x <= -6.6e-224) {
            		tmp = x * t;
            	} else if (x <= 1.4e-8) {
            		tmp = y * 5.0;
            	} else {
            		tmp = x * t;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t):
            	tmp = 0
            	if x <= -6.6e-224:
            		tmp = x * t
            	elif x <= 1.4e-8:
            		tmp = y * 5.0
            	else:
            		tmp = x * t
            	return tmp
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (x <= -6.6e-224)
            		tmp = Float64(x * t);
            	elseif (x <= 1.4e-8)
            		tmp = Float64(y * 5.0);
            	else
            		tmp = Float64(x * t);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t)
            	tmp = 0.0;
            	if (x <= -6.6e-224)
            		tmp = x * t;
            	elseif (x <= 1.4e-8)
            		tmp = y * 5.0;
            	else
            		tmp = x * t;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[x, -6.6e-224], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.4e-8], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\
            \;\;\;\;x \cdot t\\
            
            \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\
            \;\;\;\;y \cdot 5\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < -6.6000000000000003e-224 or 1.4e-8 < x

              1. Initial program 99.9%

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

                \[\leadsto \color{blue}{t \cdot x} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{x \cdot t} \]
                2. lower-*.f6436.9

                  \[\leadsto \color{blue}{x \cdot t} \]
              5. Applied rewrites36.9%

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

              if -6.6000000000000003e-224 < x < 1.4e-8

              1. Initial program 99.9%

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

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

                  \[\leadsto \color{blue}{5 \cdot y} \]
              5. Applied rewrites70.5%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-224}:\\ \;\;\;\;x \cdot t\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;y \cdot 5\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\\ \end{array} \]
            5. Add Preprocessing

            Alternative 16: 29.9% accurate, 4.3× speedup?

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

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

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

                \[\leadsto \color{blue}{5 \cdot y} \]
            5. Applied rewrites33.6%

              \[\leadsto \color{blue}{5 \cdot y} \]
            6. Final simplification33.6%

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

            Reproduce

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