Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C

Percentage Accurate: 94.2% → 98.1%
Time: 9.2s
Alternatives: 15
Speedup: 0.9×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 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: 94.2% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 98.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} - \frac{t}{1 - z}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+306}\right):\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+306)))
     (* y (/ x z))
     (* x t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+306)) {
		tmp = y * (x / z);
	} else {
		tmp = x * t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+306)) {
		tmp = y * (x / z);
	} else {
		tmp = x * t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y / z) - (t / (1.0 - z))
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e+306):
		tmp = y * (x / z)
	else:
		tmp = x * t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+306))
		tmp = Float64(y * Float64(x / z));
	else
		tmp = Float64(x * t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y / z) - (t / (1.0 - z));
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e+306)))
		tmp = y * (x / z);
	else
		tmp = x * t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+306]], $MachinePrecision]], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(x * t$95$1), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0 or 2.00000000000000003e306 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 64.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
      4. lower-/.f6464.2

        \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
    5. Applied rewrites64.2%

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
    6. Step-by-step derivation
      1. Applied rewrites100.0%

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

      if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 2.00000000000000003e306

      1. Initial program 97.6%

        \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
      2. Add Preprocessing
    7. Recombined 2 regimes into one program.
    8. Final simplification97.9%

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

    Alternative 2: 94.3% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t + y}{z}\\ \mathbf{if}\;z \leq -1.7:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-199}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, x, x\right), -t, \frac{y}{z} \cdot x\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x \cdot \left(y - t \cdot z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ (+ t y) z))))
       (if (<= z -1.7)
         t_1
         (if (<= z -1.15e-199)
           (fma (fma z x x) (- t) (* (/ y z) x))
           (if (<= z 1.0) (/ (* x (- y (* t z))) z) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * ((t + y) / z);
    	double tmp;
    	if (z <= -1.7) {
    		tmp = t_1;
    	} else if (z <= -1.15e-199) {
    		tmp = fma(fma(z, x, x), -t, ((y / z) * x));
    	} else if (z <= 1.0) {
    		tmp = (x * (y - (t * z))) / z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(Float64(t + y) / z))
    	tmp = 0.0
    	if (z <= -1.7)
    		tmp = t_1;
    	elseif (z <= -1.15e-199)
    		tmp = fma(fma(z, x, x), Float64(-t), Float64(Float64(y / z) * x));
    	elseif (z <= 1.0)
    		tmp = Float64(Float64(x * Float64(y - Float64(t * z))) / z);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7], t$95$1, If[LessEqual[z, -1.15e-199], N[(N[(z * x + x), $MachinePrecision] * (-t) + N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{t + y}{z}\\
    \mathbf{if}\;z \leq -1.7:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq -1.15 \cdot 10^{-199}:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(z, x, x\right), -t, \frac{y}{z} \cdot x\right)\\
    
    \mathbf{elif}\;z \leq 1:\\
    \;\;\;\;\frac{x \cdot \left(y - t \cdot z\right)}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -1.69999999999999996 or 1 < z

      1. Initial program 95.5%

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

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

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

          \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
        3. fp-cancel-sub-signN/A

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

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

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

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

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

          \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
        9. lower-/.f6438.8

          \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
      5. Applied rewrites38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(-y\right)}\right) \]
      8. Applied rewrites90.6%

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

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

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. fp-cancel-sub-sign-invN/A

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

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

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

          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
        6. lower-+.f6494.3

          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
      11. Applied rewrites94.3%

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

      if -1.69999999999999996 < z < -1.1500000000000001e-199

      1. Initial program 99.7%

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

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

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

          \[\leadsto \color{blue}{\frac{z \cdot \left(-1 \cdot \left(t \cdot x\right) + -1 \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)}{z} + \frac{x \cdot y}{z}} \]
      5. Applied rewrites97.9%

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

      if -1.1500000000000001e-199 < z < 1

      1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
        9. distribute-lft-out--N/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(y - t \cdot z\right)}}{z} \]
        10. fp-cancel-sub-signN/A

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

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

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

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

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

          \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z\right)}{z} \]
        16. fp-cancel-sub-signN/A

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

          \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
        18. lower-*.f6495.4

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

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

    Alternative 3: 94.5% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{t + y}{z}\\ \mathbf{if}\;z \leq -1.7:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-199}:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - \mathsf{fma}\left(t, z, t\right)\right)\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\frac{x \cdot \left(y - t \cdot z\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (/ (+ t y) z))))
       (if (<= z -1.7)
         t_1
         (if (<= z -1.15e-199)
           (* x (- (/ y z) (fma t z t)))
           (if (<= z 1.0) (/ (* x (- y (* t z))) z) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * ((t + y) / z);
    	double tmp;
    	if (z <= -1.7) {
    		tmp = t_1;
    	} else if (z <= -1.15e-199) {
    		tmp = x * ((y / z) - fma(t, z, t));
    	} else if (z <= 1.0) {
    		tmp = (x * (y - (t * z))) / z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(Float64(t + y) / z))
    	tmp = 0.0
    	if (z <= -1.7)
    		tmp = t_1;
    	elseif (z <= -1.15e-199)
    		tmp = Float64(x * Float64(Float64(y / z) - fma(t, z, t)));
    	elseif (z <= 1.0)
    		tmp = Float64(Float64(x * Float64(y - Float64(t * z))) / z);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(t + y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7], t$95$1, If[LessEqual[z, -1.15e-199], N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(N[(x * N[(y - N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \frac{t + y}{z}\\
    \mathbf{if}\;z \leq -1.7:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq -1.15 \cdot 10^{-199}:\\
    \;\;\;\;x \cdot \left(\frac{y}{z} - \mathsf{fma}\left(t, z, t\right)\right)\\
    
    \mathbf{elif}\;z \leq 1:\\
    \;\;\;\;\frac{x \cdot \left(y - t \cdot z\right)}{z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -1.69999999999999996 or 1 < z

      1. Initial program 95.5%

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

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

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

          \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
        3. fp-cancel-sub-signN/A

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

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

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

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

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

          \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
        9. lower-/.f6438.8

          \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
      5. Applied rewrites38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(-y\right)}\right) \]
      8. Applied rewrites90.6%

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

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

          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
        2. fp-cancel-sub-sign-invN/A

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

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

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

          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
        6. lower-+.f6494.3

          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
      11. Applied rewrites94.3%

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

      if -1.69999999999999996 < z < -1.1500000000000001e-199

      1. Initial program 99.7%

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

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

          \[\leadsto x \cdot \left(\frac{y}{z} - \color{blue}{\left(t \cdot z + t\right)}\right) \]
        2. lower-fma.f6497.9

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

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

      if -1.1500000000000001e-199 < z < 1

      1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
        9. distribute-lft-out--N/A

          \[\leadsto \frac{\color{blue}{x \cdot \left(y - t \cdot z\right)}}{z} \]
        10. fp-cancel-sub-signN/A

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

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

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

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

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

          \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z\right)}{z} \]
        16. fp-cancel-sub-signN/A

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

          \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
        18. lower-*.f6495.4

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

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

    Alternative 4: 64.0% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-t\right)\\ t_2 := x \cdot \frac{t}{z}\\ \mathbf{if}\;t \leq -7.2 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.6 \cdot 10^{+71}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{+213}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* x (- t))) (t_2 (* x (/ t z))))
       (if (<= t -7.2e+188)
         t_1
         (if (<= t -1.6e+71)
           t_2
           (if (<= t 1.8e+86) (* y (/ x z)) (if (<= t 4.2e+213) t_1 t_2))))))
    double code(double x, double y, double z, double t) {
    	double t_1 = x * -t;
    	double t_2 = x * (t / z);
    	double tmp;
    	if (t <= -7.2e+188) {
    		tmp = t_1;
    	} else if (t <= -1.6e+71) {
    		tmp = t_2;
    	} else if (t <= 1.8e+86) {
    		tmp = y * (x / z);
    	} else if (t <= 4.2e+213) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	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) :: t_2
        real(8) :: tmp
        t_1 = x * -t
        t_2 = x * (t / z)
        if (t <= (-7.2d+188)) then
            tmp = t_1
        else if (t <= (-1.6d+71)) then
            tmp = t_2
        else if (t <= 1.8d+86) then
            tmp = y * (x / z)
        else if (t <= 4.2d+213) then
            tmp = t_1
        else
            tmp = t_2
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = x * -t;
    	double t_2 = x * (t / z);
    	double tmp;
    	if (t <= -7.2e+188) {
    		tmp = t_1;
    	} else if (t <= -1.6e+71) {
    		tmp = t_2;
    	} else if (t <= 1.8e+86) {
    		tmp = y * (x / z);
    	} else if (t <= 4.2e+213) {
    		tmp = t_1;
    	} else {
    		tmp = t_2;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = x * -t
    	t_2 = x * (t / z)
    	tmp = 0
    	if t <= -7.2e+188:
    		tmp = t_1
    	elif t <= -1.6e+71:
    		tmp = t_2
    	elif t <= 1.8e+86:
    		tmp = y * (x / z)
    	elif t <= 4.2e+213:
    		tmp = t_1
    	else:
    		tmp = t_2
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(x * Float64(-t))
    	t_2 = Float64(x * Float64(t / z))
    	tmp = 0.0
    	if (t <= -7.2e+188)
    		tmp = t_1;
    	elseif (t <= -1.6e+71)
    		tmp = t_2;
    	elseif (t <= 1.8e+86)
    		tmp = Float64(y * Float64(x / z));
    	elseif (t <= 4.2e+213)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = x * -t;
    	t_2 = x * (t / z);
    	tmp = 0.0;
    	if (t <= -7.2e+188)
    		tmp = t_1;
    	elseif (t <= -1.6e+71)
    		tmp = t_2;
    	elseif (t <= 1.8e+86)
    		tmp = y * (x / z);
    	elseif (t <= 4.2e+213)
    		tmp = t_1;
    	else
    		tmp = t_2;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.2e+188], t$95$1, If[LessEqual[t, -1.6e+71], t$95$2, If[LessEqual[t, 1.8e+86], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+213], t$95$1, t$95$2]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := x \cdot \left(-t\right)\\
    t_2 := x \cdot \frac{t}{z}\\
    \mathbf{if}\;t \leq -7.2 \cdot 10^{+188}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq -1.6 \cdot 10^{+71}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;t \leq 1.8 \cdot 10^{+86}:\\
    \;\;\;\;y \cdot \frac{x}{z}\\
    
    \mathbf{elif}\;t \leq 4.2 \cdot 10^{+213}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if t < -7.20000000000000041e188 or 1.80000000000000003e86 < t < 4.2000000000000001e213

      1. Initial program 96.3%

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

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

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

          \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
        3. fp-cancel-sub-signN/A

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

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

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

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

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

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

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

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

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

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

        if -7.20000000000000041e188 < t < -1.60000000000000012e71 or 4.2000000000000001e213 < t

        1. Initial program 94.4%

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

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

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

            \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
          3. fp-cancel-sub-signN/A

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

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

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

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

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

            \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
          9. lower-/.f6453.3

            \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
        5. Applied rewrites53.3%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
          12. lower-neg.f6481.7

            \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(-y\right)}\right) \]
        8. Applied rewrites81.7%

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

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

            \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
          2. fp-cancel-sub-sign-invN/A

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

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

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

            \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
          6. lower-+.f6468.1

            \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
        11. Applied rewrites68.1%

          \[\leadsto x \cdot \color{blue}{\frac{t + y}{z}} \]
        12. Taylor expanded in y around 0

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

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

          if -1.60000000000000012e71 < t < 1.80000000000000003e86

          1. Initial program 91.6%

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
          5. Applied rewrites78.3%

            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
          6. Step-by-step derivation
            1. Applied rewrites78.3%

              \[\leadsto y \cdot \color{blue}{\frac{x}{z}} \]
          7. Recombined 3 regimes into one program.
          8. Add Preprocessing

          Alternative 5: 73.5% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot x}{z}\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+245}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{-71}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 3700000000:\\ \;\;\;\;\frac{t \cdot x}{-1 + z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (/ (* y x) z)))
             (if (<= y -1.3e+245)
               t_1
               (if (<= y -4.6e-71)
                 (* (+ y t) (/ x z))
                 (if (<= y 3700000000.0) (/ (* t x) (+ -1.0 z)) t_1)))))
          double code(double x, double y, double z, double t) {
          	double t_1 = (y * x) / z;
          	double tmp;
          	if (y <= -1.3e+245) {
          		tmp = t_1;
          	} else if (y <= -4.6e-71) {
          		tmp = (y + t) * (x / z);
          	} else if (y <= 3700000000.0) {
          		tmp = (t * x) / (-1.0 + z);
          	} else {
          		tmp = t_1;
          	}
          	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 = (y * x) / z
              if (y <= (-1.3d+245)) then
                  tmp = t_1
              else if (y <= (-4.6d-71)) then
                  tmp = (y + t) * (x / z)
              else if (y <= 3700000000.0d0) then
                  tmp = (t * x) / ((-1.0d0) + z)
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = (y * x) / z;
          	double tmp;
          	if (y <= -1.3e+245) {
          		tmp = t_1;
          	} else if (y <= -4.6e-71) {
          		tmp = (y + t) * (x / z);
          	} else if (y <= 3700000000.0) {
          		tmp = (t * x) / (-1.0 + z);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = (y * x) / z
          	tmp = 0
          	if y <= -1.3e+245:
          		tmp = t_1
          	elif y <= -4.6e-71:
          		tmp = (y + t) * (x / z)
          	elif y <= 3700000000.0:
          		tmp = (t * x) / (-1.0 + z)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(Float64(y * x) / z)
          	tmp = 0.0
          	if (y <= -1.3e+245)
          		tmp = t_1;
          	elseif (y <= -4.6e-71)
          		tmp = Float64(Float64(y + t) * Float64(x / z));
          	elseif (y <= 3700000000.0)
          		tmp = Float64(Float64(t * x) / Float64(-1.0 + z));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = (y * x) / z;
          	tmp = 0.0;
          	if (y <= -1.3e+245)
          		tmp = t_1;
          	elseif (y <= -4.6e-71)
          		tmp = (y + t) * (x / z);
          	elseif (y <= 3700000000.0)
          		tmp = (t * x) / (-1.0 + z);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.3e+245], t$95$1, If[LessEqual[y, -4.6e-71], N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3700000000.0], N[(N[(t * x), $MachinePrecision] / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := \frac{y \cdot x}{z}\\
          \mathbf{if}\;y \leq -1.3 \cdot 10^{+245}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq -4.6 \cdot 10^{-71}:\\
          \;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\
          
          \mathbf{elif}\;y \leq 3700000000:\\
          \;\;\;\;\frac{t \cdot x}{-1 + z}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -1.30000000000000002e245 or 3.7e9 < y

            1. Initial program 89.6%

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

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

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

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

                \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
              4. lower-/.f6483.9

                \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
            5. Applied rewrites83.9%

              \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
            6. Step-by-step derivation
              1. Applied rewrites90.5%

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

              if -1.30000000000000002e245 < y < -4.5999999999999997e-71

              1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\left(\color{blue}{\left(-y\right)} - t\right)\right) \cdot \frac{x}{z} \]
                10. lower-/.f6473.0

                  \[\leadsto \left(-\left(\left(-y\right) - t\right)\right) \cdot \color{blue}{\frac{x}{z}} \]
              5. Applied rewrites73.0%

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

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

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

                if -4.5999999999999997e-71 < y < 3.7e9

                1. Initial program 95.6%

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

                  \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
                4. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

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

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

                    \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + -1 \cdot z\right)}\right)} \]
                  8. mul-1-negN/A

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

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

                    \[\leadsto \frac{t \cdot x}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \]
                  11. remove-double-negN/A

                    \[\leadsto \frac{t \cdot x}{-1 + \color{blue}{z}} \]
                  12. lower-+.f6474.3

                    \[\leadsto \frac{t \cdot x}{\color{blue}{-1 + z}} \]
                5. Applied rewrites74.3%

                  \[\leadsto \color{blue}{\frac{t \cdot x}{-1 + z}} \]
              8. Recombined 3 regimes into one program.
              9. Add Preprocessing

              Alternative 6: 73.7% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot x}{z}\\ \mathbf{if}\;y \leq -1.3 \cdot 10^{+245}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-71}:\\ \;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;y \leq 3700000000:\\ \;\;\;\;\frac{x}{z - 1} \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (/ (* y x) z)))
                 (if (<= y -1.3e+245)
                   t_1
                   (if (<= y -6.5e-71)
                     (* (+ y t) (/ x z))
                     (if (<= y 3700000000.0) (* (/ x (- z 1.0)) t) t_1)))))
              double code(double x, double y, double z, double t) {
              	double t_1 = (y * x) / z;
              	double tmp;
              	if (y <= -1.3e+245) {
              		tmp = t_1;
              	} else if (y <= -6.5e-71) {
              		tmp = (y + t) * (x / z);
              	} else if (y <= 3700000000.0) {
              		tmp = (x / (z - 1.0)) * t;
              	} else {
              		tmp = t_1;
              	}
              	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 = (y * x) / z
                  if (y <= (-1.3d+245)) then
                      tmp = t_1
                  else if (y <= (-6.5d-71)) then
                      tmp = (y + t) * (x / z)
                  else if (y <= 3700000000.0d0) then
                      tmp = (x / (z - 1.0d0)) * t
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = (y * x) / z;
              	double tmp;
              	if (y <= -1.3e+245) {
              		tmp = t_1;
              	} else if (y <= -6.5e-71) {
              		tmp = (y + t) * (x / z);
              	} else if (y <= 3700000000.0) {
              		tmp = (x / (z - 1.0)) * t;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              def code(x, y, z, t):
              	t_1 = (y * x) / z
              	tmp = 0
              	if y <= -1.3e+245:
              		tmp = t_1
              	elif y <= -6.5e-71:
              		tmp = (y + t) * (x / z)
              	elif y <= 3700000000.0:
              		tmp = (x / (z - 1.0)) * t
              	else:
              		tmp = t_1
              	return tmp
              
              function code(x, y, z, t)
              	t_1 = Float64(Float64(y * x) / z)
              	tmp = 0.0
              	if (y <= -1.3e+245)
              		tmp = t_1;
              	elseif (y <= -6.5e-71)
              		tmp = Float64(Float64(y + t) * Float64(x / z));
              	elseif (y <= 3700000000.0)
              		tmp = Float64(Float64(x / Float64(z - 1.0)) * t);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = (y * x) / z;
              	tmp = 0.0;
              	if (y <= -1.3e+245)
              		tmp = t_1;
              	elseif (y <= -6.5e-71)
              		tmp = (y + t) * (x / z);
              	elseif (y <= 3700000000.0)
              		tmp = (x / (z - 1.0)) * t;
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.3e+245], t$95$1, If[LessEqual[y, -6.5e-71], N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3700000000.0], N[(N[(x / N[(z - 1.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \frac{y \cdot x}{z}\\
              \mathbf{if}\;y \leq -1.3 \cdot 10^{+245}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;y \leq -6.5 \cdot 10^{-71}:\\
              \;\;\;\;\left(y + t\right) \cdot \frac{x}{z}\\
              
              \mathbf{elif}\;y \leq 3700000000:\\
              \;\;\;\;\frac{x}{z - 1} \cdot t\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if y < -1.30000000000000002e245 or 3.7e9 < y

                1. Initial program 89.6%

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

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

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

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

                    \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                  4. lower-/.f6483.9

                    \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
                5. Applied rewrites83.9%

                  \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                6. Step-by-step derivation
                  1. Applied rewrites90.5%

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

                  if -1.30000000000000002e245 < y < -6.50000000000000005e-71

                  1. Initial program 93.2%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-\left(\color{blue}{\left(-y\right)} - t\right)\right) \cdot \frac{x}{z} \]
                    10. lower-/.f6473.0

                      \[\leadsto \left(-\left(\left(-y\right) - t\right)\right) \cdot \color{blue}{\frac{x}{z}} \]
                  5. Applied rewrites73.0%

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

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

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

                    if -6.50000000000000005e-71 < y < 3.7e9

                    1. Initial program 95.6%

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

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

                        \[\leadsto -1 \cdot \frac{t \cdot x}{1 - z} + \color{blue}{x \cdot \frac{y}{z}} \]
                      2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{1 - z}\right)} \cdot t + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \cdot \frac{y}{z} \]
                      9. mul-1-negN/A

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

                        \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \left(\mathsf{neg}\left(\color{blue}{x \cdot -1}\right)\right) \cdot \frac{y}{z} \]
                      11. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)}}{1} \cdot \frac{y}{z} \]
                      20. distribute-rgt-neg-inN/A

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

                        \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{\mathsf{neg}\left(\color{blue}{-1 \cdot x}\right)}{1} \cdot \frac{y}{z} \]
                      22. mul-1-negN/A

                        \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)}{1} \cdot \frac{y}{z} \]
                      23. remove-double-negN/A

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

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

                      \[\leadsto \frac{t \cdot x}{\color{blue}{z - 1}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites72.9%

                        \[\leadsto \frac{x}{z - 1} \cdot \color{blue}{t} \]
                    8. Recombined 3 regimes into one program.
                    9. Add Preprocessing

                    Alternative 7: 94.8% accurate, 0.9× speedup?

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

                      1. Initial program 95.5%

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

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

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

                          \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                        3. fp-cancel-sub-signN/A

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

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

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

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

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

                          \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                        9. lower-/.f6438.8

                          \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                      5. Applied rewrites38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(-y\right)}\right) \]
                      8. Applied rewrites90.6%

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

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

                          \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
                        2. fp-cancel-sub-sign-invN/A

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

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

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

                          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
                        6. lower-+.f6494.3

                          \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
                      11. Applied rewrites94.3%

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

                      if -1.69999999999999996 < z < 1

                      1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{x \cdot y - \color{blue}{x \cdot \left(t \cdot z\right)}}{z} \]
                        9. distribute-lft-out--N/A

                          \[\leadsto \frac{\color{blue}{x \cdot \left(y - t \cdot z\right)}}{z} \]
                        10. fp-cancel-sub-signN/A

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

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

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

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

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

                          \[\leadsto \frac{x \cdot \left(y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z\right)}{z} \]
                        16. fp-cancel-sub-signN/A

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

                          \[\leadsto \frac{x \cdot \color{blue}{\left(y - t \cdot z\right)}}{z} \]
                        18. lower-*.f6493.3

                          \[\leadsto \frac{x \cdot \left(y - \color{blue}{t \cdot z}\right)}{z} \]
                      5. Applied rewrites93.3%

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

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

                    Alternative 8: 61.7% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-t\right)\\ \mathbf{if}\;t \leq -7.1 \cdot 10^{+71}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{+224}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \end{array} \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (let* ((t_1 (* x (- t))))
                       (if (<= t -7.1e+71)
                         t_1
                         (if (<= t 1.8e+86)
                           (* y (/ x z))
                           (if (<= t 7.5e+224) t_1 (/ (* t x) z))))))
                    double code(double x, double y, double z, double t) {
                    	double t_1 = x * -t;
                    	double tmp;
                    	if (t <= -7.1e+71) {
                    		tmp = t_1;
                    	} else if (t <= 1.8e+86) {
                    		tmp = y * (x / z);
                    	} else if (t <= 7.5e+224) {
                    		tmp = t_1;
                    	} else {
                    		tmp = (t * x) / z;
                    	}
                    	return tmp;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8) :: t_1
                        real(8) :: tmp
                        t_1 = x * -t
                        if (t <= (-7.1d+71)) then
                            tmp = t_1
                        else if (t <= 1.8d+86) then
                            tmp = y * (x / z)
                        else if (t <= 7.5d+224) then
                            tmp = t_1
                        else
                            tmp = (t * x) / z
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	double t_1 = x * -t;
                    	double tmp;
                    	if (t <= -7.1e+71) {
                    		tmp = t_1;
                    	} else if (t <= 1.8e+86) {
                    		tmp = y * (x / z);
                    	} else if (t <= 7.5e+224) {
                    		tmp = t_1;
                    	} else {
                    		tmp = (t * x) / z;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, t):
                    	t_1 = x * -t
                    	tmp = 0
                    	if t <= -7.1e+71:
                    		tmp = t_1
                    	elif t <= 1.8e+86:
                    		tmp = y * (x / z)
                    	elif t <= 7.5e+224:
                    		tmp = t_1
                    	else:
                    		tmp = (t * x) / z
                    	return tmp
                    
                    function code(x, y, z, t)
                    	t_1 = Float64(x * Float64(-t))
                    	tmp = 0.0
                    	if (t <= -7.1e+71)
                    		tmp = t_1;
                    	elseif (t <= 1.8e+86)
                    		tmp = Float64(y * Float64(x / z));
                    	elseif (t <= 7.5e+224)
                    		tmp = t_1;
                    	else
                    		tmp = Float64(Float64(t * x) / z);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, t)
                    	t_1 = x * -t;
                    	tmp = 0.0;
                    	if (t <= -7.1e+71)
                    		tmp = t_1;
                    	elseif (t <= 1.8e+86)
                    		tmp = y * (x / z);
                    	elseif (t <= 7.5e+224)
                    		tmp = t_1;
                    	else
                    		tmp = (t * x) / z;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-t)), $MachinePrecision]}, If[LessEqual[t, -7.1e+71], t$95$1, If[LessEqual[t, 1.8e+86], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+224], t$95$1, N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := x \cdot \left(-t\right)\\
                    \mathbf{if}\;t \leq -7.1 \cdot 10^{+71}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;t \leq 1.8 \cdot 10^{+86}:\\
                    \;\;\;\;y \cdot \frac{x}{z}\\
                    
                    \mathbf{elif}\;t \leq 7.5 \cdot 10^{+224}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{t \cdot x}{z}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if t < -7.09999999999999986e71 or 1.80000000000000003e86 < t < 7.500000000000001e224

                      1. Initial program 96.5%

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

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

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

                          \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                        3. fp-cancel-sub-signN/A

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

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

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

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

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

                          \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                        9. lower-/.f6468.2

                          \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                      5. Applied rewrites68.2%

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

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

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

                        if -7.09999999999999986e71 < t < 1.80000000000000003e86

                        1. Initial program 91.7%

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

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

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

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

                            \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                          4. lower-/.f6477.8

                            \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
                        5. Applied rewrites77.8%

                          \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                        6. Step-by-step derivation
                          1. Applied rewrites77.9%

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

                          if 7.500000000000001e224 < t

                          1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-\left(\left(-y\right) - t\right)\right) \cdot \color{blue}{\frac{x}{z}} \]
                          5. Applied rewrites55.7%

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

                            \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                          7. Step-by-step derivation
                            1. Applied rewrites61.3%

                              \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                          8. Recombined 3 regimes into one program.
                          9. Add Preprocessing

                          Alternative 9: 93.1% accurate, 1.1× speedup?

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

                            1. Initial program 95.6%

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

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

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

                                \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                              3. fp-cancel-sub-signN/A

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

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

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

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

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

                                \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                              9. lower-/.f6439.3

                                \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                            5. Applied rewrites39.3%

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right) \]
                              12. lower-neg.f6490.7

                                \[\leadsto x \cdot \left(\left(\frac{\frac{t}{1 - z}}{y} - \frac{1}{z}\right) \cdot \color{blue}{\left(-y\right)}\right) \]
                            8. Applied rewrites90.7%

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

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

                                \[\leadsto x \cdot \color{blue}{\frac{y - -1 \cdot t}{z}} \]
                              2. fp-cancel-sub-sign-invN/A

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

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

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

                                \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
                              6. lower-+.f6494.3

                                \[\leadsto x \cdot \frac{\color{blue}{t + y}}{z} \]
                            11. Applied rewrites94.3%

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

                            if -1.69999999999999996 < z < 8.99999999999999953e-9

                            1. Initial program 91.1%

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

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

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

                                \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                              3. fp-cancel-sub-signN/A

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

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

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

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

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

                                \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                              9. lower-/.f6489.9

                                \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                            5. Applied rewrites89.9%

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

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

                          Alternative 10: 88.4% accurate, 1.1× speedup?

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

                            1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\color{blue}{\left(t + y\right)} \cdot x}{z} \]
                            5. Applied rewrites87.4%

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

                            if -1.69999999999999996 < z < 8.99999999999999953e-9

                            1. Initial program 91.1%

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

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

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

                                \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                              3. fp-cancel-sub-signN/A

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

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

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

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

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

                                \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                              9. lower-/.f6489.9

                                \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                            5. Applied rewrites89.9%

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

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

                          Alternative 11: 72.7% accurate, 1.1× speedup?

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

                            1. Initial program 91.1%

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

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

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

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

                                \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                              4. lower-/.f6474.2

                                \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
                            5. Applied rewrites74.2%

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

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

                              if -2.7000000000000002e-79 < y < 3.7e9

                              1. Initial program 95.6%

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

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

                                  \[\leadsto -1 \cdot \frac{t \cdot x}{1 - z} + \color{blue}{x \cdot \frac{y}{z}} \]
                                2. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\left(-1 \cdot \frac{x}{1 - z}\right)} \cdot t + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) \cdot \frac{y}{z} \]
                                9. mul-1-negN/A

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

                                  \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \left(\mathsf{neg}\left(\color{blue}{x \cdot -1}\right)\right) \cdot \frac{y}{z} \]
                                11. distribute-rgt-neg-inN/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{x \cdot \color{blue}{\left(\mathsf{neg}\left(-1\right)\right)}}{1} \cdot \frac{y}{z} \]
                                20. distribute-rgt-neg-inN/A

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

                                  \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{\mathsf{neg}\left(\color{blue}{-1 \cdot x}\right)}{1} \cdot \frac{y}{z} \]
                                22. mul-1-negN/A

                                  \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)}{1} \cdot \frac{y}{z} \]
                                23. remove-double-negN/A

                                  \[\leadsto \left(-1 \cdot \frac{x}{1 - z}\right) \cdot t + \frac{\color{blue}{x}}{1} \cdot \frac{y}{z} \]
                              5. Applied rewrites92.3%

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

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

                                  \[\leadsto \frac{x}{z - 1} \cdot \color{blue}{t} \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification76.7%

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

                              Alternative 12: 73.6% accurate, 1.1× speedup?

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

                                1. Initial program 90.8%

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\color{blue}{\left(t + y\right)} \cdot x}{z} \]
                                  8. lower-+.f6477.6

                                    \[\leadsto \frac{\color{blue}{\left(t + y\right)} \cdot x}{z} \]
                                5. Applied rewrites77.6%

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

                                if -6.50000000000000005e-71 < y < 3.7e9

                                1. Initial program 95.6%

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

                                  \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
                                4. Step-by-step derivation
                                  1. mul-1-negN/A

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

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

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

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

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

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

                                    \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + -1 \cdot z\right)}\right)} \]
                                  8. mul-1-negN/A

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

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

                                    \[\leadsto \frac{t \cdot x}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \]
                                  11. remove-double-negN/A

                                    \[\leadsto \frac{t \cdot x}{-1 + \color{blue}{z}} \]
                                  12. lower-+.f6474.3

                                    \[\leadsto \frac{t \cdot x}{\color{blue}{-1 + z}} \]
                                5. Applied rewrites74.3%

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

                                if 3.7e9 < y

                                1. Initial program 91.4%

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                                  4. lower-/.f6484.5

                                    \[\leadsto \color{blue}{\frac{y}{z}} \cdot x \]
                                5. Applied rewrites84.5%

                                  \[\leadsto \color{blue}{\frac{y}{z} \cdot x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites88.5%

                                    \[\leadsto \frac{y \cdot x}{\color{blue}{z}} \]
                                7. Recombined 3 regimes into one program.
                                8. Add Preprocessing

                                Alternative 13: 41.5% accurate, 1.2× speedup?

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

                                  1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-\left(\color{blue}{\left(-y\right)} - t\right)\right) \cdot \frac{x}{z} \]
                                    10. lower-/.f6483.3

                                      \[\leadsto \left(-\left(\left(-y\right) - t\right)\right) \cdot \color{blue}{\frac{x}{z}} \]
                                  5. Applied rewrites83.3%

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

                                    \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites53.3%

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

                                    if -0.75 < z < 1

                                    1. Initial program 91.1%

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

                                      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
                                    4. Step-by-step derivation
                                      1. mul-1-negN/A

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

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

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

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

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

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

                                        \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + -1 \cdot z\right)}\right)} \]
                                      8. mul-1-negN/A

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

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

                                        \[\leadsto \frac{t \cdot x}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \]
                                      11. remove-double-negN/A

                                        \[\leadsto \frac{t \cdot x}{-1 + \color{blue}{z}} \]
                                      12. lower-+.f6441.4

                                        \[\leadsto \frac{t \cdot x}{\color{blue}{-1 + z}} \]
                                    5. Applied rewrites41.4%

                                      \[\leadsto \color{blue}{\frac{t \cdot x}{-1 + z}} \]
                                    6. Taylor expanded in z around 0

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

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

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

                                    Alternative 14: 41.5% accurate, 1.2× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.75:\\ \;\;\;\;\frac{x}{z} \cdot t\\ \mathbf{elif}\;z \leq 1:\\ \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t \cdot x}{z}\\ \end{array} \end{array} \]
                                    (FPCore (x y z t)
                                     :precision binary64
                                     (if (<= z -0.75)
                                       (* (/ x z) t)
                                       (if (<= z 1.0) (* (- t) (fma z x x)) (/ (* t x) z))))
                                    double code(double x, double y, double z, double t) {
                                    	double tmp;
                                    	if (z <= -0.75) {
                                    		tmp = (x / z) * t;
                                    	} else if (z <= 1.0) {
                                    		tmp = -t * fma(z, x, x);
                                    	} else {
                                    		tmp = (t * x) / z;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, t)
                                    	tmp = 0.0
                                    	if (z <= -0.75)
                                    		tmp = Float64(Float64(x / z) * t);
                                    	elseif (z <= 1.0)
                                    		tmp = Float64(Float64(-t) * fma(z, x, x));
                                    	else
                                    		tmp = Float64(Float64(t * x) / z);
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_, y_, z_, t_] := If[LessEqual[z, -0.75], N[(N[(x / z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 1.0], N[((-t) * N[(z * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;z \leq -0.75:\\
                                    \;\;\;\;\frac{x}{z} \cdot t\\
                                    
                                    \mathbf{elif}\;z \leq 1:\\
                                    \;\;\;\;\left(-t\right) \cdot \mathsf{fma}\left(z, x, x\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{t \cdot x}{z}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if z < -0.75

                                      1. Initial program 95.2%

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

                                        \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
                                      4. Step-by-step derivation
                                        1. mul-1-negN/A

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

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

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

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

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

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

                                          \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + -1 \cdot z\right)}\right)} \]
                                        8. mul-1-negN/A

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

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

                                          \[\leadsto \frac{t \cdot x}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \]
                                        11. remove-double-negN/A

                                          \[\leadsto \frac{t \cdot x}{-1 + \color{blue}{z}} \]
                                        12. lower-+.f6448.3

                                          \[\leadsto \frac{t \cdot x}{\color{blue}{-1 + z}} \]
                                      5. Applied rewrites48.3%

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

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

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

                                        if -0.75 < z < 1

                                        1. Initial program 91.1%

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

                                          \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot x}{1 - z}} \]
                                        4. Step-by-step derivation
                                          1. mul-1-negN/A

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

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

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

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

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

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

                                            \[\leadsto \frac{t \cdot x}{\mathsf{neg}\left(\color{blue}{\left(1 + -1 \cdot z\right)}\right)} \]
                                          8. mul-1-negN/A

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

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

                                            \[\leadsto \frac{t \cdot x}{\color{blue}{-1} + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \]
                                          11. remove-double-negN/A

                                            \[\leadsto \frac{t \cdot x}{-1 + \color{blue}{z}} \]
                                          12. lower-+.f6441.4

                                            \[\leadsto \frac{t \cdot x}{\color{blue}{-1 + z}} \]
                                        5. Applied rewrites41.4%

                                          \[\leadsto \color{blue}{\frac{t \cdot x}{-1 + z}} \]
                                        6. Taylor expanded in z around 0

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

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

                                          if 1 < z

                                          1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left(-\left(\color{blue}{\left(-y\right)} - t\right)\right) \cdot \frac{x}{z} \]
                                            10. lower-/.f6485.3

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

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

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

                                              \[\leadsto \frac{t \cdot x}{\color{blue}{z}} \]
                                          8. Recombined 3 regimes into one program.
                                          9. Add Preprocessing

                                          Alternative 15: 22.4% accurate, 4.3× speedup?

                                          \[\begin{array}{l} \\ x \cdot \left(-t\right) \end{array} \]
                                          (FPCore (x y z t) :precision binary64 (* x (- t)))
                                          double code(double x, double y, double z, double t) {
                                          	return x * -t;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(x, y, z, t)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              real(8), intent (in) :: z
                                              real(8), intent (in) :: t
                                              code = x * -t
                                          end function
                                          
                                          public static double code(double x, double y, double z, double t) {
                                          	return x * -t;
                                          }
                                          
                                          def code(x, y, z, t):
                                          	return x * -t
                                          
                                          function code(x, y, z, t)
                                          	return Float64(x * Float64(-t))
                                          end
                                          
                                          function tmp = code(x, y, z, t)
                                          	tmp = x * -t;
                                          end
                                          
                                          code[x_, y_, z_, t_] := N[(x * (-t)), $MachinePrecision]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          x \cdot \left(-t\right)
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 93.1%

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

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

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

                                              \[\leadsto x \cdot \frac{y + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)} \cdot z}{z} \]
                                            3. fp-cancel-sub-signN/A

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

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

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

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

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

                                              \[\leadsto x \cdot \color{blue}{\left(\frac{y}{z} - t\right)} \]
                                            9. lower-/.f6466.8

                                              \[\leadsto x \cdot \left(\color{blue}{\frac{y}{z}} - t\right) \]
                                          5. Applied rewrites66.8%

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

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

                                              \[\leadsto x \cdot \left(-t\right) \]
                                            2. Add Preprocessing

                                            Developer Target 1: 95.0% accurate, 0.3× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\ t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\ \mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\ \;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                            (FPCore (x y z t)
                                             :precision binary64
                                             (let* ((t_1 (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))))
                                                    (t_2 (* x (- (/ y z) (/ t (- 1.0 z))))))
                                               (if (< t_2 -7.623226303312042e-196)
                                                 t_1
                                                 (if (< t_2 1.4133944927702302e-211)
                                                   (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z))))
                                                   t_1))))
                                            double code(double x, double y, double z, double t) {
                                            	double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
                                            	double t_2 = x * ((y / z) - (t / (1.0 - z)));
                                            	double tmp;
                                            	if (t_2 < -7.623226303312042e-196) {
                                            		tmp = t_1;
                                            	} else if (t_2 < 1.4133944927702302e-211) {
                                            		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
                                            	} else {
                                            		tmp = t_1;
                                            	}
                                            	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) :: t_2
                                                real(8) :: tmp
                                                t_1 = x * ((y / z) - (t * (1.0d0 / (1.0d0 - z))))
                                                t_2 = x * ((y / z) - (t / (1.0d0 - z)))
                                                if (t_2 < (-7.623226303312042d-196)) then
                                                    tmp = t_1
                                                else if (t_2 < 1.4133944927702302d-211) then
                                                    tmp = ((y * x) / z) + -((t * x) / (1.0d0 - z))
                                                else
                                                    tmp = t_1
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double x, double y, double z, double t) {
                                            	double t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
                                            	double t_2 = x * ((y / z) - (t / (1.0 - z)));
                                            	double tmp;
                                            	if (t_2 < -7.623226303312042e-196) {
                                            		tmp = t_1;
                                            	} else if (t_2 < 1.4133944927702302e-211) {
                                            		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
                                            	} else {
                                            		tmp = t_1;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(x, y, z, t):
                                            	t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))))
                                            	t_2 = x * ((y / z) - (t / (1.0 - z)))
                                            	tmp = 0
                                            	if t_2 < -7.623226303312042e-196:
                                            		tmp = t_1
                                            	elif t_2 < 1.4133944927702302e-211:
                                            		tmp = ((y * x) / z) + -((t * x) / (1.0 - z))
                                            	else:
                                            		tmp = t_1
                                            	return tmp
                                            
                                            function code(x, y, z, t)
                                            	t_1 = Float64(x * Float64(Float64(y / z) - Float64(t * Float64(1.0 / Float64(1.0 - z)))))
                                            	t_2 = Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))))
                                            	tmp = 0.0
                                            	if (t_2 < -7.623226303312042e-196)
                                            		tmp = t_1;
                                            	elseif (t_2 < 1.4133944927702302e-211)
                                            		tmp = Float64(Float64(Float64(y * x) / z) + Float64(-Float64(Float64(t * x) / Float64(1.0 - z))));
                                            	else
                                            		tmp = t_1;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(x, y, z, t)
                                            	t_1 = x * ((y / z) - (t * (1.0 / (1.0 - z))));
                                            	t_2 = x * ((y / z) - (t / (1.0 - z)));
                                            	tmp = 0.0;
                                            	if (t_2 < -7.623226303312042e-196)
                                            		tmp = t_1;
                                            	elseif (t_2 < 1.4133944927702302e-211)
                                            		tmp = ((y * x) / z) + -((t * x) / (1.0 - z));
                                            	else
                                            		tmp = t_1;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t * N[(1.0 / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$2, -7.623226303312042e-196], t$95$1, If[Less[t$95$2, 1.4133944927702302e-211], N[(N[(N[(y * x), $MachinePrecision] / z), $MachinePrecision] + (-N[(N[(t * x), $MachinePrecision] / N[(1.0 - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], t$95$1]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_1 := x \cdot \left(\frac{y}{z} - t \cdot \frac{1}{1 - z}\right)\\
                                            t_2 := x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\\
                                            \mathbf{if}\;t\_2 < -7.623226303312042 \cdot 10^{-196}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            \mathbf{elif}\;t\_2 < 1.4133944927702302 \cdot 10^{-211}:\\
                                            \;\;\;\;\frac{y \cdot x}{z} + \left(-\frac{t \cdot x}{1 - z}\right)\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_1\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            

                                            Reproduce

                                            ?
                                            herbie shell --seed 2024363 
                                            (FPCore (x y z t)
                                              :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
                                              :precision binary64
                                            
                                              :alt
                                              (! :herbie-platform default (if (< (* x (- (/ y z) (/ t (- 1 z)))) -3811613151656021/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* x (- (/ y z) (* t (/ 1 (- 1 z))))) (if (< (* x (- (/ y z) (/ t (- 1 z)))) 7066972463851151/50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (/ (* y x) z) (- (/ (* t x) (- 1 z)))) (* x (- (/ y z) (* t (/ 1 (- 1 z))))))))
                                            
                                              (* x (- (/ y z) (/ t (- 1.0 z)))))