Numeric.Histogram:binBounds from Chart-1.5.3

Percentage Accurate: 92.7% → 97.7%
Time: 3.4s
Alternatives: 8
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 8 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.7% 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: 97.7% 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.1%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y - x, x\right) \]
    10. lift--.f6497.0

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

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

Alternative 2: 85.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-97} \lor \neg \left(y \leq 4.8 \cdot 10^{-120}\right):\\ \;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{z}{t}, -x, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -3.8e-97) (not (<= y 4.8e-120)))
   (fma y (/ z t) x)
   (fma (/ z t) (- x) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -3.8e-97) || !(y <= 4.8e-120)) {
		tmp = fma(y, (z / t), x);
	} else {
		tmp = fma((z / t), -x, x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -3.8e-97) || !(y <= 4.8e-120))
		tmp = fma(y, Float64(z / t), x);
	else
		tmp = fma(Float64(z / t), Float64(-x), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8e-97], N[Not[LessEqual[y, 4.8e-120]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision] + x), $MachinePrecision], N[(N[(z / t), $MachinePrecision] * (-x) + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-97} \lor \neg \left(y \leq 4.8 \cdot 10^{-120}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{t}, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8000000000000001e-97 or 4.7999999999999999e-120 < y

    1. Initial program 90.8%

      \[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 rewrites82.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. associate-/l*N/A

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)} \]
        7. lift-/.f6487.7

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

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

      if -3.8000000000000001e-97 < y < 4.7999999999999999e-120

      1. Initial program 95.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. lift-/.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y - x, x\right) \]
        10. lift--.f6496.3

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

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

        \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \color{blue}{-1 \cdot x}, x\right) \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{fma}\left(\frac{z}{t}, \mathsf{neg}\left(x\right), x\right) \]
        2. lower-neg.f6490.5

          \[\leadsto \mathsf{fma}\left(\frac{z}{t}, -x, x\right) \]
      7. Applied rewrites90.5%

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

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

    Alternative 3: 85.3% accurate, 0.7× speedup?

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

      1. Initial program 90.8%

        \[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 rewrites82.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. associate-/l*N/A

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z}{t}, x\right)} \]
          7. lift-/.f6487.7

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

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

        if -3.8000000000000001e-97 < y < 4.7999999999999999e-120

        1. Initial program 95.0%

          \[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. cancel-sign-subN/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-/.f6490.4

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

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

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

      Alternative 4: 84.9% accurate, 0.7× speedup?

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

        1. Initial program 82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto z \cdot \left(\frac{y}{t} - \frac{x}{t}\right) \]
          3. difference-of-squares-revN/A

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

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

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

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

            \[\leadsto \left(\frac{y}{t} - \frac{x}{t}\right) \cdot \color{blue}{z} \]
          8. sub-divN/A

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

            \[\leadsto \frac{y - x}{t} \cdot z \]
          10. lift--.f6485.4

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

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

        if -9.99999999999999952e73 < z < 1.70000000000000016e79

        1. Initial program 97.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 rewrites83.2%

            \[\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. associate-/l*N/A

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

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

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

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

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

        Alternative 5: 72.7% accurate, 0.7× speedup?

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

          1. Initial program 91.3%

            \[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.4%

              \[\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. associate-/l*N/A

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

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

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

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

            if -2.2000000000000001e-265 < y < 2.6999999999999999e-120

            1. Initial program 95.7%

              \[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. cancel-sign-subN/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-/.f6490.0

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

              \[\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. lower-/.f64N/A

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

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

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

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

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

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

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

          Alternative 6: 54.3% accurate, 0.8× speedup?

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

            1. Initial program 87.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. lift-/.f64N/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{z}{t}}, y - x, x\right) \]
              10. lift--.f6497.0

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

              \[\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{\color{blue}{y} \cdot z}{t} \]
              2. flip--N/A

                \[\leadsto \frac{y \cdot z}{t} \]
              3. difference-of-squares-revN/A

                \[\leadsto \frac{y \cdot z}{t} \]
              4. times-fracN/A

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

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

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

                \[\leadsto y \cdot \color{blue}{\frac{z}{t}} \]
              8. lift-/.f6451.8

                \[\leadsto y \cdot \frac{z}{\color{blue}{t}} \]
            7. Applied rewrites51.8%

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

            if -3.1499999999999999e-68 < z < 7.59999999999999989e-112

            1. Initial program 99.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 rewrites71.2%

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

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

            Alternative 7: 76.1% accurate, 1.3× speedup?

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

              \[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 rewrites72.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. associate-/l*N/A

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

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

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

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

              Alternative 8: 38.0% 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.1%

                \[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.9%

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

                Developer Target 1: 97.9% 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 2025051 
                (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)))