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

Percentage Accurate: 99.9% → 99.9%
Time: 3.3s
Alternatives: 7
Speedup: 1.1×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 7 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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.1× speedup?

\[\begin{array}{l} \\ \frac{\left(x + y\right) - z}{t + t} \end{array} \]
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (+ t t)))
double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t + t);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 + t)
end function
public static double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t + t);
}
def code(x, y, z, t):
	return ((x + y) - z) / (t + t)
function code(x, y, z, t)
	return Float64(Float64(Float64(x + y) - z) / Float64(t + t))
end
function tmp = code(x, y, z, t)
	tmp = ((x + y) - z) / (t + t);
end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(x + y\right) - z}{t + 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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
    2. *-commutativeN/A

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

      \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
    4. lower-+.f64100.0

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

    \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
  5. Add Preprocessing

Alternative 2: 37.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\left(x + y\right) - z}{t \cdot 2} \leq -5 \cdot 10^{-252}:\\ \;\;\;\;\frac{x}{t + t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t + t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ (- (+ x y) z) (* t 2.0)) -5e-252) (/ x (+ t t)) (/ y (+ t t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((((x + y) - z) / (t * 2.0)) <= -5e-252) {
		tmp = x / (t + t);
	} else {
		tmp = y / (t + t);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    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 + y) - z) / (t * 2.0d0)) <= (-5d-252)) then
        tmp = x / (t + t)
    else
        tmp = y / (t + t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((((x + y) - z) / (t * 2.0)) <= -5e-252) {
		tmp = x / (t + t);
	} else {
		tmp = y / (t + t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (((x + y) - z) / (t * 2.0)) <= -5e-252:
		tmp = x / (t + t)
	else:
		tmp = y / (t + t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0)) <= -5e-252)
		tmp = Float64(x / Float64(t + t));
	else
		tmp = Float64(y / Float64(t + t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((((x + y) - z) / (t * 2.0)) <= -5e-252)
		tmp = x / (t + t);
	else
		tmp = y / (t + t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision], -5e-252], N[(x / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(y / N[(t + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{y}{t + t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64))) < -5.00000000000000008e-252

    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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
      2. *-commutativeN/A

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

        \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
      4. lower-+.f64100.0

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

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

      \[\leadsto \frac{\color{blue}{x}}{t + t} \]
    6. Step-by-step derivation
      1. Applied rewrites32.4%

        \[\leadsto \frac{\color{blue}{x}}{t + t} \]

      if -5.00000000000000008e-252 < (/.f64 (-.f64 (+.f64 x y) z) (*.f64 t #s(literal 2 binary64)))

      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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
        2. *-commutativeN/A

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

          \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
        4. lower-+.f64100.0

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

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

        \[\leadsto \frac{\color{blue}{x}}{t + t} \]
      6. Step-by-step derivation
        1. Applied rewrites35.8%

          \[\leadsto \frac{\color{blue}{x}}{t + t} \]
        2. Taylor expanded in y around inf

          \[\leadsto \frac{\color{blue}{y}}{t + t} \]
        3. Step-by-step derivation
          1. Applied rewrites40.4%

            \[\leadsto \frac{\color{blue}{y}}{t + t} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 3: 50.6% accurate, 0.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq -50000000:\\ \;\;\;\;\frac{x}{t + t}\\ \mathbf{elif}\;x + y \leq 10^{+62}:\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{t + t}\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= (+ x y) -50000000.0)
           (/ x (+ t t))
           (if (<= (+ x y) 1e+62) (* -0.5 (/ z t)) (/ y (+ t t)))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if ((x + y) <= -50000000.0) {
        		tmp = x / (t + t);
        	} else if ((x + y) <= 1e+62) {
        		tmp = -0.5 * (z / t);
        	} else {
        		tmp = y / (t + t);
        	}
        	return tmp;
        }
        
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(x, y, z, t)
        use fmin_fmax_functions
            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 + y) <= (-50000000.0d0)) then
                tmp = x / (t + t)
            else if ((x + y) <= 1d+62) then
                tmp = (-0.5d0) * (z / t)
            else
                tmp = y / (t + t)
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double tmp;
        	if ((x + y) <= -50000000.0) {
        		tmp = x / (t + t);
        	} else if ((x + y) <= 1e+62) {
        		tmp = -0.5 * (z / t);
        	} else {
        		tmp = y / (t + t);
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	tmp = 0
        	if (x + y) <= -50000000.0:
        		tmp = x / (t + t)
        	elif (x + y) <= 1e+62:
        		tmp = -0.5 * (z / t)
        	else:
        		tmp = y / (t + t)
        	return tmp
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (Float64(x + y) <= -50000000.0)
        		tmp = Float64(x / Float64(t + t));
        	elseif (Float64(x + y) <= 1e+62)
        		tmp = Float64(-0.5 * Float64(z / t));
        	else
        		tmp = Float64(y / Float64(t + t));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	tmp = 0.0;
        	if ((x + y) <= -50000000.0)
        		tmp = x / (t + t);
        	elseif ((x + y) <= 1e+62)
        		tmp = -0.5 * (z / t);
        	else
        		tmp = y / (t + t);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -50000000.0], N[(x / N[(t + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], 1e+62], N[(-0.5 * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(y / N[(t + t), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x + y \leq -50000000:\\
        \;\;\;\;\frac{x}{t + t}\\
        
        \mathbf{elif}\;x + y \leq 10^{+62}:\\
        \;\;\;\;-0.5 \cdot \frac{z}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{y}{t + t}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 x y) < -5e7

          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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
            2. *-commutativeN/A

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

              \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
            4. lower-+.f64100.0

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

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

            \[\leadsto \frac{\color{blue}{x}}{t + t} \]
          6. Step-by-step derivation
            1. Applied rewrites44.9%

              \[\leadsto \frac{\color{blue}{x}}{t + t} \]

            if -5e7 < (+.f64 x y) < 1.00000000000000004e62

            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. Applied rewrites72.5%

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

              if 1.00000000000000004e62 < (+.f64 x y)

              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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                2. *-commutativeN/A

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

                  \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                4. lower-+.f64100.0

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

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

                \[\leadsto \frac{\color{blue}{x}}{t + t} \]
              6. Step-by-step derivation
                1. Applied rewrites40.6%

                  \[\leadsto \frac{\color{blue}{x}}{t + t} \]
                2. Taylor expanded in y around inf

                  \[\leadsto \frac{\color{blue}{y}}{t + t} \]
                3. Step-by-step derivation
                  1. Applied rewrites52.8%

                    \[\leadsto \frac{\color{blue}{y}}{t + t} \]
                4. Recombined 3 regimes into one program.
                5. Add Preprocessing

                Alternative 4: 82.0% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+107} \lor \neg \left(z \leq 1.4 \cdot 10^{+113}\right):\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{t + t}\\ \end{array} \end{array} \]
                (FPCore (x y z t)
                 :precision binary64
                 (if (or (<= z -1.6e+107) (not (<= z 1.4e+113)))
                   (* -0.5 (/ z t))
                   (/ (+ y x) (+ t t))))
                double code(double x, double y, double z, double t) {
                	double tmp;
                	if ((z <= -1.6e+107) || !(z <= 1.4e+113)) {
                		tmp = -0.5 * (z / t);
                	} else {
                		tmp = (y + x) / (t + t);
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: tmp
                    if ((z <= (-1.6d+107)) .or. (.not. (z <= 1.4d+113))) then
                        tmp = (-0.5d0) * (z / t)
                    else
                        tmp = (y + x) / (t + t)
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t) {
                	double tmp;
                	if ((z <= -1.6e+107) || !(z <= 1.4e+113)) {
                		tmp = -0.5 * (z / t);
                	} else {
                		tmp = (y + x) / (t + t);
                	}
                	return tmp;
                }
                
                def code(x, y, z, t):
                	tmp = 0
                	if (z <= -1.6e+107) or not (z <= 1.4e+113):
                		tmp = -0.5 * (z / t)
                	else:
                		tmp = (y + x) / (t + t)
                	return tmp
                
                function code(x, y, z, t)
                	tmp = 0.0
                	if ((z <= -1.6e+107) || !(z <= 1.4e+113))
                		tmp = Float64(-0.5 * Float64(z / t));
                	else
                		tmp = Float64(Float64(y + x) / Float64(t + t));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t)
                	tmp = 0.0;
                	if ((z <= -1.6e+107) || ~((z <= 1.4e+113)))
                		tmp = -0.5 * (z / t);
                	else
                		tmp = (y + x) / (t + t);
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.6e+107], N[Not[LessEqual[z, 1.4e+113]], $MachinePrecision]], N[(-0.5 * N[(z / t), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -1.6 \cdot 10^{+107} \lor \neg \left(z \leq 1.4 \cdot 10^{+113}\right):\\
                \;\;\;\;-0.5 \cdot \frac{z}{t}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{y + x}{t + t}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -1.60000000000000015e107 or 1.39999999999999999e113 < z

                  1. Initial program 99.9%

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

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

                    if -1.60000000000000015e107 < z < 1.39999999999999999e113

                    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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                      2. *-commutativeN/A

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

                        \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                      4. lower-+.f64100.0

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

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

                      \[\leadsto \frac{\color{blue}{x + y}}{t + t} \]
                    6. Step-by-step derivation
                      1. Applied rewrites86.7%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+107} \lor \neg \left(z \leq 1.4 \cdot 10^{+113}\right):\\ \;\;\;\;-0.5 \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{t + t}\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 5: 68.8% accurate, 0.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq -5 \cdot 10^{-237}:\\ \;\;\;\;\frac{x - z}{t + t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{t + t}\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (if (<= (+ x y) -5e-237) (/ (- x z) (+ t t)) (/ (- y z) (+ t t))))
                    double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if ((x + y) <= -5e-237) {
                    		tmp = (x - z) / (t + t);
                    	} else {
                    		tmp = (y - z) / (t + t);
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t)
                    use fmin_fmax_functions
                        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 + y) <= (-5d-237)) then
                            tmp = (x - z) / (t + t)
                        else
                            tmp = (y - z) / (t + t)
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double tmp;
                    	if ((x + y) <= -5e-237) {
                    		tmp = (x - z) / (t + t);
                    	} else {
                    		tmp = (y - z) / (t + t);
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	tmp = 0
                    	if (x + y) <= -5e-237:
                    		tmp = (x - z) / (t + t)
                    	else:
                    		tmp = (y - z) / (t + t)
                    	return tmp
                    
                    function code(x, y, z, t)
                    	tmp = 0.0
                    	if (Float64(x + y) <= -5e-237)
                    		tmp = Float64(Float64(x - z) / Float64(t + t));
                    	else
                    		tmp = Float64(Float64(y - z) / Float64(t + t));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	tmp = 0.0;
                    	if ((x + y) <= -5e-237)
                    		tmp = (x - z) / (t + t);
                    	else
                    		tmp = (y - z) / (t + t);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e-237], N[(N[(x - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;x + y \leq -5 \cdot 10^{-237}:\\
                    \;\;\;\;\frac{x - z}{t + t}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{y - z}{t + t}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (+.f64 x y) < -5.0000000000000002e-237

                      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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                        2. *-commutativeN/A

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

                          \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                        4. lower-+.f64100.0

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

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

                        \[\leadsto \frac{\color{blue}{x - z}}{t + t} \]
                      6. Step-by-step derivation
                        1. Applied rewrites72.2%

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

                        if -5.0000000000000002e-237 < (+.f64 x y)

                        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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                          2. *-commutativeN/A

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

                            \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                          4. lower-+.f64100.0

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

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

                          \[\leadsto \frac{\color{blue}{y} - z}{t + t} \]
                        6. Step-by-step derivation
                          1. Applied rewrites74.4%

                            \[\leadsto \frac{\color{blue}{y} - z}{t + t} \]
                        7. Recombined 2 regimes into one program.
                        8. Add Preprocessing

                        Alternative 6: 75.9% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + y \leq 10^{+62}:\\ \;\;\;\;\frac{x - z}{t + t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{t + t}\\ \end{array} \end{array} \]
                        (FPCore (x y z t)
                         :precision binary64
                         (if (<= (+ x y) 1e+62) (/ (- x z) (+ t t)) (/ (+ y x) (+ t t))))
                        double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((x + y) <= 1e+62) {
                        		tmp = (x - z) / (t + t);
                        	} else {
                        		tmp = (y + x) / (t + t);
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t)
                        use fmin_fmax_functions
                            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 + y) <= 1d+62) then
                                tmp = (x - z) / (t + t)
                            else
                                tmp = (y + x) / (t + t)
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t) {
                        	double tmp;
                        	if ((x + y) <= 1e+62) {
                        		tmp = (x - z) / (t + t);
                        	} else {
                        		tmp = (y + x) / (t + t);
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t):
                        	tmp = 0
                        	if (x + y) <= 1e+62:
                        		tmp = (x - z) / (t + t)
                        	else:
                        		tmp = (y + x) / (t + t)
                        	return tmp
                        
                        function code(x, y, z, t)
                        	tmp = 0.0
                        	if (Float64(x + y) <= 1e+62)
                        		tmp = Float64(Float64(x - z) / Float64(t + t));
                        	else
                        		tmp = Float64(Float64(y + x) / Float64(t + t));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t)
                        	tmp = 0.0;
                        	if ((x + y) <= 1e+62)
                        		tmp = (x - z) / (t + t);
                        	else
                        		tmp = (y + x) / (t + t);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e+62], N[(N[(x - z), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / N[(t + t), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x + y \leq 10^{+62}:\\
                        \;\;\;\;\frac{x - z}{t + t}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{y + x}{t + t}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (+.f64 x y) < 1.00000000000000004e62

                          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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                            2. *-commutativeN/A

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

                              \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                            4. lower-+.f64100.0

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

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

                            \[\leadsto \frac{\color{blue}{x - z}}{t + t} \]
                          6. Step-by-step derivation
                            1. Applied rewrites73.1%

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

                            if 1.00000000000000004e62 < (+.f64 x y)

                            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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                              2. *-commutativeN/A

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

                                \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                              4. lower-+.f64100.0

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

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

                              \[\leadsto \frac{\color{blue}{x + y}}{t + t} \]
                            6. Step-by-step derivation
                              1. Applied rewrites88.2%

                                \[\leadsto \frac{\color{blue}{y + x}}{t + t} \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 7: 37.5% accurate, 1.5× speedup?

                            \[\begin{array}{l} \\ \frac{x}{t + t} \end{array} \]
                            (FPCore (x y z t) :precision binary64 (/ x (+ t t)))
                            double code(double x, double y, double z, double t) {
                            	return x / (t + t);
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                code = x / (t + t)
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return x / (t + t);
                            }
                            
                            def code(x, y, z, t):
                            	return x / (t + t)
                            
                            function code(x, y, z, t)
                            	return Float64(x / Float64(t + t))
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = x / (t + t);
                            end
                            
                            code[x_, y_, z_, t_] := N[(x / N[(t + t), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{x}{t + 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 \frac{\left(x + y\right) - z}{\color{blue}{t \cdot 2}} \]
                              2. *-commutativeN/A

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

                                \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{t + t}} \]
                              4. lower-+.f64100.0

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

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

                              \[\leadsto \frac{\color{blue}{x}}{t + t} \]
                            6. Step-by-step derivation
                              1. Applied rewrites34.0%

                                \[\leadsto \frac{\color{blue}{x}}{t + t} \]
                              2. Add Preprocessing

                              Reproduce

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