Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B

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

Specification

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

\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\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 12 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

\\
\frac{\left(x + y\right) - z}{t \cdot 2}
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\frac{\left(x + y\right) - z}{t \cdot 2} \]
  2. Add Preprocessing
  3. Final simplification100.0%

    \[\leadsto \frac{\left(y + x\right) - z}{2 \cdot t} \]
  4. Add Preprocessing

Alternative 2: 49.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\
\;\;\;\;\frac{0.5 \cdot x}{t}\\

\mathbf{elif}\;y + x \leq 4 \cdot 10^{+41}:\\
\;\;\;\;\frac{-0.5 \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5 \cdot y}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 x y) < -3.9999999999999999e-48

    1. Initial program 100.0%

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

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

        \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot x}}{t} \]
      2. associate-*l/N/A

        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot x\right)} \]
      3. associate-*l*N/A

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

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot x} \]
      5. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot x \]
      6. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot x \]
      7. lower-/.f6446.3

        \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot x \]
    5. Applied rewrites46.3%

      \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} \]
    6. Step-by-step derivation
      1. Applied rewrites46.5%

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

      if -3.9999999999999999e-48 < (+.f64 x y) < 4.00000000000000002e41

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
      4. Step-by-step derivation
        1. *-lft-identityN/A

          \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
        2. associate-*l/N/A

          \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
        3. associate-*l*N/A

          \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
        4. metadata-evalN/A

          \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
        5. distribute-lft-neg-inN/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
        6. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
        7. associate-*r/N/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
        8. metadata-evalN/A

          \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
        9. distribute-neg-fracN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
        10. metadata-evalN/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
        11. lower-/.f6478.8

          \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
      5. Applied rewrites78.8%

        \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
      6. Step-by-step derivation
        1. Applied rewrites79.0%

          \[\leadsto \frac{-0.5 \cdot z}{\color{blue}{t}} \]

        if 4.00000000000000002e41 < (+.f64 x y)

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
        4. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
          2. associate-*l/N/A

            \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
          3. associate-*l*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
          5. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot y \]
          6. metadata-evalN/A

            \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot y \]
          7. lower-/.f6442.3

            \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot y \]
        5. Applied rewrites42.3%

          \[\leadsto \color{blue}{\frac{0.5}{t} \cdot y} \]
        6. Step-by-step derivation
          1. Applied rewrites42.4%

            \[\leadsto \frac{y \cdot 0.5}{\color{blue}{t}} \]
        7. Recombined 3 regimes into one program.
        8. Final simplification52.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\ \;\;\;\;\frac{0.5 \cdot x}{t}\\ \mathbf{elif}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot y}{t}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 3: 49.3% accurate, 0.7× speedup?

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

          1. Initial program 100.0%

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

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

              \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot x}}{t} \]
            2. associate-*l/N/A

              \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot x\right)} \]
            3. associate-*l*N/A

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

              \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot x} \]
            5. associate-*r/N/A

              \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot x \]
            6. metadata-evalN/A

              \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot x \]
            7. lower-/.f6446.3

              \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot x \]
          5. Applied rewrites46.3%

            \[\leadsto \color{blue}{\frac{0.5}{t} \cdot x} \]
          6. Step-by-step derivation
            1. Applied rewrites46.5%

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

            if -3.9999999999999999e-48 < (+.f64 x y) < 4.00000000000000002e41

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
            4. Step-by-step derivation
              1. *-lft-identityN/A

                \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
              2. associate-*l/N/A

                \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
              3. associate-*l*N/A

                \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
              4. metadata-evalN/A

                \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
              5. distribute-lft-neg-inN/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
              6. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
              7. associate-*r/N/A

                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
              8. metadata-evalN/A

                \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
              9. distribute-neg-fracN/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
              10. metadata-evalN/A

                \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
              11. lower-/.f6478.8

                \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
            5. Applied rewrites78.8%

              \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
            6. Step-by-step derivation
              1. Applied rewrites79.0%

                \[\leadsto \frac{-0.5 \cdot z}{\color{blue}{t}} \]

              if 4.00000000000000002e41 < (+.f64 x y)

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
              4. Step-by-step derivation
                1. *-lft-identityN/A

                  \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
                2. associate-*l/N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                4. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                5. associate-*r/N/A

                  \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot y \]
                6. metadata-evalN/A

                  \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot y \]
                7. lower-/.f6442.3

                  \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot y \]
              5. Applied rewrites42.3%

                \[\leadsto \color{blue}{\frac{0.5}{t} \cdot y} \]
            7. Recombined 3 regimes into one program.
            8. Final simplification52.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\ \;\;\;\;\frac{0.5 \cdot x}{t}\\ \mathbf{elif}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot y\\ \end{array} \]
            9. Add Preprocessing

            Alternative 4: 49.3% accurate, 0.7× speedup?

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

              1. Initial program 100.0%

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

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

                  \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot x}}{t} \]
                2. associate-*l/N/A

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot x\right)} \]
                3. associate-*l*N/A

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

                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot x} \]
                5. associate-*r/N/A

                  \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot x \]
                6. metadata-evalN/A

                  \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot x \]
                7. lower-/.f6446.3

                  \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot x \]
              5. Applied rewrites46.3%

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

              if -3.9999999999999999e-48 < (+.f64 x y) < 4.00000000000000002e41

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
              4. Step-by-step derivation
                1. *-lft-identityN/A

                  \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                2. associate-*l/N/A

                  \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                3. associate-*l*N/A

                  \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                4. metadata-evalN/A

                  \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                5. distribute-lft-neg-inN/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                6. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                7. associate-*r/N/A

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                8. metadata-evalN/A

                  \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                9. distribute-neg-fracN/A

                  \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                10. metadata-evalN/A

                  \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                11. lower-/.f6478.8

                  \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
              5. Applied rewrites78.8%

                \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
              6. Step-by-step derivation
                1. Applied rewrites79.0%

                  \[\leadsto \frac{-0.5 \cdot z}{\color{blue}{t}} \]

                if 4.00000000000000002e41 < (+.f64 x y)

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
                4. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
                  2. associate-*l/N/A

                    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
                  3. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                  4. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                  5. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot y \]
                  6. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot y \]
                  7. lower-/.f6442.3

                    \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot y \]
                5. Applied rewrites42.3%

                  \[\leadsto \color{blue}{\frac{0.5}{t} \cdot y} \]
              7. Recombined 3 regimes into one program.
              8. Final simplification52.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\ \;\;\;\;\frac{0.5}{t} \cdot x\\ \mathbf{elif}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot y\\ \end{array} \]
              9. Add Preprocessing

              Alternative 5: 49.2% accurate, 0.7× speedup?

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

                1. Initial program 100.0%

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

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

                    \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot x}}{t} \]
                  2. associate-*l/N/A

                    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot x\right)} \]
                  3. associate-*l*N/A

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

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot x} \]
                  5. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot x \]
                  6. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot x \]
                  7. lower-/.f6446.3

                    \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot x \]
                5. Applied rewrites46.3%

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

                if -3.9999999999999999e-48 < (+.f64 x y) < 4.00000000000000002e41

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
                4. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                  2. associate-*l/N/A

                    \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                  3. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                  4. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                  5. distribute-lft-neg-inN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                  6. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                  7. associate-*r/N/A

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                  8. metadata-evalN/A

                    \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                  9. distribute-neg-fracN/A

                    \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                  11. lower-/.f6478.8

                    \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
                5. Applied rewrites78.8%

                  \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]

                if 4.00000000000000002e41 < (+.f64 x y)

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{y}{t}} \]
                4. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot y}}{t} \]
                  2. associate-*l/N/A

                    \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot y\right)} \]
                  3. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                  4. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot y} \]
                  5. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot y \]
                  6. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot y \]
                  7. lower-/.f6442.3

                    \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot y \]
                5. Applied rewrites42.3%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\ \;\;\;\;\frac{0.5}{t} \cdot x\\ \mathbf{elif}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{-0.5}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{t} \cdot y\\ \end{array} \]
              5. Add Preprocessing

              Alternative 6: 82.0% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-0.5 \cdot z}{t}\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\ \;\;\;\;\frac{y + x}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (/ (* -0.5 z) t)))
                 (if (<= z -6.2e+131) t_1 (if (<= z 6.8e+114) (/ (+ y x) (* 2.0 t)) t_1))))
              double code(double x, double y, double z, double t) {
              	double t_1 = (-0.5 * z) / t;
              	double tmp;
              	if (z <= -6.2e+131) {
              		tmp = t_1;
              	} else if (z <= 6.8e+114) {
              		tmp = (y + x) / (2.0 * t);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z, t)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: tmp
                  t_1 = ((-0.5d0) * z) / t
                  if (z <= (-6.2d+131)) then
                      tmp = t_1
                  else if (z <= 6.8d+114) then
                      tmp = (y + x) / (2.0d0 * t)
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = (-0.5 * z) / t;
              	double tmp;
              	if (z <= -6.2e+131) {
              		tmp = t_1;
              	} else if (z <= 6.8e+114) {
              		tmp = (y + x) / (2.0 * t);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = (-0.5 * z) / t
              	tmp = 0
              	if z <= -6.2e+131:
              		tmp = t_1
              	elif z <= 6.8e+114:
              		tmp = (y + x) / (2.0 * t)
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(Float64(-0.5 * z) / t)
              	tmp = 0.0
              	if (z <= -6.2e+131)
              		tmp = t_1;
              	elseif (z <= 6.8e+114)
              		tmp = Float64(Float64(y + x) / Float64(2.0 * t));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = (-0.5 * z) / t;
              	tmp = 0.0;
              	if (z <= -6.2e+131)
              		tmp = t_1;
              	elseif (z <= 6.8e+114)
              		tmp = (y + x) / (2.0 * t);
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.5 * z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -6.2e+131], t$95$1, If[LessEqual[z, 6.8e+114], N[(N[(y + x), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \frac{-0.5 \cdot z}{t}\\
              \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\
              \;\;\;\;\frac{y + x}{2 \cdot t}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -6.20000000000000032e131 or 6.8000000000000001e114 < z

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
                4. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                  2. associate-*l/N/A

                    \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                  3. associate-*l*N/A

                    \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                  4. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                  5. distribute-lft-neg-inN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                  6. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                  7. associate-*r/N/A

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                  8. metadata-evalN/A

                    \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                  9. distribute-neg-fracN/A

                    \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                  10. metadata-evalN/A

                    \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                  11. lower-/.f6478.3

                    \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
                5. Applied rewrites78.3%

                  \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
                6. Step-by-step derivation
                  1. Applied rewrites78.4%

                    \[\leadsto \frac{-0.5 \cdot z}{\color{blue}{t}} \]

                  if -6.20000000000000032e131 < z < 6.8000000000000001e114

                  1. Initial program 100.0%

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

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

                      \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
                    2. lower-+.f6489.0

                      \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
                  5. Applied rewrites89.0%

                    \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
                7. Recombined 2 regimes into one program.
                8. Final simplification85.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\ \;\;\;\;\frac{y + x}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \end{array} \]
                9. Add Preprocessing

                Alternative 7: 81.8% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-0.5 \cdot z}{t}\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\ \;\;\;\;\left(y + x\right) \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (/ (* -0.5 z) t)))
                   (if (<= z -6.2e+131) t_1 (if (<= z 6.8e+114) (* (+ y x) (/ 0.5 t)) t_1))))
                double code(double x, double y, double z, double t) {
                	double t_1 = (-0.5 * z) / t;
                	double tmp;
                	if (z <= -6.2e+131) {
                		tmp = t_1;
                	} else if (z <= 6.8e+114) {
                		tmp = (y + x) * (0.5 / t);
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z, t)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: t_1
                    real(8) :: tmp
                    t_1 = ((-0.5d0) * z) / t
                    if (z <= (-6.2d+131)) then
                        tmp = t_1
                    else if (z <= 6.8d+114) then
                        tmp = (y + x) * (0.5d0 / t)
                    else
                        tmp = t_1
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t) {
                	double t_1 = (-0.5 * z) / t;
                	double tmp;
                	if (z <= -6.2e+131) {
                		tmp = t_1;
                	} else if (z <= 6.8e+114) {
                		tmp = (y + x) * (0.5 / t);
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	t_1 = (-0.5 * z) / t
                	tmp = 0
                	if z <= -6.2e+131:
                		tmp = t_1
                	elif z <= 6.8e+114:
                		tmp = (y + x) * (0.5 / t)
                	else:
                		tmp = t_1
                	return tmp
                
                function code(x, y, z, t)
                	t_1 = Float64(Float64(-0.5 * z) / t)
                	tmp = 0.0
                	if (z <= -6.2e+131)
                		tmp = t_1;
                	elseif (z <= 6.8e+114)
                		tmp = Float64(Float64(y + x) * Float64(0.5 / t));
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	t_1 = (-0.5 * z) / t;
                	tmp = 0.0;
                	if (z <= -6.2e+131)
                		tmp = t_1;
                	elseif (z <= 6.8e+114)
                		tmp = (y + x) * (0.5 / t);
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.5 * z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[z, -6.2e+131], t$95$1, If[LessEqual[z, 6.8e+114], N[(N[(y + x), $MachinePrecision] * N[(0.5 / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \frac{-0.5 \cdot z}{t}\\
                \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\
                \;\;\;\;\left(y + x\right) \cdot \frac{0.5}{t}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -6.20000000000000032e131 or 6.8000000000000001e114 < z

                  1. Initial program 100.0%

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

                    \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
                  4. Step-by-step derivation
                    1. *-lft-identityN/A

                      \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                    2. associate-*l/N/A

                      \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                    3. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                    4. metadata-evalN/A

                      \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                    5. distribute-lft-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                    6. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                    7. associate-*r/N/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                    8. metadata-evalN/A

                      \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                    9. distribute-neg-fracN/A

                      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                    10. metadata-evalN/A

                      \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                    11. lower-/.f6478.3

                      \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
                  5. Applied rewrites78.3%

                    \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
                  6. Step-by-step derivation
                    1. Applied rewrites78.4%

                      \[\leadsto \frac{-0.5 \cdot z}{\color{blue}{t}} \]

                    if -6.20000000000000032e131 < z < 6.8000000000000001e114

                    1. Initial program 100.0%

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

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

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

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

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

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

                        \[\leadsto \frac{1}{\color{blue}{2 \cdot t}} \cdot \left(\left(x + y\right) - z\right) \]
                      7. associate-/r*N/A

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

                        \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \cdot \left(\left(x + y\right) - z\right) \]
                      9. metadata-eval99.6

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

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

                        \[\leadsto \frac{\frac{1}{2}}{t} \cdot \left(\color{blue}{\left(y + x\right)} - z\right) \]
                      12. lower-+.f6499.6

                        \[\leadsto \frac{0.5}{t} \cdot \left(\color{blue}{\left(y + x\right)} - z\right) \]
                    4. Applied rewrites99.6%

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

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

                        \[\leadsto \frac{\frac{1}{2}}{t} \cdot \color{blue}{\left(y + x\right)} \]
                      2. lower-+.f6488.7

                        \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y + x\right)} \]
                    7. Applied rewrites88.7%

                      \[\leadsto \frac{0.5}{t} \cdot \color{blue}{\left(y + x\right)} \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification85.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+131}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+114}:\\ \;\;\;\;\left(y + x\right) \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot z}{t}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 8: 69.1% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq -1 \cdot 10^{-175}:\\ \;\;\;\;\frac{x - z}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{2 \cdot t}\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= (+ y x) -1e-175) (/ (- x z) (* 2.0 t)) (/ (- y z) (* 2.0 t))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y + x) <= -1e-175) {
                  		tmp = (x - z) / (2.0 * t);
                  	} else {
                  		tmp = (y - z) / (2.0 * 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 ((y + x) <= (-1d-175)) then
                          tmp = (x - z) / (2.0d0 * t)
                      else
                          tmp = (y - z) / (2.0d0 * t)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y + x) <= -1e-175) {
                  		tmp = (x - z) / (2.0 * t);
                  	} else {
                  		tmp = (y - z) / (2.0 * t);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (y + x) <= -1e-175:
                  		tmp = (x - z) / (2.0 * t)
                  	else:
                  		tmp = (y - z) / (2.0 * t)
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (Float64(y + x) <= -1e-175)
                  		tmp = Float64(Float64(x - z) / Float64(2.0 * t));
                  	else
                  		tmp = Float64(Float64(y - z) / Float64(2.0 * t));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((y + x) <= -1e-175)
                  		tmp = (x - z) / (2.0 * t);
                  	else
                  		tmp = (y - z) / (2.0 * t);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], -1e-175], N[(N[(x - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y + x \leq -1 \cdot 10^{-175}:\\
                  \;\;\;\;\frac{x - z}{2 \cdot t}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{y - z}{2 \cdot t}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (+.f64 x y) < -1e-175

                    1. Initial program 100.0%

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

                      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
                    4. Step-by-step derivation
                      1. lower--.f6463.5

                        \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
                    5. Applied rewrites63.5%

                      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]

                    if -1e-175 < (+.f64 x y)

                    1. Initial program 100.0%

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

                      \[\leadsto \frac{\color{blue}{y - z}}{t \cdot 2} \]
                    4. Step-by-step derivation
                      1. lower--.f6471.4

                        \[\leadsto \frac{\color{blue}{y - z}}{t \cdot 2} \]
                    5. Applied rewrites71.4%

                      \[\leadsto \frac{\color{blue}{y - z}}{t \cdot 2} \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification67.9%

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

                  Alternative 9: 75.6% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{x - z}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{2 \cdot t}\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= (+ y x) 4e+41) (/ (- x z) (* 2.0 t)) (/ (+ y x) (* 2.0 t))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y + x) <= 4e+41) {
                  		tmp = (x - z) / (2.0 * t);
                  	} else {
                  		tmp = (y + x) / (2.0 * 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 ((y + x) <= 4d+41) then
                          tmp = (x - z) / (2.0d0 * t)
                      else
                          tmp = (y + x) / (2.0d0 * t)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if ((y + x) <= 4e+41) {
                  		tmp = (x - z) / (2.0 * t);
                  	} else {
                  		tmp = (y + x) / (2.0 * t);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if (y + x) <= 4e+41:
                  		tmp = (x - z) / (2.0 * t)
                  	else:
                  		tmp = (y + x) / (2.0 * t)
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (Float64(y + x) <= 4e+41)
                  		tmp = Float64(Float64(x - z) / Float64(2.0 * t));
                  	else
                  		tmp = Float64(Float64(y + x) / Float64(2.0 * t));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if ((y + x) <= 4e+41)
                  		tmp = (x - z) / (2.0 * t);
                  	else
                  		tmp = (y + x) / (2.0 * t);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[N[(y + x), $MachinePrecision], 4e+41], N[(N[(x - z), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / N[(2.0 * t), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y + x \leq 4 \cdot 10^{+41}:\\
                  \;\;\;\;\frac{x - z}{2 \cdot t}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{y + x}{2 \cdot t}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (+.f64 x y) < 4.00000000000000002e41

                    1. Initial program 100.0%

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

                      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
                    4. Step-by-step derivation
                      1. lower--.f6471.3

                        \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]
                    5. Applied rewrites71.3%

                      \[\leadsto \frac{\color{blue}{x - z}}{t \cdot 2} \]

                    if 4.00000000000000002e41 < (+.f64 x y)

                    1. Initial program 100.0%

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

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

                        \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
                      2. lower-+.f6480.2

                        \[\leadsto \frac{\color{blue}{y + x}}{t \cdot 2} \]
                    5. Applied rewrites80.2%

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq 4 \cdot 10^{+41}:\\ \;\;\;\;\frac{x - z}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{2 \cdot t}\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 10: 42.0% accurate, 0.9× speedup?

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

                    1. Initial program 100.0%

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

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

                        \[\leadsto \frac{1}{2} \cdot \frac{\color{blue}{1 \cdot x}}{t} \]
                      2. associate-*l/N/A

                        \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot x\right)} \]
                      3. associate-*l*N/A

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

                        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{t}\right) \cdot x} \]
                      5. associate-*r/N/A

                        \[\leadsto \color{blue}{\frac{\frac{1}{2} \cdot 1}{t}} \cdot x \]
                      6. metadata-evalN/A

                        \[\leadsto \frac{\color{blue}{\frac{1}{2}}}{t} \cdot x \]
                      7. lower-/.f6446.3

                        \[\leadsto \color{blue}{\frac{0.5}{t}} \cdot x \]
                    5. Applied rewrites46.3%

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

                    if -3.9999999999999999e-48 < (+.f64 x y)

                    1. Initial program 100.0%

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

                      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
                    4. Step-by-step derivation
                      1. *-lft-identityN/A

                        \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                      2. associate-*l/N/A

                        \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                      3. associate-*l*N/A

                        \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                      4. metadata-evalN/A

                        \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                      5. distribute-lft-neg-inN/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                      6. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                      7. associate-*r/N/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                      8. metadata-evalN/A

                        \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                      9. distribute-neg-fracN/A

                        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                      10. metadata-evalN/A

                        \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                      11. lower-/.f6445.3

                        \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
                    5. Applied rewrites45.3%

                      \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification45.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y + x \leq -4 \cdot 10^{-48}:\\ \;\;\;\;\frac{0.5}{t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{t} \cdot z\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 11: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

                      \[\leadsto \frac{1}{\color{blue}{2 \cdot t}} \cdot \left(\left(x + y\right) - z\right) \]
                    7. associate-/r*N/A

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

                      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{t}} \cdot \left(\left(x + y\right) - z\right) \]
                    9. metadata-eval99.6

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

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

                      \[\leadsto \frac{\frac{1}{2}}{t} \cdot \left(\color{blue}{\left(y + x\right)} - z\right) \]
                    12. lower-+.f6499.6

                      \[\leadsto \frac{0.5}{t} \cdot \left(\color{blue}{\left(y + x\right)} - z\right) \]
                  4. Applied rewrites99.6%

                    \[\leadsto \color{blue}{\frac{0.5}{t} \cdot \left(\left(y + x\right) - z\right)} \]
                  5. Final simplification99.6%

                    \[\leadsto \left(\left(y + x\right) - z\right) \cdot \frac{0.5}{t} \]
                  6. Add Preprocessing

                  Alternative 12: 37.1% accurate, 1.4× speedup?

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

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

                    \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{z}{t}} \]
                  4. Step-by-step derivation
                    1. *-lft-identityN/A

                      \[\leadsto \frac{-1}{2} \cdot \frac{\color{blue}{1 \cdot z}}{t} \]
                    2. associate-*l/N/A

                      \[\leadsto \frac{-1}{2} \cdot \color{blue}{\left(\frac{1}{t} \cdot z\right)} \]
                    3. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{1}{t}\right) \cdot z} \]
                    4. metadata-evalN/A

                      \[\leadsto \left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{1}{t}\right) \cdot z \]
                    5. distribute-lft-neg-inN/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right)} \cdot z \]
                    6. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{t}\right)\right) \cdot z} \]
                    7. associate-*r/N/A

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} \cdot 1}{t}}\right)\right) \cdot z \]
                    8. metadata-evalN/A

                      \[\leadsto \left(\mathsf{neg}\left(\frac{\color{blue}{\frac{1}{2}}}{t}\right)\right) \cdot z \]
                    9. distribute-neg-fracN/A

                      \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{t}} \cdot z \]
                    10. metadata-evalN/A

                      \[\leadsto \frac{\color{blue}{\frac{-1}{2}}}{t} \cdot z \]
                    11. lower-/.f6435.9

                      \[\leadsto \color{blue}{\frac{-0.5}{t}} \cdot z \]
                  5. Applied rewrites35.9%

                    \[\leadsto \color{blue}{\frac{-0.5}{t} \cdot z} \]
                  6. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024268 
                  (FPCore (x y z t)
                    :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
                    :precision binary64
                    (/ (- (+ x y) z) (* t 2.0)))