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

Percentage Accurate: 94.7% → 98.3%
Time: 4.1s
Alternatives: 11
Speedup: 0.3×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 94.7% 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.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y}{z} - \frac{t}{1 - z}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+282}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z}\\ \mathbf{elif}\;t\_1 \leq 10^{+303}:\\ \;\;\;\;x \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
   (if (<= t_1 -1e+282)
     (/ (fma (- t) (* z x) (* y x)) z)
     (if (<= t_1 1e+303) (* x t_1) (* (/ x z) y)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y / z) - (t / (1.0 - z));
	double tmp;
	if (t_1 <= -1e+282) {
		tmp = fma(-t, (z * x), (y * x)) / z;
	} else if (t_1 <= 1e+303) {
		tmp = x * t_1;
	} else {
		tmp = (x / z) * y;
	}
	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 <= -1e+282)
		tmp = Float64(fma(Float64(-t), Float64(z * x), Float64(y * x)) / z);
	elseif (t_1 <= 1e+303)
		tmp = Float64(x * t_1);
	else
		tmp = Float64(Float64(x / z) * y);
	end
	return 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[LessEqual[t$95$1, -1e+282], N[(N[((-t) * N[(z * x), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t$95$1, 1e+303], N[(x * t$95$1), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 10^{+303}:\\
\;\;\;\;x \cdot t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -1.00000000000000003e282

    1. Initial program 76.5%

      \[x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right) \]
    2. 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}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-1 \cdot t, x \cdot z, x \cdot y\right)}{z} \]
      4. mul-1-negN/A

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, x \cdot y\right)}{z} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(-t, z \cdot x, y \cdot x\right)}{z} \]
      9. lower-*.f6496.9

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

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

    if -1.00000000000000003e282 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 1e303

    1. Initial program 98.2%

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

    if 1e303 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
      11. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
      12. lower-/.f6498.7

        \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
    4. Applied rewrites98.7%

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

      \[\leadsto \frac{x}{z} \cdot y \]
    6. Step-by-step derivation
      1. lift-/.f6498.3

        \[\leadsto \frac{x}{z} \cdot y \]
    7. Applied rewrites98.3%

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

Alternative 2: 98.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot y\\
t_2 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+303}:\\
\;\;\;\;x \cdot t\_2\\

\mathbf{else}:\\
\;\;\;\;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 1e303 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z)))

    1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
      11. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
      12. lower-/.f6499.3

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

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

      \[\leadsto \frac{x}{z} \cdot y \]
    6. Step-by-step derivation
      1. lift-/.f6499.1

        \[\leadsto \frac{x}{z} \cdot y \]
    7. Applied rewrites99.1%

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

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

    1. Initial program 98.2%

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

Alternative 3: 94.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 0.0128:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - \mathsf{fma}\left(t, z, t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.80000000000000004 or 0.0128000000000000006 < z

    1. Initial program 97.0%

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

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

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

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

        \[\leadsto x \cdot \frac{y - \left(\mathsf{neg}\left(t\right)\right)}{z} \]
      4. lower-neg.f6496.2

        \[\leadsto x \cdot \frac{y - \left(-t\right)}{z} \]
    4. Applied rewrites96.2%

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

    if -0.80000000000000004 < z < 0.0128000000000000006

    1. Initial program 92.4%

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

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

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

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

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

Alternative 4: 93.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y - \left(-t\right)}{z}\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.0128:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (/ (- y (- t)) z))))
   (if (<= z -1.0) t_1 (if (<= z 0.0128) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = x * ((y - -t) / z);
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= 0.0128) {
		tmp = x * ((y / z) - 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 = x * ((y - -t) / z)
    if (z <= (-1.0d0)) then
        tmp = t_1
    else if (z <= 0.0128d0) then
        tmp = x * ((y / z) - 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 = x * ((y - -t) / z);
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= 0.0128) {
		tmp = x * ((y / z) - t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * ((y - -t) / z)
	tmp = 0
	if z <= -1.0:
		tmp = t_1
	elif z <= 0.0128:
		tmp = x * ((y / z) - t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(Float64(y - Float64(-t)) / z))
	tmp = 0.0
	if (z <= -1.0)
		tmp = t_1;
	elseif (z <= 0.0128)
		tmp = Float64(x * Float64(Float64(y / z) - t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * ((y - -t) / z);
	tmp = 0.0;
	if (z <= -1.0)
		tmp = t_1;
	elseif (z <= 0.0128)
		tmp = x * ((y / z) - t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - (-t)), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 0.0128], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 0.0128:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1 or 0.0128000000000000006 < z

    1. Initial program 97.0%

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

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

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

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

        \[\leadsto x \cdot \frac{y - \left(\mathsf{neg}\left(t\right)\right)}{z} \]
      4. lower-neg.f6496.2

        \[\leadsto x \cdot \frac{y - \left(-t\right)}{z} \]
    4. Applied rewrites96.2%

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

    if -1 < z < 0.0128000000000000006

    1. Initial program 92.4%

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

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

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

    Alternative 5: 89.0% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\left(y - \left(-t\right)\right) \cdot x}{z}\\ \mathbf{if}\;z \leq -0.02:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 0.0128:\\ \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (/ (* (- y (- t)) x) z)))
       (if (<= z -0.02) t_1 (if (<= z 0.0128) (* x (- (/ y z) t)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = ((y - -t) * x) / z;
    	double tmp;
    	if (z <= -0.02) {
    		tmp = t_1;
    	} else if (z <= 0.0128) {
    		tmp = x * ((y / z) - 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 - -t) * x) / z
        if (z <= (-0.02d0)) then
            tmp = t_1
        else if (z <= 0.0128d0) then
            tmp = x * ((y / z) - 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 - -t) * x) / z;
    	double tmp;
    	if (z <= -0.02) {
    		tmp = t_1;
    	} else if (z <= 0.0128) {
    		tmp = x * ((y / z) - t);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = ((y - -t) * x) / z
    	tmp = 0
    	if z <= -0.02:
    		tmp = t_1
    	elif z <= 0.0128:
    		tmp = x * ((y / z) - t)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(Float64(y - Float64(-t)) * x) / z)
    	tmp = 0.0
    	if (z <= -0.02)
    		tmp = t_1;
    	elseif (z <= 0.0128)
    		tmp = Float64(x * Float64(Float64(y / z) - t));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = ((y - -t) * x) / z;
    	tmp = 0.0;
    	if (z <= -0.02)
    		tmp = t_1;
    	elseif (z <= 0.0128)
    		tmp = x * ((y / z) - t);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - (-t)), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -0.02], t$95$1, If[LessEqual[z, 0.0128], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \frac{\left(y - \left(-t\right)\right) \cdot x}{z}\\
    \mathbf{if}\;z \leq -0.02:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 0.0128:\\
    \;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -0.0200000000000000004 or 0.0128000000000000006 < z

      1. Initial program 97.0%

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(y - \left(-t\right)\right) \cdot x}{z} \]
      4. Applied rewrites86.2%

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

      if -0.0200000000000000004 < z < 0.0128000000000000006

      1. Initial program 92.3%

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

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

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

      Alternative 6: 72.7% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{-x}{1 - z} \cdot t\\ \mathbf{if}\;t \leq -9.5 \cdot 10^{+45}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+24}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (/ (- x) (- 1.0 z)) t)))
         (if (<= t -9.5e+45) t_1 (if (<= t 4.5e+24) (* (/ x z) y) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (-x / (1.0 - z)) * t;
      	double tmp;
      	if (t <= -9.5e+45) {
      		tmp = t_1;
      	} else if (t <= 4.5e+24) {
      		tmp = (x / z) * y;
      	} 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 = (-x / (1.0d0 - z)) * t
          if (t <= (-9.5d+45)) then
              tmp = t_1
          else if (t <= 4.5d+24) then
              tmp = (x / z) * y
          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 / (1.0 - z)) * t;
      	double tmp;
      	if (t <= -9.5e+45) {
      		tmp = t_1;
      	} else if (t <= 4.5e+24) {
      		tmp = (x / z) * y;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z, t):
      	t_1 = (-x / (1.0 - z)) * t
      	tmp = 0
      	if t <= -9.5e+45:
      		tmp = t_1
      	elif t <= 4.5e+24:
      		tmp = (x / z) * y
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(Float64(-x) / Float64(1.0 - z)) * t)
      	tmp = 0.0
      	if (t <= -9.5e+45)
      		tmp = t_1;
      	elseif (t <= 4.5e+24)
      		tmp = Float64(Float64(x / z) * y);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = (-x / (1.0 - z)) * t;
      	tmp = 0.0;
      	if (t <= -9.5e+45)
      		tmp = t_1;
      	elseif (t <= 4.5e+24)
      		tmp = (x / z) * y;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-x) / N[(1.0 - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.5e+45], t$95$1, If[LessEqual[t, 4.5e+24], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \frac{-x}{1 - z} \cdot t\\
      \mathbf{if}\;t \leq -9.5 \cdot 10^{+45}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t \leq 4.5 \cdot 10^{+24}:\\
      \;\;\;\;\frac{x}{z} \cdot y\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -9.4999999999999998e45 or 4.50000000000000019e24 < t

        1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(x, \frac{y}{t \cdot z}, -\frac{x}{1 - z}\right) \cdot t \]
          11. lift--.f6487.9

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

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

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

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

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

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

            \[\leadsto \frac{-x}{1 - z} \cdot t \]
          5. lift--.f6463.1

            \[\leadsto \frac{-x}{1 - z} \cdot t \]
        7. Applied rewrites63.1%

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

        if -9.4999999999999998e45 < t < 4.50000000000000019e24

        1. Initial program 93.5%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
          11. lift--.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
          12. lower-/.f6490.9

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

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

          \[\leadsto \frac{x}{z} \cdot y \]
        6. Step-by-step derivation
          1. lift-/.f6479.9

            \[\leadsto \frac{x}{z} \cdot y \]
        7. Applied rewrites79.9%

          \[\leadsto \frac{x}{z} \cdot y \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 7: 72.4% accurate, 0.9× speedup?

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

        1. Initial program 94.6%

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

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

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

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

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

            \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
          5. lift--.f6458.5

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

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

          \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
        6. Step-by-step derivation
          1. lower-/.f6458.5

            \[\leadsto x \cdot \frac{t}{z} \]
        7. Applied rewrites58.5%

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

        if -3.80000000000000012e160 < z < 1.95000000000000003e67

        1. Initial program 94.2%

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

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

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

          if 1.95000000000000003e67 < z < 1.05999999999999997e141

          1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(x, \frac{y}{t \cdot z}, -\frac{x}{1 - z}\right) \cdot t \]
            11. lift--.f6484.6

              \[\leadsto \mathsf{fma}\left(x, \frac{y}{t \cdot z}, -\frac{x}{1 - z}\right) \cdot t \]
          4. Applied rewrites84.6%

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

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

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

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

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

              \[\leadsto \frac{-x}{1 - z} \cdot t \]
            5. lift--.f6450.4

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

            \[\leadsto \frac{-x}{1 - z} \cdot t \]
          8. Taylor expanded in z around inf

            \[\leadsto \frac{x}{z} \cdot t \]
          9. Step-by-step derivation
            1. lift-/.f6450.4

              \[\leadsto \frac{x}{z} \cdot t \]
          10. Applied rewrites50.4%

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

          if 1.05999999999999997e141 < z

          1. Initial program 95.2%

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

            \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
          3. Step-by-step derivation
            1. lift-/.f6457.0

              \[\leadsto x \cdot \frac{y}{\color{blue}{z}} \]
          4. Applied rewrites57.0%

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

        Alternative 8: 64.9% accurate, 1.1× speedup?

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

          1. Initial program 95.8%

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

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

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

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

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

              \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
            5. lift--.f6480.5

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

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

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

              \[\leadsto x \cdot \left(\mathsf{neg}\left(t\right)\right) \]
            2. lift-neg.f6440.2

              \[\leadsto x \cdot \left(-t\right) \]
          7. Applied rewrites40.2%

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

          if -5.4999999999999998e159 < t < 4.50000000000000019e24

          1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
            11. lift--.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
            12. lower-/.f6487.9

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

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

            \[\leadsto \frac{x}{z} \cdot y \]
          6. Step-by-step derivation
            1. lift-/.f6475.0

              \[\leadsto \frac{x}{z} \cdot y \]
          7. Applied rewrites75.0%

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

          if 4.50000000000000019e24 < t

          1. Initial program 96.5%

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

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

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

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

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

              \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
            5. lift--.f6469.2

              \[\leadsto x \cdot \frac{-t}{1 - \color{blue}{z}} \]
          4. Applied rewrites69.2%

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

            \[\leadsto x \cdot \frac{t}{\color{blue}{z}} \]
          6. Step-by-step derivation
            1. lower-/.f6449.4

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

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

        Alternative 9: 64.3% accurate, 1.1× speedup?

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

          1. Initial program 95.8%

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

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

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

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

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

              \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
            5. lift--.f6480.5

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

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

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

              \[\leadsto x \cdot \left(\mathsf{neg}\left(t\right)\right) \]
            2. lift-neg.f6440.2

              \[\leadsto x \cdot \left(-t\right) \]
          7. Applied rewrites40.2%

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

          if -5.4999999999999998e159 < t < 3.4999999999999998e133

          1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
            11. lift--.f64N/A

              \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
            12. lower-/.f6486.4

              \[\leadsto \mathsf{fma}\left(\frac{-t}{y}, \frac{x}{1 - z}, \frac{x}{z}\right) \cdot y \]
          4. Applied rewrites86.4%

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

            \[\leadsto \frac{x}{z} \cdot y \]
          6. Step-by-step derivation
            1. lift-/.f6472.0

              \[\leadsto \frac{x}{z} \cdot y \]
          7. Applied rewrites72.0%

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

          if 3.4999999999999998e133 < t

          1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(x, \frac{y}{t \cdot z}, -\frac{x}{1 - z}\right) \cdot t \]
            11. lift--.f6486.0

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

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

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

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

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

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

              \[\leadsto \frac{-x}{1 - z} \cdot t \]
            5. lift--.f6467.6

              \[\leadsto \frac{-x}{1 - z} \cdot t \]
          7. Applied rewrites67.6%

            \[\leadsto \frac{-x}{1 - z} \cdot t \]
          8. Taylor expanded in z around inf

            \[\leadsto \frac{x}{z} \cdot t \]
          9. Step-by-step derivation
            1. lift-/.f6445.1

              \[\leadsto \frac{x}{z} \cdot t \]
          10. Applied rewrites45.1%

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

        Alternative 10: 42.6% accurate, 1.1× speedup?

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

          1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(x, \frac{y}{t \cdot z}, -\frac{x}{1 - z}\right) \cdot t \]
            11. lift--.f6482.9

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

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

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

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

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

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

              \[\leadsto \frac{-x}{1 - z} \cdot t \]
            5. lift--.f6452.7

              \[\leadsto \frac{-x}{1 - z} \cdot t \]
          7. Applied rewrites52.7%

            \[\leadsto \frac{-x}{1 - z} \cdot t \]
          8. Taylor expanded in z around inf

            \[\leadsto \frac{x}{z} \cdot t \]
          9. Step-by-step derivation
            1. lift-/.f6450.0

              \[\leadsto \frac{x}{z} \cdot t \]
          10. Applied rewrites50.0%

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

          if -9.99999999999999929e-40 < z < 0.0128000000000000006

          1. Initial program 92.0%

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

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

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

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

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

              \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
            5. lift--.f6434.5

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

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

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

              \[\leadsto x \cdot \left(\mathsf{neg}\left(t\right)\right) \]
            2. lift-neg.f6434.2

              \[\leadsto x \cdot \left(-t\right) \]
          7. Applied rewrites34.2%

            \[\leadsto x \cdot \left(-t\right) \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 11: 23.6% accurate, 3.2× 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 94.7%

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

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

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

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

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

            \[\leadsto x \cdot \frac{-t}{\color{blue}{1} - z} \]
          5. lift--.f6446.6

            \[\leadsto x \cdot \frac{-t}{1 - \color{blue}{z}} \]
        4. Applied rewrites46.6%

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

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

            \[\leadsto x \cdot \left(\mathsf{neg}\left(t\right)\right) \]
          2. lift-neg.f6423.6

            \[\leadsto x \cdot \left(-t\right) \]
        7. Applied rewrites23.6%

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

        Reproduce

        ?
        herbie shell --seed 2025119 
        (FPCore (x y z t)
          :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
          :precision binary64
          (* x (- (/ y z) (/ t (- 1.0 z)))))