Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.2s
Alternatives: 13
Speedup: 1.0×

Specification

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

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\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 13 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: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 66.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ t_2 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -1.4 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-239}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-23}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq 4.4 \cdot 10^{+21}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- t x) y)) (t_2 (* (- y z) t)))
   (if (<= y -1.4e+31)
     t_1
     (if (<= y -3.5e-239)
       t_2
       (if (<= y 7e-23) (fma z x x) (if (<= y 4.4e+21) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (t - x) * y;
	double t_2 = (y - z) * t;
	double tmp;
	if (y <= -1.4e+31) {
		tmp = t_1;
	} else if (y <= -3.5e-239) {
		tmp = t_2;
	} else if (y <= 7e-23) {
		tmp = fma(z, x, x);
	} else if (y <= 4.4e+21) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(t - x) * y)
	t_2 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (y <= -1.4e+31)
		tmp = t_1;
	elseif (y <= -3.5e-239)
		tmp = t_2;
	elseif (y <= 7e-23)
		tmp = fma(z, x, x);
	elseif (y <= 4.4e+21)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -1.4e+31], t$95$1, If[LessEqual[y, -3.5e-239], t$95$2, If[LessEqual[y, 7e-23], N[(z * x + x), $MachinePrecision], If[LessEqual[y, 4.4e+21], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(t - x\right) \cdot y\\
t_2 := \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-239}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\

\mathbf{elif}\;y \leq 4.4 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.40000000000000008e31 or 4.4e21 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
    4. Step-by-step derivation
      1. Applied rewrites87.3%

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

      if -1.40000000000000008e31 < y < -3.50000000000000005e-239 or 6.99999999999999987e-23 < y < 4.4e21

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
      4. Step-by-step derivation
        1. Applied rewrites60.8%

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

        if -3.50000000000000005e-239 < y < 6.99999999999999987e-23

        1. Initial program 100.0%

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

          \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
        4. Step-by-step derivation
          1. Applied rewrites67.4%

            \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
          2. Taylor expanded in y around 0

            \[\leadsto x \cdot \color{blue}{\left(1 + z\right)} \]
          3. Step-by-step derivation
            1. Applied rewrites67.4%

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

          Alternative 3: 84.6% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+41} \lor \neg \left(y \leq 1.45 \cdot 10^{+22}\right):\\ \;\;\;\;\left(t - x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \left(t - x\right) \cdot z\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (or (<= y -9e+41) (not (<= y 1.45e+22)))
             (* (- t x) y)
             (- x (* (- t x) z))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if ((y <= -9e+41) || !(y <= 1.45e+22)) {
          		tmp = (t - x) * y;
          	} else {
          		tmp = x - ((t - x) * z);
          	}
          	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 ((y <= (-9d+41)) .or. (.not. (y <= 1.45d+22))) then
                  tmp = (t - x) * y
              else
                  tmp = x - ((t - x) * z)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if ((y <= -9e+41) || !(y <= 1.45e+22)) {
          		tmp = (t - x) * y;
          	} else {
          		tmp = x - ((t - x) * z);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if (y <= -9e+41) or not (y <= 1.45e+22):
          		tmp = (t - x) * y
          	else:
          		tmp = x - ((t - x) * z)
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if ((y <= -9e+41) || !(y <= 1.45e+22))
          		tmp = Float64(Float64(t - x) * y);
          	else
          		tmp = Float64(x - Float64(Float64(t - x) * z));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if ((y <= -9e+41) || ~((y <= 1.45e+22)))
          		tmp = (t - x) * y;
          	else
          		tmp = x - ((t - x) * z);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e+41], N[Not[LessEqual[y, 1.45e+22]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision], N[(x - N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -9 \cdot 10^{+41} \lor \neg \left(y \leq 1.45 \cdot 10^{+22}\right):\\
          \;\;\;\;\left(t - x\right) \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;x - \left(t - x\right) \cdot z\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -9.0000000000000002e41 or 1.45e22 < y

            1. Initial program 100.0%

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

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

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

              if -9.0000000000000002e41 < y < 1.45e22

              1. Initial program 100.0%

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

                \[\leadsto \color{blue}{x + -1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
              4. Step-by-step derivation
                1. Applied rewrites85.2%

                  \[\leadsto \color{blue}{x - \left(t - x\right) \cdot z} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification87.2%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+41} \lor \neg \left(y \leq 1.45 \cdot 10^{+22}\right):\\ \;\;\;\;\left(t - x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;x - \left(t - x\right) \cdot z\\ \end{array} \]
              7. Add Preprocessing

              Alternative 4: 36.9% accurate, 0.6× speedup?

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

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                4. Step-by-step derivation
                  1. Applied rewrites58.3%

                    \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                  2. Taylor expanded in z around inf

                    \[\leadsto z \cdot x \]
                  3. Step-by-step derivation
                    1. Applied rewrites31.6%

                      \[\leadsto z \cdot x \]

                    if -4.9999999999999998e34 < (-.f64 y z) < 5.0000000000000004e-19

                    1. Initial program 100.0%

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

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

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

                        \[\leadsto x \]
                      3. Step-by-step derivation
                        1. Applied rewrites62.1%

                          \[\leadsto x \]

                        if 5.0000000000000004e-19 < (-.f64 y z)

                        1. Initial program 100.0%

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

                          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                        4. Step-by-step derivation
                          1. Applied rewrites53.7%

                            \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
                          2. Taylor expanded in y around inf

                            \[\leadsto y \cdot t \]
                          3. Step-by-step derivation
                            1. Applied rewrites32.0%

                              \[\leadsto y \cdot t \]
                          4. Recombined 3 regimes into one program.
                          5. Add Preprocessing

                          Alternative 5: 84.7% accurate, 0.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+31} \lor \neg \left(z \leq 6 \cdot 10^{+21}\right):\\ \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \end{array} \]
                          (FPCore (x y z t)
                           :precision binary64
                           (if (or (<= z -5.2e+31) (not (<= z 6e+21)))
                             (* (- z) (- t x))
                             (fma (- t x) y x)))
                          double code(double x, double y, double z, double t) {
                          	double tmp;
                          	if ((z <= -5.2e+31) || !(z <= 6e+21)) {
                          		tmp = -z * (t - x);
                          	} else {
                          		tmp = fma((t - x), y, x);
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t)
                          	tmp = 0.0
                          	if ((z <= -5.2e+31) || !(z <= 6e+21))
                          		tmp = Float64(Float64(-z) * Float64(t - x));
                          	else
                          		tmp = fma(Float64(t - x), y, x);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.2e+31], N[Not[LessEqual[z, 6e+21]], $MachinePrecision]], N[((-z) * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -5.2 \cdot 10^{+31} \lor \neg \left(z \leq 6 \cdot 10^{+21}\right):\\
                          \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -5.2e31 or 6e21 < z

                            1. Initial program 100.0%

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

                              \[\leadsto x + \color{blue}{z \cdot \left(-1 \cdot \left(t - x\right) + \frac{y \cdot \left(t - x\right)}{z}\right)} \]
                            4. Step-by-step derivation
                              1. Applied rewrites99.9%

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

                                \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
                              3. Step-by-step derivation
                                1. Applied rewrites78.0%

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

                                if -5.2e31 < z < 6e21

                                1. Initial program 100.0%

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

                                  \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites92.6%

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+31} \lor \neg \left(z \leq 6 \cdot 10^{+21}\right):\\ \;\;\;\;\left(-z\right) \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 6: 74.2% accurate, 0.7× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{-60} \lor \neg \left(t \leq 1.7 \cdot 10^{-68}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z - y, x, x\right)\\ \end{array} \end{array} \]
                                (FPCore (x y z t)
                                 :precision binary64
                                 (if (or (<= t -1.12e-60) (not (<= t 1.7e-68)))
                                   (* (- y z) t)
                                   (fma (- z y) x x)))
                                double code(double x, double y, double z, double t) {
                                	double tmp;
                                	if ((t <= -1.12e-60) || !(t <= 1.7e-68)) {
                                		tmp = (y - z) * t;
                                	} else {
                                		tmp = fma((z - y), x, x);
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, t)
                                	tmp = 0.0
                                	if ((t <= -1.12e-60) || !(t <= 1.7e-68))
                                		tmp = Float64(Float64(y - z) * t);
                                	else
                                		tmp = fma(Float64(z - y), x, x);
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.12e-60], N[Not[LessEqual[t, 1.7e-68]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(N[(z - y), $MachinePrecision] * x + x), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;t \leq -1.12 \cdot 10^{-60} \lor \neg \left(t \leq 1.7 \cdot 10^{-68}\right):\\
                                \;\;\;\;\left(y - z\right) \cdot t\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(z - y, x, x\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if t < -1.12e-60 or 1.70000000000000009e-68 < t

                                  1. Initial program 100.0%

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

                                    \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites76.5%

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

                                    if -1.12e-60 < t < 1.70000000000000009e-68

                                    1. Initial program 100.0%

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

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

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

                                        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites86.2%

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{-60} \lor \neg \left(t \leq 1.7 \cdot 10^{-68}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z - y, x, x\right)\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 7: 71.6% accurate, 0.7× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1800000 \lor \neg \left(z \leq 7.2 \cdot 10^{+98}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \end{array} \]
                                      (FPCore (x y z t)
                                       :precision binary64
                                       (if (or (<= z -1800000.0) (not (<= z 7.2e+98)))
                                         (* (- y z) t)
                                         (fma (- t x) y x)))
                                      double code(double x, double y, double z, double t) {
                                      	double tmp;
                                      	if ((z <= -1800000.0) || !(z <= 7.2e+98)) {
                                      		tmp = (y - z) * t;
                                      	} else {
                                      		tmp = fma((t - x), y, x);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(x, y, z, t)
                                      	tmp = 0.0
                                      	if ((z <= -1800000.0) || !(z <= 7.2e+98))
                                      		tmp = Float64(Float64(y - z) * t);
                                      	else
                                      		tmp = fma(Float64(t - x), y, x);
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1800000.0], N[Not[LessEqual[z, 7.2e+98]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;z \leq -1800000 \lor \neg \left(z \leq 7.2 \cdot 10^{+98}\right):\\
                                      \;\;\;\;\left(y - z\right) \cdot t\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if z < -1.8e6 or 7.19999999999999962e98 < z

                                        1. Initial program 100.0%

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

                                          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites58.7%

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

                                          if -1.8e6 < z < 7.19999999999999962e98

                                          1. Initial program 100.0%

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

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

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
                                          5. Recombined 2 regimes into one program.
                                          6. Final simplification74.8%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1800000 \lor \neg \left(z \leq 7.2 \cdot 10^{+98}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \end{array} \]
                                          7. Add Preprocessing

                                          Alternative 8: 68.3% accurate, 0.7× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -63000000000000 \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\ \;\;\;\;\left(t - x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z t)
                                           :precision binary64
                                           (if (or (<= y -63000000000000.0) (not (<= y 1.15e-16)))
                                             (* (- t x) y)
                                             (fma z x x)))
                                          double code(double x, double y, double z, double t) {
                                          	double tmp;
                                          	if ((y <= -63000000000000.0) || !(y <= 1.15e-16)) {
                                          		tmp = (t - x) * y;
                                          	} else {
                                          		tmp = fma(z, x, x);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z, t)
                                          	tmp = 0.0
                                          	if ((y <= -63000000000000.0) || !(y <= 1.15e-16))
                                          		tmp = Float64(Float64(t - x) * y);
                                          	else
                                          		tmp = fma(z, x, x);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_, t_] := If[Or[LessEqual[y, -63000000000000.0], N[Not[LessEqual[y, 1.15e-16]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision], N[(z * x + x), $MachinePrecision]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;y \leq -63000000000000 \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\
                                          \;\;\;\;\left(t - x\right) \cdot y\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if y < -6.3e13 or 1.15e-16 < y

                                            1. Initial program 100.0%

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

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

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

                                              if -6.3e13 < y < 1.15e-16

                                              1. Initial program 100.0%

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

                                                \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                              4. Step-by-step derivation
                                                1. Applied rewrites60.2%

                                                  \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                                                2. Taylor expanded in y around 0

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

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

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -63000000000000 \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\ \;\;\;\;\left(t - x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \]
                                                6. Add Preprocessing

                                                Alternative 9: 50.6% accurate, 0.7× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+41} \lor \neg \left(y \leq 3.2 \cdot 10^{+22}\right):\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \end{array} \]
                                                (FPCore (x y z t)
                                                 :precision binary64
                                                 (if (or (<= y -4.8e+41) (not (<= y 3.2e+22))) (* (- x) y) (fma z x x)))
                                                double code(double x, double y, double z, double t) {
                                                	double tmp;
                                                	if ((y <= -4.8e+41) || !(y <= 3.2e+22)) {
                                                		tmp = -x * y;
                                                	} else {
                                                		tmp = fma(z, x, x);
                                                	}
                                                	return tmp;
                                                }
                                                
                                                function code(x, y, z, t)
                                                	tmp = 0.0
                                                	if ((y <= -4.8e+41) || !(y <= 3.2e+22))
                                                		tmp = Float64(Float64(-x) * y);
                                                	else
                                                		tmp = fma(z, x, x);
                                                	end
                                                	return tmp
                                                end
                                                
                                                code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.8e+41], N[Not[LessEqual[y, 3.2e+22]], $MachinePrecision]], N[((-x) * y), $MachinePrecision], N[(z * x + x), $MachinePrecision]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;y \leq -4.8 \cdot 10^{+41} \lor \neg \left(y \leq 3.2 \cdot 10^{+22}\right):\\
                                                \;\;\;\;\left(-x\right) \cdot y\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if y < -4.8000000000000003e41 or 3.2e22 < y

                                                  1. Initial program 100.0%

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

                                                    \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites89.0%

                                                      \[\leadsto \color{blue}{\left(t - x\right) \cdot y} \]
                                                    2. Taylor expanded in x around inf

                                                      \[\leadsto \left(-1 \cdot x\right) \cdot y \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites54.0%

                                                        \[\leadsto \left(-x\right) \cdot y \]

                                                      if -4.8000000000000003e41 < y < 3.2e22

                                                      1. Initial program 100.0%

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

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

                                                          \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                                                        2. Taylor expanded in y around 0

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

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

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+41} \lor \neg \left(y \leq 3.2 \cdot 10^{+22}\right):\\ \;\;\;\;\left(-x\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \]
                                                        6. Add Preprocessing

                                                        Alternative 10: 54.2% accurate, 0.8× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+36} \lor \neg \left(z \leq 6 \cdot 10^{+20}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t)
                                                         :precision binary64
                                                         (if (or (<= z -9.2e+36) (not (<= z 6e+20))) (* z x) (fma t y x)))
                                                        double code(double x, double y, double z, double t) {
                                                        	double tmp;
                                                        	if ((z <= -9.2e+36) || !(z <= 6e+20)) {
                                                        		tmp = z * x;
                                                        	} else {
                                                        		tmp = fma(t, y, x);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x, y, z, t)
                                                        	tmp = 0.0
                                                        	if ((z <= -9.2e+36) || !(z <= 6e+20))
                                                        		tmp = Float64(z * x);
                                                        	else
                                                        		tmp = fma(t, y, x);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.2e+36], N[Not[LessEqual[z, 6e+20]], $MachinePrecision]], N[(z * x), $MachinePrecision], N[(t * y + x), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;z \leq -9.2 \cdot 10^{+36} \lor \neg \left(z \leq 6 \cdot 10^{+20}\right):\\
                                                        \;\;\;\;z \cdot x\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if z < -9.19999999999999986e36 or 6e20 < z

                                                          1. Initial program 100.0%

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

                                                            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites52.8%

                                                              \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                                                            2. Taylor expanded in z around inf

                                                              \[\leadsto z \cdot x \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites39.3%

                                                                \[\leadsto z \cdot x \]

                                                              if -9.19999999999999986e36 < z < 6e20

                                                              1. Initial program 100.0%

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

                                                                \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites92.6%

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

                                                                  \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites61.3%

                                                                    \[\leadsto \mathsf{fma}\left(t, y, x\right) \]
                                                                4. Recombined 2 regimes into one program.
                                                                5. Final simplification51.1%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.2 \cdot 10^{+36} \lor \neg \left(z \leq 6 \cdot 10^{+20}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t, y, x\right)\\ \end{array} \]
                                                                6. Add Preprocessing

                                                                Alternative 11: 49.8% accurate, 0.8× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+67} \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \end{array} \]
                                                                (FPCore (x y z t)
                                                                 :precision binary64
                                                                 (if (or (<= y -2.05e+67) (not (<= y 1.15e-16))) (* y t) (fma z x x)))
                                                                double code(double x, double y, double z, double t) {
                                                                	double tmp;
                                                                	if ((y <= -2.05e+67) || !(y <= 1.15e-16)) {
                                                                		tmp = y * t;
                                                                	} else {
                                                                		tmp = fma(z, x, x);
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(x, y, z, t)
                                                                	tmp = 0.0
                                                                	if ((y <= -2.05e+67) || !(y <= 1.15e-16))
                                                                		tmp = Float64(y * t);
                                                                	else
                                                                		tmp = fma(z, x, x);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.05e+67], N[Not[LessEqual[y, 1.15e-16]], $MachinePrecision]], N[(y * t), $MachinePrecision], N[(z * x + x), $MachinePrecision]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;y \leq -2.05 \cdot 10^{+67} \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\
                                                                \;\;\;\;y \cdot t\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if y < -2.0499999999999999e67 or 1.15e-16 < y

                                                                  1. Initial program 100.0%

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

                                                                    \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites49.7%

                                                                      \[\leadsto \color{blue}{\left(y - z\right) \cdot t} \]
                                                                    2. Taylor expanded in y around inf

                                                                      \[\leadsto y \cdot t \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites41.3%

                                                                        \[\leadsto y \cdot t \]

                                                                      if -2.0499999999999999e67 < y < 1.15e-16

                                                                      1. Initial program 100.0%

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

                                                                        \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites59.5%

                                                                          \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                                                                        2. Taylor expanded in y around 0

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

                                                                            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
                                                                        4. Recombined 2 regimes into one program.
                                                                        5. Final simplification49.0%

                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+67} \lor \neg \left(y \leq 1.15 \cdot 10^{-16}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \]
                                                                        6. Add Preprocessing

                                                                        Alternative 12: 36.8% accurate, 0.8× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1600 \lor \neg \left(z \leq 1.95 \cdot 10^{+34}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                                                                        (FPCore (x y z t)
                                                                         :precision binary64
                                                                         (if (or (<= z -1600.0) (not (<= z 1.95e+34))) (* z x) x))
                                                                        double code(double x, double y, double z, double t) {
                                                                        	double tmp;
                                                                        	if ((z <= -1600.0) || !(z <= 1.95e+34)) {
                                                                        		tmp = z * x;
                                                                        	} else {
                                                                        		tmp = x;
                                                                        	}
                                                                        	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 <= (-1600.0d0)) .or. (.not. (z <= 1.95d+34))) then
                                                                                tmp = z * x
                                                                            else
                                                                                tmp = x
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        public static double code(double x, double y, double z, double t) {
                                                                        	double tmp;
                                                                        	if ((z <= -1600.0) || !(z <= 1.95e+34)) {
                                                                        		tmp = z * x;
                                                                        	} else {
                                                                        		tmp = x;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x, y, z, t):
                                                                        	tmp = 0
                                                                        	if (z <= -1600.0) or not (z <= 1.95e+34):
                                                                        		tmp = z * x
                                                                        	else:
                                                                        		tmp = x
                                                                        	return tmp
                                                                        
                                                                        function code(x, y, z, t)
                                                                        	tmp = 0.0
                                                                        	if ((z <= -1600.0) || !(z <= 1.95e+34))
                                                                        		tmp = Float64(z * x);
                                                                        	else
                                                                        		tmp = x;
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x, y, z, t)
                                                                        	tmp = 0.0;
                                                                        	if ((z <= -1600.0) || ~((z <= 1.95e+34)))
                                                                        		tmp = z * x;
                                                                        	else
                                                                        		tmp = x;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1600.0], N[Not[LessEqual[z, 1.95e+34]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;z \leq -1600 \lor \neg \left(z \leq 1.95 \cdot 10^{+34}\right):\\
                                                                        \;\;\;\;z \cdot x\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;x\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if z < -1600 or 1.9500000000000001e34 < z

                                                                          1. Initial program 100.0%

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

                                                                            \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites52.0%

                                                                              \[\leadsto \color{blue}{\left(1 - \left(y - z\right)\right) \cdot x} \]
                                                                            2. Taylor expanded in z around inf

                                                                              \[\leadsto z \cdot x \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites39.3%

                                                                                \[\leadsto z \cdot x \]

                                                                              if -1600 < z < 1.9500000000000001e34

                                                                              1. Initial program 100.0%

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

                                                                                \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites91.9%

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

                                                                                  \[\leadsto x \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites29.5%

                                                                                    \[\leadsto x \]
                                                                                4. Recombined 2 regimes into one program.
                                                                                5. Final simplification34.0%

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1600 \lor \neg \left(z \leq 1.95 \cdot 10^{+34}\right):\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
                                                                                6. Add Preprocessing

                                                                                Alternative 13: 18.0% accurate, 15.0× speedup?

                                                                                \[\begin{array}{l} \\ x \end{array} \]
                                                                                (FPCore (x y z t) :precision binary64 x)
                                                                                double code(double x, double y, double z, double t) {
                                                                                	return x;
                                                                                }
                                                                                
                                                                                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
                                                                                end function
                                                                                
                                                                                public static double code(double x, double y, double z, double t) {
                                                                                	return x;
                                                                                }
                                                                                
                                                                                def code(x, y, z, t):
                                                                                	return x
                                                                                
                                                                                function code(x, y, z, t)
                                                                                	return x
                                                                                end
                                                                                
                                                                                function tmp = code(x, y, z, t)
                                                                                	tmp = x;
                                                                                end
                                                                                
                                                                                code[x_, y_, z_, t_] := x
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                x
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Initial program 100.0%

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

                                                                                  \[\leadsto \color{blue}{x + y \cdot \left(t - x\right)} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites63.9%

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

                                                                                    \[\leadsto x \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites17.2%

                                                                                      \[\leadsto x \]
                                                                                    2. Add Preprocessing

                                                                                    Developer Target 1: 96.2% accurate, 0.6× speedup?

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

                                                                                    Reproduce

                                                                                    ?
                                                                                    herbie shell --seed 2025022 
                                                                                    (FPCore (x y z t)
                                                                                      :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
                                                                                      :precision binary64
                                                                                    
                                                                                      :alt
                                                                                      (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
                                                                                    
                                                                                      (+ x (* (- y z) (- t x))))