Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3

Percentage Accurate: 84.4% → 95.7%
Time: 7.1s
Alternatives: 13
Speedup: 0.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 84.4% accurate, 1.0× speedup?

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

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

Alternative 1: 95.7% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := \frac{x\_m \cdot \left(y - z\right)}{t - z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq 5 \cdot 10^{+160}\right):\\ \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (* x_m (- y z)) (- t z))))
   (*
    x_s
    (if (or (<= t_1 0.0) (not (<= t_1 5e+160)))
      (* (- y z) (/ x_m (- t z)))
      t_1))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m * (y - z)) / (t - z);
	double tmp;
	if ((t_1 <= 0.0) || !(t_1 <= 5e+160)) {
		tmp = (y - z) * (x_m / (t - z));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
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_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m * (y - z)) / (t - z)
    if ((t_1 <= 0.0d0) .or. (.not. (t_1 <= 5d+160))) then
        tmp = (y - z) * (x_m / (t - z))
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m * (y - z)) / (t - z);
	double tmp;
	if ((t_1 <= 0.0) || !(t_1 <= 5e+160)) {
		tmp = (y - z) * (x_m / (t - z));
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = (x_m * (y - z)) / (t - z)
	tmp = 0
	if (t_1 <= 0.0) or not (t_1 <= 5e+160):
		tmp = (y - z) * (x_m / (t - z))
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z))
	tmp = 0.0
	if ((t_1 <= 0.0) || !(t_1 <= 5e+160))
		tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z)));
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m * (y - z)) / (t - z);
	tmp = 0.0;
	if ((t_1 <= 0.0) || ~((t_1 <= 5e+160)))
		tmp = (y - z) * (x_m / (t - z));
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, 5e+160]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := \frac{x\_m \cdot \left(y - z\right)}{t - z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq 5 \cdot 10^{+160}\right):\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\

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


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

    1. Initial program 76.9%

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.0000000000000002e160

    1. Initial program 99.0%

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

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

Alternative 2: 39.3% accurate, 0.3× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := \frac{x\_m \cdot \left(y - z\right)}{t - z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\frac{x\_m}{z} \cdot y\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+162}:\\ \;\;\;\;x\_m\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x\_m}{z}\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (/ (* x_m (- y z)) (- t z))))
   (*
    x_s
    (if (<= t_1 0.0)
      (* (/ x_m z) y)
      (if (<= t_1 2e+162) x_m (* z (/ x_m z)))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m * (y - z)) / (t - z);
	double tmp;
	if (t_1 <= 0.0) {
		tmp = (x_m / z) * y;
	} else if (t_1 <= 2e+162) {
		tmp = x_m;
	} else {
		tmp = z * (x_m / z);
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
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_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    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_m * (y - z)) / (t - z)
    if (t_1 <= 0.0d0) then
        tmp = (x_m / z) * y
    else if (t_1 <= 2d+162) then
        tmp = x_m
    else
        tmp = z * (x_m / z)
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = (x_m * (y - z)) / (t - z);
	double tmp;
	if (t_1 <= 0.0) {
		tmp = (x_m / z) * y;
	} else if (t_1 <= 2e+162) {
		tmp = x_m;
	} else {
		tmp = z * (x_m / z);
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = (x_m * (y - z)) / (t - z)
	tmp = 0
	if t_1 <= 0.0:
		tmp = (x_m / z) * y
	elif t_1 <= 2e+162:
		tmp = x_m
	else:
		tmp = z * (x_m / z)
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z))
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = Float64(Float64(x_m / z) * y);
	elseif (t_1 <= 2e+162)
		tmp = x_m;
	else
		tmp = Float64(z * Float64(x_m / z));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = (x_m * (y - z)) / (t - z);
	tmp = 0.0;
	if (t_1 <= 0.0)
		tmp = (x_m / z) * y;
	elseif (t_1 <= 2e+162)
		tmp = x_m;
	else
		tmp = z * (x_m / z);
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[t$95$1, 0.0], N[(N[(x$95$m / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 2e+162], x$95$m, N[(z * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+162}:\\
\;\;\;\;x\_m\\

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


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

    1. Initial program 82.4%

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

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

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

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

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

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

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

            if 0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.9999999999999999e162

            1. Initial program 99.0%

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

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

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

              if 1.9999999999999999e162 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

              1. Initial program 56.4%

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

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

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

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

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

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

                  Alternative 3: 36.4% accurate, 0.5× speedup?

                  \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{x\_m \cdot \left(y - z\right)}{t - z} \leq 2 \cdot 10^{+162}:\\ \;\;\;\;x\_m\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x\_m}{z}\\ \end{array} \end{array} \]
                  x\_m = (fabs.f64 x)
                  x\_s = (copysign.f64 #s(literal 1 binary64) x)
                  (FPCore (x_s x_m y z t)
                   :precision binary64
                   (* x_s (if (<= (/ (* x_m (- y z)) (- t z)) 2e+162) x_m (* z (/ x_m z)))))
                  x\_m = fabs(x);
                  x\_s = copysign(1.0, x);
                  double code(double x_s, double x_m, double y, double z, double t) {
                  	double tmp;
                  	if (((x_m * (y - z)) / (t - z)) <= 2e+162) {
                  		tmp = x_m;
                  	} else {
                  		tmp = z * (x_m / z);
                  	}
                  	return x_s * tmp;
                  }
                  
                  x\_m =     private
                  x\_s =     private
                  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_s, x_m, y, z, t)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x_s
                      real(8), intent (in) :: x_m
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8) :: tmp
                      if (((x_m * (y - z)) / (t - z)) <= 2d+162) then
                          tmp = x_m
                      else
                          tmp = z * (x_m / z)
                      end if
                      code = x_s * tmp
                  end function
                  
                  x\_m = Math.abs(x);
                  x\_s = Math.copySign(1.0, x);
                  public static double code(double x_s, double x_m, double y, double z, double t) {
                  	double tmp;
                  	if (((x_m * (y - z)) / (t - z)) <= 2e+162) {
                  		tmp = x_m;
                  	} else {
                  		tmp = z * (x_m / z);
                  	}
                  	return x_s * tmp;
                  }
                  
                  x\_m = math.fabs(x)
                  x\_s = math.copysign(1.0, x)
                  def code(x_s, x_m, y, z, t):
                  	tmp = 0
                  	if ((x_m * (y - z)) / (t - z)) <= 2e+162:
                  		tmp = x_m
                  	else:
                  		tmp = z * (x_m / z)
                  	return x_s * tmp
                  
                  x\_m = abs(x)
                  x\_s = copysign(1.0, x)
                  function code(x_s, x_m, y, z, t)
                  	tmp = 0.0
                  	if (Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)) <= 2e+162)
                  		tmp = x_m;
                  	else
                  		tmp = Float64(z * Float64(x_m / z));
                  	end
                  	return Float64(x_s * tmp)
                  end
                  
                  x\_m = abs(x);
                  x\_s = sign(x) * abs(1.0);
                  function tmp_2 = code(x_s, x_m, y, z, t)
                  	tmp = 0.0;
                  	if (((x_m * (y - z)) / (t - z)) <= 2e+162)
                  		tmp = x_m;
                  	else
                  		tmp = z * (x_m / z);
                  	end
                  	tmp_2 = x_s * tmp;
                  end
                  
                  x\_m = N[Abs[x], $MachinePrecision]
                  x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], 2e+162], x$95$m, N[(z * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                  
                  \begin{array}{l}
                  x\_m = \left|x\right|
                  \\
                  x\_s = \mathsf{copysign}\left(1, x\right)
                  
                  \\
                  x\_s \cdot \begin{array}{l}
                  \mathbf{if}\;\frac{x\_m \cdot \left(y - z\right)}{t - z} \leq 2 \cdot 10^{+162}:\\
                  \;\;\;\;x\_m\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;z \cdot \frac{x\_m}{z}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.9999999999999999e162

                    1. Initial program 88.4%

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

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

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

                      if 1.9999999999999999e162 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

                      1. Initial program 56.4%

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

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

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

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

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

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

                          Alternative 4: 75.0% accurate, 0.6× speedup?

                          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+112}:\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-67} \lor \neg \left(z \leq 3.7 \cdot 10^{+28}\right):\\ \;\;\;\;\frac{z}{t - z} \cdot \left(-x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x\_m}{t - z}\\ \end{array} \end{array} \]
                          x\_m = (fabs.f64 x)
                          x\_s = (copysign.f64 #s(literal 1 binary64) x)
                          (FPCore (x_s x_m y z t)
                           :precision binary64
                           (*
                            x_s
                            (if (<= z -2.1e+112)
                              (* (/ (- z y) z) x_m)
                              (if (or (<= z -8.2e-67) (not (<= z 3.7e+28)))
                                (* (/ z (- t z)) (- x_m))
                                (* y (/ x_m (- t z)))))))
                          x\_m = fabs(x);
                          x\_s = copysign(1.0, x);
                          double code(double x_s, double x_m, double y, double z, double t) {
                          	double tmp;
                          	if (z <= -2.1e+112) {
                          		tmp = ((z - y) / z) * x_m;
                          	} else if ((z <= -8.2e-67) || !(z <= 3.7e+28)) {
                          		tmp = (z / (t - z)) * -x_m;
                          	} else {
                          		tmp = y * (x_m / (t - z));
                          	}
                          	return x_s * tmp;
                          }
                          
                          x\_m =     private
                          x\_s =     private
                          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_s, x_m, y, z, t)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x_s
                              real(8), intent (in) :: x_m
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: t
                              real(8) :: tmp
                              if (z <= (-2.1d+112)) then
                                  tmp = ((z - y) / z) * x_m
                              else if ((z <= (-8.2d-67)) .or. (.not. (z <= 3.7d+28))) then
                                  tmp = (z / (t - z)) * -x_m
                              else
                                  tmp = y * (x_m / (t - z))
                              end if
                              code = x_s * tmp
                          end function
                          
                          x\_m = Math.abs(x);
                          x\_s = Math.copySign(1.0, x);
                          public static double code(double x_s, double x_m, double y, double z, double t) {
                          	double tmp;
                          	if (z <= -2.1e+112) {
                          		tmp = ((z - y) / z) * x_m;
                          	} else if ((z <= -8.2e-67) || !(z <= 3.7e+28)) {
                          		tmp = (z / (t - z)) * -x_m;
                          	} else {
                          		tmp = y * (x_m / (t - z));
                          	}
                          	return x_s * tmp;
                          }
                          
                          x\_m = math.fabs(x)
                          x\_s = math.copysign(1.0, x)
                          def code(x_s, x_m, y, z, t):
                          	tmp = 0
                          	if z <= -2.1e+112:
                          		tmp = ((z - y) / z) * x_m
                          	elif (z <= -8.2e-67) or not (z <= 3.7e+28):
                          		tmp = (z / (t - z)) * -x_m
                          	else:
                          		tmp = y * (x_m / (t - z))
                          	return x_s * tmp
                          
                          x\_m = abs(x)
                          x\_s = copysign(1.0, x)
                          function code(x_s, x_m, y, z, t)
                          	tmp = 0.0
                          	if (z <= -2.1e+112)
                          		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
                          	elseif ((z <= -8.2e-67) || !(z <= 3.7e+28))
                          		tmp = Float64(Float64(z / Float64(t - z)) * Float64(-x_m));
                          	else
                          		tmp = Float64(y * Float64(x_m / Float64(t - z)));
                          	end
                          	return Float64(x_s * tmp)
                          end
                          
                          x\_m = abs(x);
                          x\_s = sign(x) * abs(1.0);
                          function tmp_2 = code(x_s, x_m, y, z, t)
                          	tmp = 0.0;
                          	if (z <= -2.1e+112)
                          		tmp = ((z - y) / z) * x_m;
                          	elseif ((z <= -8.2e-67) || ~((z <= 3.7e+28)))
                          		tmp = (z / (t - z)) * -x_m;
                          	else
                          		tmp = y * (x_m / (t - z));
                          	end
                          	tmp_2 = x_s * tmp;
                          end
                          
                          x\_m = N[Abs[x], $MachinePrecision]
                          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                          code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.1e+112], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], If[Or[LessEqual[z, -8.2e-67], N[Not[LessEqual[z, 3.7e+28]], $MachinePrecision]], N[(N[(z / N[(t - z), $MachinePrecision]), $MachinePrecision] * (-x$95$m)), $MachinePrecision], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
                          
                          \begin{array}{l}
                          x\_m = \left|x\right|
                          \\
                          x\_s = \mathsf{copysign}\left(1, x\right)
                          
                          \\
                          x\_s \cdot \begin{array}{l}
                          \mathbf{if}\;z \leq -2.1 \cdot 10^{+112}:\\
                          \;\;\;\;\frac{z - y}{z} \cdot x\_m\\
                          
                          \mathbf{elif}\;z \leq -8.2 \cdot 10^{-67} \lor \neg \left(z \leq 3.7 \cdot 10^{+28}\right):\\
                          \;\;\;\;\frac{z}{t - z} \cdot \left(-x\_m\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;y \cdot \frac{x\_m}{t - z}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if z < -2.0999999999999999e112

                            1. Initial program 75.9%

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

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

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

                              if -2.0999999999999999e112 < z < -8.1999999999999994e-67 or 3.6999999999999999e28 < z

                              1. Initial program 82.7%

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

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

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

                                if -8.1999999999999994e-67 < z < 3.6999999999999999e28

                                1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{y} \cdot \frac{x}{t - z} \]
                                7. Recombined 3 regimes into one program.
                                8. Final simplification82.8%

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

                                Alternative 5: 90.1% accurate, 0.7× speedup?

                                \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+120} \lor \neg \left(z \leq 9.5 \cdot 10^{+163}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\ \end{array} \end{array} \]
                                x\_m = (fabs.f64 x)
                                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                (FPCore (x_s x_m y z t)
                                 :precision binary64
                                 (*
                                  x_s
                                  (if (or (<= z -1.16e+120) (not (<= z 9.5e+163)))
                                    (* (/ (- z y) z) x_m)
                                    (* (- y z) (/ x_m (- t z))))))
                                x\_m = fabs(x);
                                x\_s = copysign(1.0, x);
                                double code(double x_s, double x_m, double y, double z, double t) {
                                	double tmp;
                                	if ((z <= -1.16e+120) || !(z <= 9.5e+163)) {
                                		tmp = ((z - y) / z) * x_m;
                                	} else {
                                		tmp = (y - z) * (x_m / (t - z));
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m =     private
                                x\_s =     private
                                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_s, x_m, y, z, t)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x_s
                                    real(8), intent (in) :: x_m
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    real(8) :: tmp
                                    if ((z <= (-1.16d+120)) .or. (.not. (z <= 9.5d+163))) then
                                        tmp = ((z - y) / z) * x_m
                                    else
                                        tmp = (y - z) * (x_m / (t - z))
                                    end if
                                    code = x_s * tmp
                                end function
                                
                                x\_m = Math.abs(x);
                                x\_s = Math.copySign(1.0, x);
                                public static double code(double x_s, double x_m, double y, double z, double t) {
                                	double tmp;
                                	if ((z <= -1.16e+120) || !(z <= 9.5e+163)) {
                                		tmp = ((z - y) / z) * x_m;
                                	} else {
                                		tmp = (y - z) * (x_m / (t - z));
                                	}
                                	return x_s * tmp;
                                }
                                
                                x\_m = math.fabs(x)
                                x\_s = math.copysign(1.0, x)
                                def code(x_s, x_m, y, z, t):
                                	tmp = 0
                                	if (z <= -1.16e+120) or not (z <= 9.5e+163):
                                		tmp = ((z - y) / z) * x_m
                                	else:
                                		tmp = (y - z) * (x_m / (t - z))
                                	return x_s * tmp
                                
                                x\_m = abs(x)
                                x\_s = copysign(1.0, x)
                                function code(x_s, x_m, y, z, t)
                                	tmp = 0.0
                                	if ((z <= -1.16e+120) || !(z <= 9.5e+163))
                                		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
                                	else
                                		tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z)));
                                	end
                                	return Float64(x_s * tmp)
                                end
                                
                                x\_m = abs(x);
                                x\_s = sign(x) * abs(1.0);
                                function tmp_2 = code(x_s, x_m, y, z, t)
                                	tmp = 0.0;
                                	if ((z <= -1.16e+120) || ~((z <= 9.5e+163)))
                                		tmp = ((z - y) / z) * x_m;
                                	else
                                		tmp = (y - z) * (x_m / (t - z));
                                	end
                                	tmp_2 = x_s * tmp;
                                end
                                
                                x\_m = N[Abs[x], $MachinePrecision]
                                x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.16e+120], N[Not[LessEqual[z, 9.5e+163]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                
                                \begin{array}{l}
                                x\_m = \left|x\right|
                                \\
                                x\_s = \mathsf{copysign}\left(1, x\right)
                                
                                \\
                                x\_s \cdot \begin{array}{l}
                                \mathbf{if}\;z \leq -1.16 \cdot 10^{+120} \lor \neg \left(z \leq 9.5 \cdot 10^{+163}\right):\\
                                \;\;\;\;\frac{z - y}{z} \cdot x\_m\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if z < -1.16000000000000003e120 or 9.50000000000000053e163 < z

                                  1. Initial program 69.6%

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

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

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

                                    if -1.16000000000000003e120 < z < 9.50000000000000053e163

                                    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

                                  Alternative 6: 62.7% accurate, 0.7× speedup?

                                  \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.3 \cdot 10^{+189}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-68}:\\ \;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z}\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \frac{x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
                                  x\_m = (fabs.f64 x)
                                  x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                  (FPCore (x_s x_m y z t)
                                   :precision binary64
                                   (*
                                    x_s
                                    (if (<= z -3.3e+189)
                                      x_m
                                      (if (<= z -1.9e-68)
                                        (* (- z y) (/ x_m z))
                                        (if (<= z 3.7e+28) (* y (/ x_m t)) x_m)))))
                                  x\_m = fabs(x);
                                  x\_s = copysign(1.0, x);
                                  double code(double x_s, double x_m, double y, double z, double t) {
                                  	double tmp;
                                  	if (z <= -3.3e+189) {
                                  		tmp = x_m;
                                  	} else if (z <= -1.9e-68) {
                                  		tmp = (z - y) * (x_m / z);
                                  	} else if (z <= 3.7e+28) {
                                  		tmp = y * (x_m / t);
                                  	} else {
                                  		tmp = x_m;
                                  	}
                                  	return x_s * tmp;
                                  }
                                  
                                  x\_m =     private
                                  x\_s =     private
                                  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_s, x_m, y, z, t)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x_s
                                      real(8), intent (in) :: x_m
                                      real(8), intent (in) :: y
                                      real(8), intent (in) :: z
                                      real(8), intent (in) :: t
                                      real(8) :: tmp
                                      if (z <= (-3.3d+189)) then
                                          tmp = x_m
                                      else if (z <= (-1.9d-68)) then
                                          tmp = (z - y) * (x_m / z)
                                      else if (z <= 3.7d+28) then
                                          tmp = y * (x_m / t)
                                      else
                                          tmp = x_m
                                      end if
                                      code = x_s * tmp
                                  end function
                                  
                                  x\_m = Math.abs(x);
                                  x\_s = Math.copySign(1.0, x);
                                  public static double code(double x_s, double x_m, double y, double z, double t) {
                                  	double tmp;
                                  	if (z <= -3.3e+189) {
                                  		tmp = x_m;
                                  	} else if (z <= -1.9e-68) {
                                  		tmp = (z - y) * (x_m / z);
                                  	} else if (z <= 3.7e+28) {
                                  		tmp = y * (x_m / t);
                                  	} else {
                                  		tmp = x_m;
                                  	}
                                  	return x_s * tmp;
                                  }
                                  
                                  x\_m = math.fabs(x)
                                  x\_s = math.copysign(1.0, x)
                                  def code(x_s, x_m, y, z, t):
                                  	tmp = 0
                                  	if z <= -3.3e+189:
                                  		tmp = x_m
                                  	elif z <= -1.9e-68:
                                  		tmp = (z - y) * (x_m / z)
                                  	elif z <= 3.7e+28:
                                  		tmp = y * (x_m / t)
                                  	else:
                                  		tmp = x_m
                                  	return x_s * tmp
                                  
                                  x\_m = abs(x)
                                  x\_s = copysign(1.0, x)
                                  function code(x_s, x_m, y, z, t)
                                  	tmp = 0.0
                                  	if (z <= -3.3e+189)
                                  		tmp = x_m;
                                  	elseif (z <= -1.9e-68)
                                  		tmp = Float64(Float64(z - y) * Float64(x_m / z));
                                  	elseif (z <= 3.7e+28)
                                  		tmp = Float64(y * Float64(x_m / t));
                                  	else
                                  		tmp = x_m;
                                  	end
                                  	return Float64(x_s * tmp)
                                  end
                                  
                                  x\_m = abs(x);
                                  x\_s = sign(x) * abs(1.0);
                                  function tmp_2 = code(x_s, x_m, y, z, t)
                                  	tmp = 0.0;
                                  	if (z <= -3.3e+189)
                                  		tmp = x_m;
                                  	elseif (z <= -1.9e-68)
                                  		tmp = (z - y) * (x_m / z);
                                  	elseif (z <= 3.7e+28)
                                  		tmp = y * (x_m / t);
                                  	else
                                  		tmp = x_m;
                                  	end
                                  	tmp_2 = x_s * tmp;
                                  end
                                  
                                  x\_m = N[Abs[x], $MachinePrecision]
                                  x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                  code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -3.3e+189], x$95$m, If[LessEqual[z, -1.9e-68], N[(N[(z - y), $MachinePrecision] * N[(x$95$m / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e+28], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], x$95$m]]]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  x\_m = \left|x\right|
                                  \\
                                  x\_s = \mathsf{copysign}\left(1, x\right)
                                  
                                  \\
                                  x\_s \cdot \begin{array}{l}
                                  \mathbf{if}\;z \leq -3.3 \cdot 10^{+189}:\\
                                  \;\;\;\;x\_m\\
                                  
                                  \mathbf{elif}\;z \leq -1.9 \cdot 10^{-68}:\\
                                  \;\;\;\;\left(z - y\right) \cdot \frac{x\_m}{z}\\
                                  
                                  \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\
                                  \;\;\;\;y \cdot \frac{x\_m}{t}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;x\_m\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if z < -3.3000000000000002e189 or 3.6999999999999999e28 < z

                                    1. Initial program 74.2%

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

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

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

                                      if -3.3000000000000002e189 < z < -1.90000000000000019e-68

                                      1. Initial program 92.3%

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

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

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

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

                                          if -1.90000000000000019e-68 < z < 3.6999999999999999e28

                                          1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \color{blue}{y} \cdot \frac{x}{t} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites67.9%

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

                                            Alternative 7: 73.5% accurate, 0.7× speedup?

                                            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{-21} \lor \neg \left(z \leq 5.6 \cdot 10^{+49}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t}\\ \end{array} \end{array} \]
                                            x\_m = (fabs.f64 x)
                                            x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                            (FPCore (x_s x_m y z t)
                                             :precision binary64
                                             (*
                                              x_s
                                              (if (or (<= z -1.3e-21) (not (<= z 5.6e+49)))
                                                (* (/ (- z y) z) x_m)
                                                (* (- y z) (/ x_m t)))))
                                            x\_m = fabs(x);
                                            x\_s = copysign(1.0, x);
                                            double code(double x_s, double x_m, double y, double z, double t) {
                                            	double tmp;
                                            	if ((z <= -1.3e-21) || !(z <= 5.6e+49)) {
                                            		tmp = ((z - y) / z) * x_m;
                                            	} else {
                                            		tmp = (y - z) * (x_m / t);
                                            	}
                                            	return x_s * tmp;
                                            }
                                            
                                            x\_m =     private
                                            x\_s =     private
                                            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_s, x_m, y, z, t)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: x_s
                                                real(8), intent (in) :: x_m
                                                real(8), intent (in) :: y
                                                real(8), intent (in) :: z
                                                real(8), intent (in) :: t
                                                real(8) :: tmp
                                                if ((z <= (-1.3d-21)) .or. (.not. (z <= 5.6d+49))) then
                                                    tmp = ((z - y) / z) * x_m
                                                else
                                                    tmp = (y - z) * (x_m / t)
                                                end if
                                                code = x_s * tmp
                                            end function
                                            
                                            x\_m = Math.abs(x);
                                            x\_s = Math.copySign(1.0, x);
                                            public static double code(double x_s, double x_m, double y, double z, double t) {
                                            	double tmp;
                                            	if ((z <= -1.3e-21) || !(z <= 5.6e+49)) {
                                            		tmp = ((z - y) / z) * x_m;
                                            	} else {
                                            		tmp = (y - z) * (x_m / t);
                                            	}
                                            	return x_s * tmp;
                                            }
                                            
                                            x\_m = math.fabs(x)
                                            x\_s = math.copysign(1.0, x)
                                            def code(x_s, x_m, y, z, t):
                                            	tmp = 0
                                            	if (z <= -1.3e-21) or not (z <= 5.6e+49):
                                            		tmp = ((z - y) / z) * x_m
                                            	else:
                                            		tmp = (y - z) * (x_m / t)
                                            	return x_s * tmp
                                            
                                            x\_m = abs(x)
                                            x\_s = copysign(1.0, x)
                                            function code(x_s, x_m, y, z, t)
                                            	tmp = 0.0
                                            	if ((z <= -1.3e-21) || !(z <= 5.6e+49))
                                            		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
                                            	else
                                            		tmp = Float64(Float64(y - z) * Float64(x_m / t));
                                            	end
                                            	return Float64(x_s * tmp)
                                            end
                                            
                                            x\_m = abs(x);
                                            x\_s = sign(x) * abs(1.0);
                                            function tmp_2 = code(x_s, x_m, y, z, t)
                                            	tmp = 0.0;
                                            	if ((z <= -1.3e-21) || ~((z <= 5.6e+49)))
                                            		tmp = ((z - y) / z) * x_m;
                                            	else
                                            		tmp = (y - z) * (x_m / t);
                                            	end
                                            	tmp_2 = x_s * tmp;
                                            end
                                            
                                            x\_m = N[Abs[x], $MachinePrecision]
                                            x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                            code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.3e-21], N[Not[LessEqual[z, 5.6e+49]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            x\_m = \left|x\right|
                                            \\
                                            x\_s = \mathsf{copysign}\left(1, x\right)
                                            
                                            \\
                                            x\_s \cdot \begin{array}{l}
                                            \mathbf{if}\;z \leq -1.3 \cdot 10^{-21} \lor \neg \left(z \leq 5.6 \cdot 10^{+49}\right):\\
                                            \;\;\;\;\frac{z - y}{z} \cdot x\_m\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if z < -1.30000000000000009e-21 or 5.5999999999999996e49 < z

                                              1. Initial program 79.0%

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

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

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

                                                if -1.30000000000000009e-21 < z < 5.5999999999999996e49

                                                1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 8: 74.4% accurate, 0.7× speedup?

                                                \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+16} \lor \neg \left(z \leq 5.6 \cdot 10^{+49}\right):\\ \;\;\;\;\frac{z - y}{z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{t} \cdot x\_m\\ \end{array} \end{array} \]
                                                x\_m = (fabs.f64 x)
                                                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                (FPCore (x_s x_m y z t)
                                                 :precision binary64
                                                 (*
                                                  x_s
                                                  (if (or (<= z -1.9e+16) (not (<= z 5.6e+49)))
                                                    (* (/ (- z y) z) x_m)
                                                    (* (/ (- y z) t) x_m))))
                                                x\_m = fabs(x);
                                                x\_s = copysign(1.0, x);
                                                double code(double x_s, double x_m, double y, double z, double t) {
                                                	double tmp;
                                                	if ((z <= -1.9e+16) || !(z <= 5.6e+49)) {
                                                		tmp = ((z - y) / z) * x_m;
                                                	} else {
                                                		tmp = ((y - z) / t) * x_m;
                                                	}
                                                	return x_s * tmp;
                                                }
                                                
                                                x\_m =     private
                                                x\_s =     private
                                                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_s, x_m, y, z, t)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: x_s
                                                    real(8), intent (in) :: x_m
                                                    real(8), intent (in) :: y
                                                    real(8), intent (in) :: z
                                                    real(8), intent (in) :: t
                                                    real(8) :: tmp
                                                    if ((z <= (-1.9d+16)) .or. (.not. (z <= 5.6d+49))) then
                                                        tmp = ((z - y) / z) * x_m
                                                    else
                                                        tmp = ((y - z) / t) * x_m
                                                    end if
                                                    code = x_s * tmp
                                                end function
                                                
                                                x\_m = Math.abs(x);
                                                x\_s = Math.copySign(1.0, x);
                                                public static double code(double x_s, double x_m, double y, double z, double t) {
                                                	double tmp;
                                                	if ((z <= -1.9e+16) || !(z <= 5.6e+49)) {
                                                		tmp = ((z - y) / z) * x_m;
                                                	} else {
                                                		tmp = ((y - z) / t) * x_m;
                                                	}
                                                	return x_s * tmp;
                                                }
                                                
                                                x\_m = math.fabs(x)
                                                x\_s = math.copysign(1.0, x)
                                                def code(x_s, x_m, y, z, t):
                                                	tmp = 0
                                                	if (z <= -1.9e+16) or not (z <= 5.6e+49):
                                                		tmp = ((z - y) / z) * x_m
                                                	else:
                                                		tmp = ((y - z) / t) * x_m
                                                	return x_s * tmp
                                                
                                                x\_m = abs(x)
                                                x\_s = copysign(1.0, x)
                                                function code(x_s, x_m, y, z, t)
                                                	tmp = 0.0
                                                	if ((z <= -1.9e+16) || !(z <= 5.6e+49))
                                                		tmp = Float64(Float64(Float64(z - y) / z) * x_m);
                                                	else
                                                		tmp = Float64(Float64(Float64(y - z) / t) * x_m);
                                                	end
                                                	return Float64(x_s * tmp)
                                                end
                                                
                                                x\_m = abs(x);
                                                x\_s = sign(x) * abs(1.0);
                                                function tmp_2 = code(x_s, x_m, y, z, t)
                                                	tmp = 0.0;
                                                	if ((z <= -1.9e+16) || ~((z <= 5.6e+49)))
                                                		tmp = ((z - y) / z) * x_m;
                                                	else
                                                		tmp = ((y - z) / t) * x_m;
                                                	end
                                                	tmp_2 = x_s * tmp;
                                                end
                                                
                                                x\_m = N[Abs[x], $MachinePrecision]
                                                x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[Or[LessEqual[z, -1.9e+16], N[Not[LessEqual[z, 5.6e+49]], $MachinePrecision]], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x$95$m), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x$95$m), $MachinePrecision]]), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                x\_m = \left|x\right|
                                                \\
                                                x\_s = \mathsf{copysign}\left(1, x\right)
                                                
                                                \\
                                                x\_s \cdot \begin{array}{l}
                                                \mathbf{if}\;z \leq -1.9 \cdot 10^{+16} \lor \neg \left(z \leq 5.6 \cdot 10^{+49}\right):\\
                                                \;\;\;\;\frac{z - y}{z} \cdot x\_m\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{y - z}{t} \cdot x\_m\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if z < -1.9e16 or 5.5999999999999996e49 < z

                                                  1. Initial program 78.1%

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

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

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

                                                    if -1.9e16 < z < 5.5999999999999996e49

                                                    1. Initial program 88.0%

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

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

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

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

                                                    Alternative 9: 68.3% accurate, 0.7× speedup?

                                                    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+59}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+70}:\\ \;\;\;\;\frac{y - z}{t} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
                                                    x\_m = (fabs.f64 x)
                                                    x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                    (FPCore (x_s x_m y z t)
                                                     :precision binary64
                                                     (*
                                                      x_s
                                                      (if (<= z -2.9e+59) x_m (if (<= z 4.1e+70) (* (/ (- y z) t) x_m) x_m))))
                                                    x\_m = fabs(x);
                                                    x\_s = copysign(1.0, x);
                                                    double code(double x_s, double x_m, double y, double z, double t) {
                                                    	double tmp;
                                                    	if (z <= -2.9e+59) {
                                                    		tmp = x_m;
                                                    	} else if (z <= 4.1e+70) {
                                                    		tmp = ((y - z) / t) * x_m;
                                                    	} else {
                                                    		tmp = x_m;
                                                    	}
                                                    	return x_s * tmp;
                                                    }
                                                    
                                                    x\_m =     private
                                                    x\_s =     private
                                                    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_s, x_m, y, z, t)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: x_s
                                                        real(8), intent (in) :: x_m
                                                        real(8), intent (in) :: y
                                                        real(8), intent (in) :: z
                                                        real(8), intent (in) :: t
                                                        real(8) :: tmp
                                                        if (z <= (-2.9d+59)) then
                                                            tmp = x_m
                                                        else if (z <= 4.1d+70) then
                                                            tmp = ((y - z) / t) * x_m
                                                        else
                                                            tmp = x_m
                                                        end if
                                                        code = x_s * tmp
                                                    end function
                                                    
                                                    x\_m = Math.abs(x);
                                                    x\_s = Math.copySign(1.0, x);
                                                    public static double code(double x_s, double x_m, double y, double z, double t) {
                                                    	double tmp;
                                                    	if (z <= -2.9e+59) {
                                                    		tmp = x_m;
                                                    	} else if (z <= 4.1e+70) {
                                                    		tmp = ((y - z) / t) * x_m;
                                                    	} else {
                                                    		tmp = x_m;
                                                    	}
                                                    	return x_s * tmp;
                                                    }
                                                    
                                                    x\_m = math.fabs(x)
                                                    x\_s = math.copysign(1.0, x)
                                                    def code(x_s, x_m, y, z, t):
                                                    	tmp = 0
                                                    	if z <= -2.9e+59:
                                                    		tmp = x_m
                                                    	elif z <= 4.1e+70:
                                                    		tmp = ((y - z) / t) * x_m
                                                    	else:
                                                    		tmp = x_m
                                                    	return x_s * tmp
                                                    
                                                    x\_m = abs(x)
                                                    x\_s = copysign(1.0, x)
                                                    function code(x_s, x_m, y, z, t)
                                                    	tmp = 0.0
                                                    	if (z <= -2.9e+59)
                                                    		tmp = x_m;
                                                    	elseif (z <= 4.1e+70)
                                                    		tmp = Float64(Float64(Float64(y - z) / t) * x_m);
                                                    	else
                                                    		tmp = x_m;
                                                    	end
                                                    	return Float64(x_s * tmp)
                                                    end
                                                    
                                                    x\_m = abs(x);
                                                    x\_s = sign(x) * abs(1.0);
                                                    function tmp_2 = code(x_s, x_m, y, z, t)
                                                    	tmp = 0.0;
                                                    	if (z <= -2.9e+59)
                                                    		tmp = x_m;
                                                    	elseif (z <= 4.1e+70)
                                                    		tmp = ((y - z) / t) * x_m;
                                                    	else
                                                    		tmp = x_m;
                                                    	end
                                                    	tmp_2 = x_s * tmp;
                                                    end
                                                    
                                                    x\_m = N[Abs[x], $MachinePrecision]
                                                    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                    code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.9e+59], x$95$m, If[LessEqual[z, 4.1e+70], N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x$95$m), $MachinePrecision], x$95$m]]), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    x\_m = \left|x\right|
                                                    \\
                                                    x\_s = \mathsf{copysign}\left(1, x\right)
                                                    
                                                    \\
                                                    x\_s \cdot \begin{array}{l}
                                                    \mathbf{if}\;z \leq -2.9 \cdot 10^{+59}:\\
                                                    \;\;\;\;x\_m\\
                                                    
                                                    \mathbf{elif}\;z \leq 4.1 \cdot 10^{+70}:\\
                                                    \;\;\;\;\frac{y - z}{t} \cdot x\_m\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;x\_m\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if z < -2.89999999999999991e59 or 4.1000000000000002e70 < z

                                                      1. Initial program 74.3%

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

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

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

                                                        if -2.89999999999999991e59 < z < 4.1000000000000002e70

                                                        1. Initial program 89.2%

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

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

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

                                                        Alternative 10: 70.3% accurate, 0.7× speedup?

                                                        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -2.75 \cdot 10^{+59}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+70}:\\ \;\;\;\;\frac{y}{t - z} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
                                                        x\_m = (fabs.f64 x)
                                                        x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                        (FPCore (x_s x_m y z t)
                                                         :precision binary64
                                                         (*
                                                          x_s
                                                          (if (<= z -2.75e+59) x_m (if (<= z 4.2e+70) (* (/ y (- t z)) x_m) x_m))))
                                                        x\_m = fabs(x);
                                                        x\_s = copysign(1.0, x);
                                                        double code(double x_s, double x_m, double y, double z, double t) {
                                                        	double tmp;
                                                        	if (z <= -2.75e+59) {
                                                        		tmp = x_m;
                                                        	} else if (z <= 4.2e+70) {
                                                        		tmp = (y / (t - z)) * x_m;
                                                        	} else {
                                                        		tmp = x_m;
                                                        	}
                                                        	return x_s * tmp;
                                                        }
                                                        
                                                        x\_m =     private
                                                        x\_s =     private
                                                        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_s, x_m, y, z, t)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: x_s
                                                            real(8), intent (in) :: x_m
                                                            real(8), intent (in) :: y
                                                            real(8), intent (in) :: z
                                                            real(8), intent (in) :: t
                                                            real(8) :: tmp
                                                            if (z <= (-2.75d+59)) then
                                                                tmp = x_m
                                                            else if (z <= 4.2d+70) then
                                                                tmp = (y / (t - z)) * x_m
                                                            else
                                                                tmp = x_m
                                                            end if
                                                            code = x_s * tmp
                                                        end function
                                                        
                                                        x\_m = Math.abs(x);
                                                        x\_s = Math.copySign(1.0, x);
                                                        public static double code(double x_s, double x_m, double y, double z, double t) {
                                                        	double tmp;
                                                        	if (z <= -2.75e+59) {
                                                        		tmp = x_m;
                                                        	} else if (z <= 4.2e+70) {
                                                        		tmp = (y / (t - z)) * x_m;
                                                        	} else {
                                                        		tmp = x_m;
                                                        	}
                                                        	return x_s * tmp;
                                                        }
                                                        
                                                        x\_m = math.fabs(x)
                                                        x\_s = math.copysign(1.0, x)
                                                        def code(x_s, x_m, y, z, t):
                                                        	tmp = 0
                                                        	if z <= -2.75e+59:
                                                        		tmp = x_m
                                                        	elif z <= 4.2e+70:
                                                        		tmp = (y / (t - z)) * x_m
                                                        	else:
                                                        		tmp = x_m
                                                        	return x_s * tmp
                                                        
                                                        x\_m = abs(x)
                                                        x\_s = copysign(1.0, x)
                                                        function code(x_s, x_m, y, z, t)
                                                        	tmp = 0.0
                                                        	if (z <= -2.75e+59)
                                                        		tmp = x_m;
                                                        	elseif (z <= 4.2e+70)
                                                        		tmp = Float64(Float64(y / Float64(t - z)) * x_m);
                                                        	else
                                                        		tmp = x_m;
                                                        	end
                                                        	return Float64(x_s * tmp)
                                                        end
                                                        
                                                        x\_m = abs(x);
                                                        x\_s = sign(x) * abs(1.0);
                                                        function tmp_2 = code(x_s, x_m, y, z, t)
                                                        	tmp = 0.0;
                                                        	if (z <= -2.75e+59)
                                                        		tmp = x_m;
                                                        	elseif (z <= 4.2e+70)
                                                        		tmp = (y / (t - z)) * x_m;
                                                        	else
                                                        		tmp = x_m;
                                                        	end
                                                        	tmp_2 = x_s * tmp;
                                                        end
                                                        
                                                        x\_m = N[Abs[x], $MachinePrecision]
                                                        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                        code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -2.75e+59], x$95$m, If[LessEqual[z, 4.2e+70], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x$95$m), $MachinePrecision], x$95$m]]), $MachinePrecision]
                                                        
                                                        \begin{array}{l}
                                                        x\_m = \left|x\right|
                                                        \\
                                                        x\_s = \mathsf{copysign}\left(1, x\right)
                                                        
                                                        \\
                                                        x\_s \cdot \begin{array}{l}
                                                        \mathbf{if}\;z \leq -2.75 \cdot 10^{+59}:\\
                                                        \;\;\;\;x\_m\\
                                                        
                                                        \mathbf{elif}\;z \leq 4.2 \cdot 10^{+70}:\\
                                                        \;\;\;\;\frac{y}{t - z} \cdot x\_m\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;x\_m\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if z < -2.74999999999999995e59 or 4.20000000000000015e70 < z

                                                          1. Initial program 74.3%

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

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

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

                                                            if -2.74999999999999995e59 < z < 4.20000000000000015e70

                                                            1. Initial program 89.2%

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

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

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

                                                            Alternative 11: 60.6% accurate, 0.8× speedup?

                                                            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{-24}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\ \;\;\;\;y \cdot \frac{x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
                                                            x\_m = (fabs.f64 x)
                                                            x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                            (FPCore (x_s x_m y z t)
                                                             :precision binary64
                                                             (* x_s (if (<= z -5.4e-24) x_m (if (<= z 3.7e+28) (* y (/ x_m t)) x_m))))
                                                            x\_m = fabs(x);
                                                            x\_s = copysign(1.0, x);
                                                            double code(double x_s, double x_m, double y, double z, double t) {
                                                            	double tmp;
                                                            	if (z <= -5.4e-24) {
                                                            		tmp = x_m;
                                                            	} else if (z <= 3.7e+28) {
                                                            		tmp = y * (x_m / t);
                                                            	} else {
                                                            		tmp = x_m;
                                                            	}
                                                            	return x_s * tmp;
                                                            }
                                                            
                                                            x\_m =     private
                                                            x\_s =     private
                                                            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_s, x_m, y, z, t)
                                                            use fmin_fmax_functions
                                                                real(8), intent (in) :: x_s
                                                                real(8), intent (in) :: x_m
                                                                real(8), intent (in) :: y
                                                                real(8), intent (in) :: z
                                                                real(8), intent (in) :: t
                                                                real(8) :: tmp
                                                                if (z <= (-5.4d-24)) then
                                                                    tmp = x_m
                                                                else if (z <= 3.7d+28) then
                                                                    tmp = y * (x_m / t)
                                                                else
                                                                    tmp = x_m
                                                                end if
                                                                code = x_s * tmp
                                                            end function
                                                            
                                                            x\_m = Math.abs(x);
                                                            x\_s = Math.copySign(1.0, x);
                                                            public static double code(double x_s, double x_m, double y, double z, double t) {
                                                            	double tmp;
                                                            	if (z <= -5.4e-24) {
                                                            		tmp = x_m;
                                                            	} else if (z <= 3.7e+28) {
                                                            		tmp = y * (x_m / t);
                                                            	} else {
                                                            		tmp = x_m;
                                                            	}
                                                            	return x_s * tmp;
                                                            }
                                                            
                                                            x\_m = math.fabs(x)
                                                            x\_s = math.copysign(1.0, x)
                                                            def code(x_s, x_m, y, z, t):
                                                            	tmp = 0
                                                            	if z <= -5.4e-24:
                                                            		tmp = x_m
                                                            	elif z <= 3.7e+28:
                                                            		tmp = y * (x_m / t)
                                                            	else:
                                                            		tmp = x_m
                                                            	return x_s * tmp
                                                            
                                                            x\_m = abs(x)
                                                            x\_s = copysign(1.0, x)
                                                            function code(x_s, x_m, y, z, t)
                                                            	tmp = 0.0
                                                            	if (z <= -5.4e-24)
                                                            		tmp = x_m;
                                                            	elseif (z <= 3.7e+28)
                                                            		tmp = Float64(y * Float64(x_m / t));
                                                            	else
                                                            		tmp = x_m;
                                                            	end
                                                            	return Float64(x_s * tmp)
                                                            end
                                                            
                                                            x\_m = abs(x);
                                                            x\_s = sign(x) * abs(1.0);
                                                            function tmp_2 = code(x_s, x_m, y, z, t)
                                                            	tmp = 0.0;
                                                            	if (z <= -5.4e-24)
                                                            		tmp = x_m;
                                                            	elseif (z <= 3.7e+28)
                                                            		tmp = y * (x_m / t);
                                                            	else
                                                            		tmp = x_m;
                                                            	end
                                                            	tmp_2 = x_s * tmp;
                                                            end
                                                            
                                                            x\_m = N[Abs[x], $MachinePrecision]
                                                            x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                            code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -5.4e-24], x$95$m, If[LessEqual[z, 3.7e+28], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], x$95$m]]), $MachinePrecision]
                                                            
                                                            \begin{array}{l}
                                                            x\_m = \left|x\right|
                                                            \\
                                                            x\_s = \mathsf{copysign}\left(1, x\right)
                                                            
                                                            \\
                                                            x\_s \cdot \begin{array}{l}
                                                            \mathbf{if}\;z \leq -5.4 \cdot 10^{-24}:\\
                                                            \;\;\;\;x\_m\\
                                                            
                                                            \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\
                                                            \;\;\;\;y \cdot \frac{x\_m}{t}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;x\_m\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if z < -5.40000000000000014e-24 or 3.6999999999999999e28 < z

                                                              1. Initial program 79.9%

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

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

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

                                                                if -5.40000000000000014e-24 < z < 3.6999999999999999e28

                                                                1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \color{blue}{y} \cdot \frac{x}{t} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites66.5%

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

                                                                  Alternative 12: 62.2% accurate, 0.8× speedup?

                                                                  \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+17}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\ \;\;\;\;\frac{y}{t} \cdot x\_m\\ \mathbf{else}:\\ \;\;\;\;x\_m\\ \end{array} \end{array} \]
                                                                  x\_m = (fabs.f64 x)
                                                                  x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                                  (FPCore (x_s x_m y z t)
                                                                   :precision binary64
                                                                   (* x_s (if (<= z -1.16e+17) x_m (if (<= z 3.7e+28) (* (/ y t) x_m) x_m))))
                                                                  x\_m = fabs(x);
                                                                  x\_s = copysign(1.0, x);
                                                                  double code(double x_s, double x_m, double y, double z, double t) {
                                                                  	double tmp;
                                                                  	if (z <= -1.16e+17) {
                                                                  		tmp = x_m;
                                                                  	} else if (z <= 3.7e+28) {
                                                                  		tmp = (y / t) * x_m;
                                                                  	} else {
                                                                  		tmp = x_m;
                                                                  	}
                                                                  	return x_s * tmp;
                                                                  }
                                                                  
                                                                  x\_m =     private
                                                                  x\_s =     private
                                                                  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_s, x_m, y, z, t)
                                                                  use fmin_fmax_functions
                                                                      real(8), intent (in) :: x_s
                                                                      real(8), intent (in) :: x_m
                                                                      real(8), intent (in) :: y
                                                                      real(8), intent (in) :: z
                                                                      real(8), intent (in) :: t
                                                                      real(8) :: tmp
                                                                      if (z <= (-1.16d+17)) then
                                                                          tmp = x_m
                                                                      else if (z <= 3.7d+28) then
                                                                          tmp = (y / t) * x_m
                                                                      else
                                                                          tmp = x_m
                                                                      end if
                                                                      code = x_s * tmp
                                                                  end function
                                                                  
                                                                  x\_m = Math.abs(x);
                                                                  x\_s = Math.copySign(1.0, x);
                                                                  public static double code(double x_s, double x_m, double y, double z, double t) {
                                                                  	double tmp;
                                                                  	if (z <= -1.16e+17) {
                                                                  		tmp = x_m;
                                                                  	} else if (z <= 3.7e+28) {
                                                                  		tmp = (y / t) * x_m;
                                                                  	} else {
                                                                  		tmp = x_m;
                                                                  	}
                                                                  	return x_s * tmp;
                                                                  }
                                                                  
                                                                  x\_m = math.fabs(x)
                                                                  x\_s = math.copysign(1.0, x)
                                                                  def code(x_s, x_m, y, z, t):
                                                                  	tmp = 0
                                                                  	if z <= -1.16e+17:
                                                                  		tmp = x_m
                                                                  	elif z <= 3.7e+28:
                                                                  		tmp = (y / t) * x_m
                                                                  	else:
                                                                  		tmp = x_m
                                                                  	return x_s * tmp
                                                                  
                                                                  x\_m = abs(x)
                                                                  x\_s = copysign(1.0, x)
                                                                  function code(x_s, x_m, y, z, t)
                                                                  	tmp = 0.0
                                                                  	if (z <= -1.16e+17)
                                                                  		tmp = x_m;
                                                                  	elseif (z <= 3.7e+28)
                                                                  		tmp = Float64(Float64(y / t) * x_m);
                                                                  	else
                                                                  		tmp = x_m;
                                                                  	end
                                                                  	return Float64(x_s * tmp)
                                                                  end
                                                                  
                                                                  x\_m = abs(x);
                                                                  x\_s = sign(x) * abs(1.0);
                                                                  function tmp_2 = code(x_s, x_m, y, z, t)
                                                                  	tmp = 0.0;
                                                                  	if (z <= -1.16e+17)
                                                                  		tmp = x_m;
                                                                  	elseif (z <= 3.7e+28)
                                                                  		tmp = (y / t) * x_m;
                                                                  	else
                                                                  		tmp = x_m;
                                                                  	end
                                                                  	tmp_2 = x_s * tmp;
                                                                  end
                                                                  
                                                                  x\_m = N[Abs[x], $MachinePrecision]
                                                                  x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                  code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.16e+17], x$95$m, If[LessEqual[z, 3.7e+28], N[(N[(y / t), $MachinePrecision] * x$95$m), $MachinePrecision], x$95$m]]), $MachinePrecision]
                                                                  
                                                                  \begin{array}{l}
                                                                  x\_m = \left|x\right|
                                                                  \\
                                                                  x\_s = \mathsf{copysign}\left(1, x\right)
                                                                  
                                                                  \\
                                                                  x\_s \cdot \begin{array}{l}
                                                                  \mathbf{if}\;z \leq -1.16 \cdot 10^{+17}:\\
                                                                  \;\;\;\;x\_m\\
                                                                  
                                                                  \mathbf{elif}\;z \leq 3.7 \cdot 10^{+28}:\\
                                                                  \;\;\;\;\frac{y}{t} \cdot x\_m\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;x\_m\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if z < -1.16e17 or 3.6999999999999999e28 < z

                                                                    1. Initial program 78.8%

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

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

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

                                                                      if -1.16e17 < z < 3.6999999999999999e28

                                                                      1. Initial program 87.7%

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

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

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

                                                                          \[\leadsto \frac{y}{t} \cdot x \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites64.8%

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

                                                                        Alternative 13: 34.8% accurate, 23.0× speedup?

                                                                        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot x\_m \end{array} \]
                                                                        x\_m = (fabs.f64 x)
                                                                        x\_s = (copysign.f64 #s(literal 1 binary64) x)
                                                                        (FPCore (x_s x_m y z t) :precision binary64 (* x_s x_m))
                                                                        x\_m = fabs(x);
                                                                        x\_s = copysign(1.0, x);
                                                                        double code(double x_s, double x_m, double y, double z, double t) {
                                                                        	return x_s * x_m;
                                                                        }
                                                                        
                                                                        x\_m =     private
                                                                        x\_s =     private
                                                                        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_s, x_m, y, z, t)
                                                                        use fmin_fmax_functions
                                                                            real(8), intent (in) :: x_s
                                                                            real(8), intent (in) :: x_m
                                                                            real(8), intent (in) :: y
                                                                            real(8), intent (in) :: z
                                                                            real(8), intent (in) :: t
                                                                            code = x_s * x_m
                                                                        end function
                                                                        
                                                                        x\_m = Math.abs(x);
                                                                        x\_s = Math.copySign(1.0, x);
                                                                        public static double code(double x_s, double x_m, double y, double z, double t) {
                                                                        	return x_s * x_m;
                                                                        }
                                                                        
                                                                        x\_m = math.fabs(x)
                                                                        x\_s = math.copysign(1.0, x)
                                                                        def code(x_s, x_m, y, z, t):
                                                                        	return x_s * x_m
                                                                        
                                                                        x\_m = abs(x)
                                                                        x\_s = copysign(1.0, x)
                                                                        function code(x_s, x_m, y, z, t)
                                                                        	return Float64(x_s * x_m)
                                                                        end
                                                                        
                                                                        x\_m = abs(x);
                                                                        x\_s = sign(x) * abs(1.0);
                                                                        function tmp = code(x_s, x_m, y, z, t)
                                                                        	tmp = x_s * x_m;
                                                                        end
                                                                        
                                                                        x\_m = N[Abs[x], $MachinePrecision]
                                                                        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                                                                        code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * x$95$m), $MachinePrecision]
                                                                        
                                                                        \begin{array}{l}
                                                                        x\_m = \left|x\right|
                                                                        \\
                                                                        x\_s = \mathsf{copysign}\left(1, x\right)
                                                                        
                                                                        \\
                                                                        x\_s \cdot x\_m
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Initial program 83.8%

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

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

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

                                                                          Developer Target 1: 97.2% accurate, 0.8× speedup?

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

                                                                          Reproduce

                                                                          ?
                                                                          herbie shell --seed 2025021 
                                                                          (FPCore (x y z t)
                                                                            :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
                                                                            :precision binary64
                                                                          
                                                                            :alt
                                                                            (! :herbie-platform default (/ x (/ (- t z) (- y z))))
                                                                          
                                                                            (/ (* x (- y z)) (- t z)))