Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.6% → 95.5%
Time: 4.9s
Alternatives: 11
Speedup: 1.1×

Specification

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

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

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

\\
x + \frac{\left(y - x\right) \cdot z}{t}
\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 11 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: 92.6% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 95.5% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - x}{t}, z, x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 1e297

    1. Initial program 97.6%

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

    if 1e297 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t))

    1. Initial program 54.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y - x}{t}} + x \]
      7. *-commutativeN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - x}{t}, z, x\right)} \]
      9. lower-/.f6499.9

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y - x}{t}}, z, x\right) \]
    4. Applied rewrites99.9%

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

Alternative 2: 83.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + \frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+303} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+199}\right):\\
\;\;\;\;\frac{y - x}{t} \cdot z\\

\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < -1e303 or 2.00000000000000019e199 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t))

    1. Initial program 79.0%

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

      \[\leadsto x + \frac{\color{blue}{y} \cdot z}{t} \]
    4. Step-by-step derivation
      1. Applied rewrites51.7%

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

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

          \[\leadsto \color{blue}{\frac{y \cdot z}{t} + x} \]
        3. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
        4. lift-*.f64N/A

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

          \[\leadsto \frac{\color{blue}{z \cdot y}}{t} + x \]
        6. associate-/l*N/A

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
        8. lower-/.f6464.0

          \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{t}}, x\right) \]
      3. Applied rewrites64.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
      4. Taylor expanded in z around inf

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

          \[\leadsto z \cdot \left(\frac{y}{t} - \frac{x}{t}\right) \]
        2. associate-*l/N/A

          \[\leadsto z \cdot \left(\frac{y}{t} - \frac{x}{t}\right) \]
        3. div-subN/A

          \[\leadsto z \cdot \frac{y - x}{\color{blue}{t}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{y - x}{t} \cdot \color{blue}{z} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{y - x}{t} \cdot \color{blue}{z} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{y - x}{t} \cdot z \]
        7. lower--.f6487.6

          \[\leadsto \frac{y - x}{t} \cdot z \]
      6. Applied rewrites87.6%

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

      if -1e303 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) z) t)) < 2.00000000000000019e199

      1. Initial program 98.6%

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

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

          \[\leadsto x + \frac{\color{blue}{y} \cdot z}{t} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification87.5%

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

      Alternative 3: 84.0% accurate, 0.7× speedup?

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

        1. Initial program 90.0%

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

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

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

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

              \[\leadsto \color{blue}{\frac{y \cdot z}{t} + x} \]
            3. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
            4. lift-*.f64N/A

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

              \[\leadsto \frac{\color{blue}{z \cdot y}}{t} + x \]
            6. associate-/l*N/A

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
            8. lower-/.f6485.4

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{t}}, x\right) \]
          3. Applied rewrites85.4%

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

          if -1.15000000000000003e-76 < t < 3.99999999999999983e-74

          1. Initial program 97.5%

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

            \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
          4. Step-by-step derivation
            1. div-subN/A

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

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

              \[\leadsto \frac{\left(y - x\right) \cdot z}{t} \]
            4. lower-/.f64N/A

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

              \[\leadsto \frac{\left(y - x\right) \cdot z}{t} \]
            6. lower--.f6485.1

              \[\leadsto \frac{\left(y - x\right) \cdot z}{t} \]
          5. Applied rewrites85.1%

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

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

        Alternative 4: 84.0% accurate, 0.7× speedup?

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

          1. Initial program 92.2%

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

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

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

              \[\leadsto \left(1 + -1 \cdot \frac{z}{t}\right) \cdot \color{blue}{x} \]
            3. fp-cancel-sign-sub-invN/A

              \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right) \cdot x \]
            4. metadata-evalN/A

              \[\leadsto \left(1 - 1 \cdot \frac{z}{t}\right) \cdot x \]
            5. *-lft-identityN/A

              \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
            6. lower--.f64N/A

              \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
            7. lower-/.f6495.4

              \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
          5. Applied rewrites95.4%

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

          if -1.8500000000000001e-6 < x < 1.55000000000000001e84

          1. Initial program 93.0%

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

            \[\leadsto x + \frac{\color{blue}{y} \cdot z}{t} \]
          4. Step-by-step derivation
            1. Applied rewrites81.8%

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

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

                \[\leadsto \color{blue}{\frac{y \cdot z}{t} + x} \]
              3. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
              4. lift-*.f64N/A

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

                \[\leadsto \frac{\color{blue}{z \cdot y}}{t} + x \]
              6. associate-/l*N/A

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
              8. lower-/.f6480.0

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{t}}, x\right) \]
            3. Applied rewrites80.0%

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

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

          Alternative 5: 72.1% accurate, 0.7× speedup?

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

            1. Initial program 92.0%

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

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

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

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

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t} + x} \]
                3. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
                4. lift-*.f64N/A

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

                  \[\leadsto \frac{\color{blue}{z \cdot y}}{t} + x \]
                6. associate-/l*N/A

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
                8. lower-/.f6482.0

                  \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{t}}, x\right) \]
              3. Applied rewrites82.0%

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

              if -6.1999999999999999e-211 < t < 1.22e-191

              1. Initial program 97.3%

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

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

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

                  \[\leadsto \left(1 + -1 \cdot \frac{z}{t}\right) \cdot \color{blue}{x} \]
                3. fp-cancel-sign-sub-invN/A

                  \[\leadsto \left(1 - \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{z}{t}\right) \cdot x \]
                4. metadata-evalN/A

                  \[\leadsto \left(1 - 1 \cdot \frac{z}{t}\right) \cdot x \]
                5. *-lft-identityN/A

                  \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
                6. lower--.f64N/A

                  \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
                7. lower-/.f6461.2

                  \[\leadsto \left(1 - \frac{z}{t}\right) \cdot x \]
              5. Applied rewrites61.2%

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

                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot z}{t}} \]
              7. Step-by-step derivation
                1. associate-*r/N/A

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

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

                  \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                4. associate-*r/N/A

                  \[\leadsto \left(-1 \cdot \frac{x}{t}\right) \cdot z \]
                5. lower-*.f64N/A

                  \[\leadsto \left(-1 \cdot \frac{x}{t}\right) \cdot z \]
                6. associate-*r/N/A

                  \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                7. lower-/.f64N/A

                  \[\leadsto \frac{-1 \cdot x}{t} \cdot z \]
                8. mul-1-negN/A

                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{t} \cdot z \]
                9. lower-neg.f6460.9

                  \[\leadsto \frac{-x}{t} \cdot z \]
              8. Applied rewrites60.9%

                \[\leadsto \frac{-x}{t} \cdot \color{blue}{z} \]
            5. Recombined 2 regimes into one program.
            6. Final simplification79.1%

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

            Alternative 6: 48.9% accurate, 0.8× speedup?

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

              1. Initial program 89.9%

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

                \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
              4. Step-by-step derivation
                1. associate-*l/N/A

                  \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                3. lower-/.f6455.4

                  \[\leadsto \frac{y}{t} \cdot z \]
              5. Applied rewrites55.4%

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

              if -2.05000000000000003e-132 < y < 3.19999999999999996e-91

              1. Initial program 97.9%

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

                \[\leadsto \color{blue}{x} \]
              4. Step-by-step derivation
                1. Applied rewrites61.8%

                  \[\leadsto \color{blue}{x} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification57.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-132} \lor \neg \left(y \leq 3.2 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
              7. Add Preprocessing

              Alternative 7: 50.0% accurate, 0.8× speedup?

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

                1. Initial program 86.0%

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

                  \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                4. Step-by-step derivation
                  1. associate-*l/N/A

                    \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                  3. lower-/.f6463.6

                    \[\leadsto \frac{y}{t} \cdot z \]
                5. Applied rewrites63.6%

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

                if -2.05000000000000003e-132 < y < 3.19999999999999996e-91

                1. Initial program 97.9%

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

                  \[\leadsto \color{blue}{x} \]
                4. Step-by-step derivation
                  1. Applied rewrites61.8%

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

                  if 3.19999999999999996e-91 < y

                  1. Initial program 94.0%

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)} \]
                    8. lower-/.f6496.2

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y - x, x\right) \]
                  4. Applied rewrites96.2%

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

                    \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                  6. Step-by-step derivation
                    1. *-commutativeN/A

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

                      \[\leadsto \frac{z}{t} \cdot \color{blue}{y} \]
                    3. lower-*.f64N/A

                      \[\leadsto \frac{z}{t} \cdot \color{blue}{y} \]
                    4. lower-/.f6454.4

                      \[\leadsto \frac{z}{t} \cdot y \]
                  7. Applied rewrites54.4%

                    \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
                5. Recombined 3 regimes into one program.
                6. Final simplification60.1%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-132}:\\ \;\;\;\;\frac{y}{t} \cdot z\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \end{array} \]
                7. Add Preprocessing

                Alternative 8: 48.8% accurate, 0.8× speedup?

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

                  1. Initial program 86.0%

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

                    \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                  4. Step-by-step derivation
                    1. associate-*l/N/A

                      \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                    3. lower-/.f6463.6

                      \[\leadsto \frac{y}{t} \cdot z \]
                  5. Applied rewrites63.6%

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

                  if -2.05000000000000003e-132 < y < 3.19999999999999996e-91

                  1. Initial program 97.9%

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

                    \[\leadsto \color{blue}{x} \]
                  4. Step-by-step derivation
                    1. Applied rewrites61.8%

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

                    if 3.19999999999999996e-91 < y

                    1. Initial program 94.0%

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

                      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
                    4. Step-by-step derivation
                      1. associate-*l/N/A

                        \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                      2. lower-*.f64N/A

                        \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                      3. lower-/.f6446.7

                        \[\leadsto \frac{y}{t} \cdot z \]
                    5. Applied rewrites46.7%

                      \[\leadsto \color{blue}{\frac{y}{t} \cdot z} \]
                    6. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \frac{y}{t} \cdot \color{blue}{z} \]
                      2. *-commutativeN/A

                        \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
                      3. lift-/.f64N/A

                        \[\leadsto z \cdot \frac{y}{\color{blue}{t}} \]
                      4. associate-*r/N/A

                        \[\leadsto \frac{z \cdot y}{\color{blue}{t}} \]
                      5. lower-/.f64N/A

                        \[\leadsto \frac{z \cdot y}{\color{blue}{t}} \]
                      6. *-commutativeN/A

                        \[\leadsto \frac{y \cdot z}{t} \]
                      7. lower-*.f6453.6

                        \[\leadsto \frac{y \cdot z}{t} \]
                    7. Applied rewrites53.6%

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

                  Alternative 9: 97.5% accurate, 1.1× speedup?

                  \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{z}{t}, y - x, x\right) \end{array} \]
                  (FPCore (x y z t) :precision binary64 (fma (/ z t) (- y x) x))
                  double code(double x, double y, double z, double t) {
                  	return fma((z / t), (y - x), x);
                  }
                  
                  function code(x, y, z, t)
                  	return fma(Float64(z / t), Float64(y - x), x)
                  end
                  
                  code[x_, y_, z_, t_] := N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision] + x), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \mathsf{fma}\left(\frac{z}{t}, y - x, x\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 92.7%

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{z}{t}, y - x, x\right)} \]
                    8. lower-/.f6495.0

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y - x, x\right) \]
                  4. Applied rewrites95.0%

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

                  Alternative 10: 72.9% accurate, 1.3× speedup?

                  \[\begin{array}{l} \\ \mathsf{fma}\left(z, \frac{y}{t}, x\right) \end{array} \]
                  (FPCore (x y z t) :precision binary64 (fma z (/ y t) x))
                  double code(double x, double y, double z, double t) {
                  	return fma(z, (y / t), x);
                  }
                  
                  function code(x, y, z, t)
                  	return fma(z, Float64(y / t), x)
                  end
                  
                  code[x_, y_, z_, t_] := N[(z * N[(y / t), $MachinePrecision] + x), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \mathsf{fma}\left(z, \frac{y}{t}, x\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 92.7%

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

                    \[\leadsto x + \frac{\color{blue}{y} \cdot z}{t} \]
                  4. Step-by-step derivation
                    1. Applied rewrites76.7%

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

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

                        \[\leadsto \color{blue}{\frac{y \cdot z}{t} + x} \]
                      3. lift-/.f64N/A

                        \[\leadsto \color{blue}{\frac{y \cdot z}{t}} + x \]
                      4. lift-*.f64N/A

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

                        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} + x \]
                      6. associate-/l*N/A

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
                      8. lower-/.f6475.8

                        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\frac{y}{t}}, x\right) \]
                    3. Applied rewrites75.8%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \frac{y}{t}, x\right)} \]
                    4. Add Preprocessing

                    Alternative 11: 38.4% accurate, 23.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 92.7%

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

                      \[\leadsto \color{blue}{x} \]
                    4. Step-by-step derivation
                      1. Applied rewrites39.7%

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

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

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array} \end{array} \]
                      (FPCore (x y z t)
                       :precision binary64
                       (if (< x -9.025511195533005e-135)
                         (- x (* (/ z t) (- x y)))
                         (if (< x 4.275032163700715e-250)
                           (+ x (* (/ (- y x) t) z))
                           (+ x (/ (- y x) (/ t z))))))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (x < -9.025511195533005e-135) {
                      		tmp = x - ((z / t) * (x - y));
                      	} else if (x < 4.275032163700715e-250) {
                      		tmp = x + (((y - x) / t) * z);
                      	} else {
                      		tmp = x + ((y - x) / (t / 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 (x < (-9.025511195533005d-135)) then
                              tmp = x - ((z / t) * (x - y))
                          else if (x < 4.275032163700715d-250) then
                              tmp = x + (((y - x) / t) * z)
                          else
                              tmp = x + ((y - x) / (t / z))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (x < -9.025511195533005e-135) {
                      		tmp = x - ((z / t) * (x - y));
                      	} else if (x < 4.275032163700715e-250) {
                      		tmp = x + (((y - x) / t) * z);
                      	} else {
                      		tmp = x + ((y - x) / (t / z));
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	tmp = 0
                      	if x < -9.025511195533005e-135:
                      		tmp = x - ((z / t) * (x - y))
                      	elif x < 4.275032163700715e-250:
                      		tmp = x + (((y - x) / t) * z)
                      	else:
                      		tmp = x + ((y - x) / (t / z))
                      	return tmp
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (x < -9.025511195533005e-135)
                      		tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y)));
                      	elseif (x < 4.275032163700715e-250)
                      		tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z));
                      	else
                      		tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	tmp = 0.0;
                      	if (x < -9.025511195533005e-135)
                      		tmp = x - ((z / t) * (x - y));
                      	elseif (x < 4.275032163700715e-250)
                      		tmp = x + (((y - x) / t) * z);
                      	else
                      		tmp = x + ((y - x) / (t / z));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
                      \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\
                      
                      \mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
                      \;\;\;\;x + \frac{y - x}{t} \cdot z\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
                      
                      
                      \end{array}
                      \end{array}
                      

                      Reproduce

                      ?
                      herbie shell --seed 2025026 
                      (FPCore (x y z t)
                        :name "Numeric.Histogram:binBounds from Chart-1.5.3"
                        :precision binary64
                      
                        :alt
                        (! :herbie-platform default (if (< x -1805102239106601/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- x (* (/ z t) (- x y))) (if (< x 855006432740143/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z))))))
                      
                        (+ x (/ (* (- y x) z) t)))