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

Percentage Accurate: 84.3% → 96.9%
Time: 3.0s
Alternatives: 10
Speedup: 1.0×

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}

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 10 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.3% 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: 96.9% 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}\;x\_m \leq 2.1 \cdot 10^{+21}:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{y - z}{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 (<= x_m 2.1e+21)
    (/ (* x_m (- y z)) (- t z))
    (* x_m (/ (- y z) (- 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 (x_m <= 2.1e+21) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = x_m * ((y - z) / (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 (x_m <= 2.1d+21) then
        tmp = (x_m * (y - z)) / (t - z)
    else
        tmp = x_m * ((y - z) / (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 (x_m <= 2.1e+21) {
		tmp = (x_m * (y - z)) / (t - z);
	} else {
		tmp = x_m * ((y - z) / (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 x_m <= 2.1e+21:
		tmp = (x_m * (y - z)) / (t - z)
	else:
		tmp = x_m * ((y - z) / (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 (x_m <= 2.1e+21)
		tmp = Float64(Float64(x_m * Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x_m * Float64(Float64(y - z) / 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 (x_m <= 2.1e+21)
		tmp = (x_m * (y - z)) / (t - z);
	else
		tmp = x_m * ((y - z) / (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[x$95$m, 2.1e+21], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / 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}\;x\_m \leq 2.1 \cdot 10^{+21}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.1e21

    1. Initial program 96.9%

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

    if 2.1e21 < x

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{y - z}}{t - z} \]
      9. lift--.f6496.2

        \[\leadsto x \cdot \frac{y - z}{\color{blue}{t - z}} \]
    3. Applied rewrites96.2%

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

Alternative 2: 96.6% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \frac{y - z}{t - z}\right) \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 (/ (- y z) (- 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) {
	return x_s * (x_m * ((y - z) / (t - z)));
}
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 * ((y - z) / (t - z)))
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 * ((y - z) / (t - z)));
}
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 * ((y - z) / (t - z)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m * Float64(Float64(y - z) / Float64(t - z))))
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 * ((y - z) / (t - z)));
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 * N[(x$95$m * N[(N[(y - z), $MachinePrecision] / 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 \left(x\_m \cdot \frac{y - z}{t - z}\right)
\end{array}
Derivation
  1. Initial program 84.3%

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{\color{blue}{y - z}}{t - z} \]
    9. lift--.f6496.9

      \[\leadsto x \cdot \frac{y - z}{\color{blue}{t - z}} \]
  3. Applied rewrites96.9%

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}} \]
  4. Add Preprocessing

Alternative 3: 75.2% 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 -5.2 \cdot 10^{-43}:\\ \;\;\;\;x\_m \cdot \frac{-z}{t - z}\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\ \;\;\;\;\frac{x\_m \cdot y}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\_m - x\_m \cdot \frac{y}{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 -5.2e-43)
    (* x_m (/ (- z) (- t z)))
    (if (<= z 2.75e+23) (/ (* x_m y) (- t z)) (- x_m (* x_m (/ y 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 <= -5.2e-43) {
		tmp = x_m * (-z / (t - z));
	} else if (z <= 2.75e+23) {
		tmp = (x_m * y) / (t - z);
	} else {
		tmp = x_m - (x_m * (y / 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 <= (-5.2d-43)) then
        tmp = x_m * (-z / (t - z))
    else if (z <= 2.75d+23) then
        tmp = (x_m * y) / (t - z)
    else
        tmp = x_m - (x_m * (y / 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 <= -5.2e-43) {
		tmp = x_m * (-z / (t - z));
	} else if (z <= 2.75e+23) {
		tmp = (x_m * y) / (t - z);
	} else {
		tmp = x_m - (x_m * (y / 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 <= -5.2e-43:
		tmp = x_m * (-z / (t - z))
	elif z <= 2.75e+23:
		tmp = (x_m * y) / (t - z)
	else:
		tmp = x_m - (x_m * (y / 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 <= -5.2e-43)
		tmp = Float64(x_m * Float64(Float64(-z) / Float64(t - z)));
	elseif (z <= 2.75e+23)
		tmp = Float64(Float64(x_m * y) / Float64(t - z));
	else
		tmp = Float64(x_m - Float64(x_m * Float64(y / 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 <= -5.2e-43)
		tmp = x_m * (-z / (t - z));
	elseif (z <= 2.75e+23)
		tmp = (x_m * y) / (t - z);
	else
		tmp = x_m - (x_m * (y / 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, -5.2e-43], N[(x$95$m * N[((-z) / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.75e+23], N[(N[(x$95$m * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x$95$m - N[(x$95$m * N[(y / 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 -5.2 \cdot 10^{-43}:\\
\;\;\;\;x\_m \cdot \frac{-z}{t - z}\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\
\;\;\;\;\frac{x\_m \cdot y}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.2e-43

    1. Initial program 78.1%

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{y - z}}{t - z} \]
      9. lift--.f6499.6

        \[\leadsto x \cdot \frac{y - z}{\color{blue}{t - z}} \]
    3. Applied rewrites99.6%

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

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

        \[\leadsto x \cdot \frac{\mathsf{neg}\left(z\right)}{t - z} \]
      2. lift-neg.f6473.5

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

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

    if -5.2e-43 < z < 2.75000000000000002e23

    1. Initial program 92.6%

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

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

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

      if 2.75000000000000002e23 < z

      1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\frac{y \cdot x - t \cdot x}{z}\right) + x \]
        15. lower-*.f6467.1

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

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

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

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

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

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

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

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

    Alternative 4: 74.9% accurate, 0.7× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\ \;\;\;\;\frac{x\_m \cdot y}{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 (* x_m (/ y z)))))
       (*
        x_s
        (if (<= z -3.9e-48) t_1 (if (<= z 2.75e+23) (/ (* x_m y) (- 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 - (x_m * (y / z));
    	double tmp;
    	if (z <= -3.9e-48) {
    		tmp = t_1;
    	} else if (z <= 2.75e+23) {
    		tmp = (x_m * y) / (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 - (x_m * (y / z))
        if (z <= (-3.9d-48)) then
            tmp = t_1
        else if (z <= 2.75d+23) then
            tmp = (x_m * y) / (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 - (x_m * (y / z));
    	double tmp;
    	if (z <= -3.9e-48) {
    		tmp = t_1;
    	} else if (z <= 2.75e+23) {
    		tmp = (x_m * y) / (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 - (x_m * (y / z))
    	tmp = 0
    	if z <= -3.9e-48:
    		tmp = t_1
    	elif z <= 2.75e+23:
    		tmp = (x_m * y) / (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(x_m - Float64(x_m * Float64(y / z)))
    	tmp = 0.0
    	if (z <= -3.9e-48)
    		tmp = t_1;
    	elseif (z <= 2.75e+23)
    		tmp = Float64(Float64(x_m * y) / 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 - (x_m * (y / z));
    	tmp = 0.0;
    	if (z <= -3.9e-48)
    		tmp = t_1;
    	elseif (z <= 2.75e+23)
    		tmp = (x_m * y) / (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[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -3.9e-48], t$95$1, If[LessEqual[z, 2.75e+23], N[(N[(x$95$m * y), $MachinePrecision] / N[(t - z), $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 := x\_m - x\_m \cdot \frac{y}{z}\\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -3.9 \cdot 10^{-48}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\
    \;\;\;\;\frac{x\_m \cdot y}{t - z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -3.9e-48 or 2.75000000000000002e23 < z

      1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\frac{y \cdot x - t \cdot x}{z}\right) + x \]
        15. lower-*.f6464.8

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

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

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

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

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

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

          \[\leadsto x - x \cdot \frac{y}{z} \]
      7. Applied rewrites73.2%

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

      if -3.9e-48 < z < 2.75000000000000002e23

      1. Initial program 92.6%

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

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

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

      Alternative 5: 74.4% accurate, 0.7× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\ \;\;\;\;x\_m \cdot \frac{y}{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 (* x_m (/ y z)))))
         (*
          x_s
          (if (<= z -8.2e-53) t_1 (if (<= z 2.75e+23) (* x_m (/ y (- 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 - (x_m * (y / z));
      	double tmp;
      	if (z <= -8.2e-53) {
      		tmp = t_1;
      	} else if (z <= 2.75e+23) {
      		tmp = x_m * (y / (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 - (x_m * (y / z))
          if (z <= (-8.2d-53)) then
              tmp = t_1
          else if (z <= 2.75d+23) then
              tmp = x_m * (y / (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 - (x_m * (y / z));
      	double tmp;
      	if (z <= -8.2e-53) {
      		tmp = t_1;
      	} else if (z <= 2.75e+23) {
      		tmp = x_m * (y / (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 - (x_m * (y / z))
      	tmp = 0
      	if z <= -8.2e-53:
      		tmp = t_1
      	elif z <= 2.75e+23:
      		tmp = x_m * (y / (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(x_m - Float64(x_m * Float64(y / z)))
      	tmp = 0.0
      	if (z <= -8.2e-53)
      		tmp = t_1;
      	elseif (z <= 2.75e+23)
      		tmp = Float64(x_m * Float64(y / 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 - (x_m * (y / z));
      	tmp = 0.0;
      	if (z <= -8.2e-53)
      		tmp = t_1;
      	elseif (z <= 2.75e+23)
      		tmp = x_m * (y / (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[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -8.2e-53], t$95$1, If[LessEqual[z, 2.75e+23], N[(x$95$m * N[(y / 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 := x\_m - x\_m \cdot \frac{y}{z}\\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -8.2 \cdot 10^{-53}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 2.75 \cdot 10^{+23}:\\
      \;\;\;\;x\_m \cdot \frac{y}{t - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -8.2000000000000001e-53 or 2.75000000000000002e23 < z

        1. Initial program 76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\frac{y \cdot x - t \cdot x}{z}\right) + x \]
          15. lower-*.f6464.6

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

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

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

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

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

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

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

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

        if -8.2000000000000001e-53 < z < 2.75000000000000002e23

        1. Initial program 92.5%

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

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

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

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

            \[\leadsto x \cdot \frac{y}{\color{blue}{t - z}} \]
          4. lift--.f6477.2

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

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

      Alternative 6: 69.6% accurate, 0.7× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5.4 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1450:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \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 (* x_m (/ y z)))))
         (* x_s (if (<= z -5.4e-56) t_1 (if (<= z 1450.0) (* x_m (/ y t)) 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 - (x_m * (y / z));
      	double tmp;
      	if (z <= -5.4e-56) {
      		tmp = t_1;
      	} else if (z <= 1450.0) {
      		tmp = x_m * (y / t);
      	} 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 - (x_m * (y / z))
          if (z <= (-5.4d-56)) then
              tmp = t_1
          else if (z <= 1450.0d0) then
              tmp = x_m * (y / t)
          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 - (x_m * (y / z));
      	double tmp;
      	if (z <= -5.4e-56) {
      		tmp = t_1;
      	} else if (z <= 1450.0) {
      		tmp = x_m * (y / t);
      	} 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 - (x_m * (y / z))
      	tmp = 0
      	if z <= -5.4e-56:
      		tmp = t_1
      	elif z <= 1450.0:
      		tmp = x_m * (y / t)
      	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(x_m - Float64(x_m * Float64(y / z)))
      	tmp = 0.0
      	if (z <= -5.4e-56)
      		tmp = t_1;
      	elseif (z <= 1450.0)
      		tmp = Float64(x_m * Float64(y / t));
      	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 - (x_m * (y / z));
      	tmp = 0.0;
      	if (z <= -5.4e-56)
      		tmp = t_1;
      	elseif (z <= 1450.0)
      		tmp = x_m * (y / t);
      	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[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -5.4e-56], t$95$1, If[LessEqual[z, 1450.0], N[(x$95$m * N[(y / t), $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 := x\_m - x\_m \cdot \frac{y}{z}\\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -5.4 \cdot 10^{-56}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 1450:\\
      \;\;\;\;x\_m \cdot \frac{y}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -5.3999999999999999e-56 or 1450 < z

        1. Initial program 77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\frac{y \cdot x - t \cdot x}{z}\right) + x \]
          15. lower-*.f6464.1

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

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

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

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

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

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

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

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

        if -5.3999999999999999e-56 < z < 1450

        1. Initial program 92.4%

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

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

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

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

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

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

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

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

            \[\leadsto x \cdot \frac{\color{blue}{y - z}}{t - z} \]
          9. lift--.f6493.6

            \[\leadsto x \cdot \frac{y - z}{\color{blue}{t - z}} \]
        3. Applied rewrites93.6%

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

          \[\leadsto x \cdot \color{blue}{\frac{y}{t}} \]
        5. Step-by-step derivation
          1. lower-/.f6466.7

            \[\leadsto x \cdot \frac{y}{\color{blue}{t}} \]
        6. Applied rewrites66.7%

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

      Alternative 7: 61.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 -3.9 \cdot 10^{-48}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+36}:\\ \;\;\;\;x\_m \cdot \frac{y}{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.9e-48) x_m (if (<= z 2.9e+36) (* x_m (/ y 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.9e-48) {
      		tmp = x_m;
      	} else if (z <= 2.9e+36) {
      		tmp = x_m * (y / 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.9d-48)) then
              tmp = x_m
          else if (z <= 2.9d+36) then
              tmp = x_m * (y / 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.9e-48) {
      		tmp = x_m;
      	} else if (z <= 2.9e+36) {
      		tmp = x_m * (y / 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.9e-48:
      		tmp = x_m
      	elif z <= 2.9e+36:
      		tmp = x_m * (y / 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.9e-48)
      		tmp = x_m;
      	elseif (z <= 2.9e+36)
      		tmp = Float64(x_m * Float64(y / 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.9e-48)
      		tmp = x_m;
      	elseif (z <= 2.9e+36)
      		tmp = x_m * (y / 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.9e-48], x$95$m, If[LessEqual[z, 2.9e+36], N[(x$95$m * N[(y / 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.9 \cdot 10^{-48}:\\
      \;\;\;\;x\_m\\
      
      \mathbf{elif}\;z \leq 2.9 \cdot 10^{+36}:\\
      \;\;\;\;x\_m \cdot \frac{y}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;x\_m\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -3.9e-48 or 2.9e36 < z

        1. Initial program 76.4%

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

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

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

          if -3.9e-48 < z < 2.9e36

          1. Initial program 92.5%

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \frac{\color{blue}{y - z}}{t - z} \]
            9. lift--.f6494.1

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

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

            \[\leadsto x \cdot \color{blue}{\frac{y}{t}} \]
          5. Step-by-step derivation
            1. lower-/.f6464.7

              \[\leadsto x \cdot \frac{y}{\color{blue}{t}} \]
          6. Applied rewrites64.7%

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

        Alternative 8: 59.9% 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 -3.9 \cdot 10^{-48}:\\ \;\;\;\;x\_m\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+32}:\\ \;\;\;\;\frac{y \cdot 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.9e-48) x_m (if (<= z 4e+32) (/ (* 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.9e-48) {
        		tmp = x_m;
        	} else if (z <= 4e+32) {
        		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.9d-48)) then
                tmp = x_m
            else if (z <= 4d+32) 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.9e-48) {
        		tmp = x_m;
        	} else if (z <= 4e+32) {
        		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.9e-48:
        		tmp = x_m
        	elif z <= 4e+32:
        		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.9e-48)
        		tmp = x_m;
        	elseif (z <= 4e+32)
        		tmp = Float64(Float64(y * 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.9e-48)
        		tmp = x_m;
        	elseif (z <= 4e+32)
        		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.9e-48], x$95$m, If[LessEqual[z, 4e+32], N[(N[(y * x$95$m), $MachinePrecision] / t), $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.9 \cdot 10^{-48}:\\
        \;\;\;\;x\_m\\
        
        \mathbf{elif}\;z \leq 4 \cdot 10^{+32}:\\
        \;\;\;\;\frac{y \cdot x\_m}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;x\_m\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.9e-48 or 4.00000000000000021e32 < z

          1. Initial program 76.5%

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

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

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

            if -3.9e-48 < z < 4.00000000000000021e32

            1. Initial program 92.5%

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

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

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

                \[\leadsto \frac{y \cdot x}{t} \]
              3. lower-*.f6462.3

                \[\leadsto \frac{y \cdot x}{t} \]
            4. Applied rewrites62.3%

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

          Alternative 9: 36.4% 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}\;\frac{x\_m \cdot \left(y - z\right)}{t - z} \leq 10^{-309}:\\ \;\;\;\;t \cdot \frac{x\_m}{z}\\ \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 (<= (/ (* x_m (- y z)) (- t z)) 1e-309) (* t (/ x_m z)) 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 (((x_m * (y - z)) / (t - z)) <= 1e-309) {
          		tmp = t * (x_m / z);
          	} 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 (((x_m * (y - z)) / (t - z)) <= 1d-309) then
                  tmp = t * (x_m / z)
              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 (((x_m * (y - z)) / (t - z)) <= 1e-309) {
          		tmp = t * (x_m / z);
          	} 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 ((x_m * (y - z)) / (t - z)) <= 1e-309:
          		tmp = t * (x_m / z)
          	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 (Float64(Float64(x_m * Float64(y - z)) / Float64(t - z)) <= 1e-309)
          		tmp = Float64(t * Float64(x_m / z));
          	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 (((x_m * (y - z)) / (t - z)) <= 1e-309)
          		tmp = t * (x_m / z);
          	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[N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], 1e-309], N[(t * N[(x$95$m / z), $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}\;\frac{x\_m \cdot \left(y - z\right)}{t - z} \leq 10^{-309}:\\
          \;\;\;\;t \cdot \frac{x\_m}{z}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\_m\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.000000000000002e-309

            1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\frac{y \cdot x - t \cdot x}{z}\right) + x \]
              15. lower-*.f6423.9

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

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

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

                \[\leadsto \frac{t \cdot x}{z} \]
              2. lift-*.f644.8

                \[\leadsto \frac{t \cdot x}{z} \]
            7. Applied rewrites4.8%

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

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

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

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

                \[\leadsto t \cdot \frac{x}{\color{blue}{z}} \]
              5. lower-/.f647.3

                \[\leadsto t \cdot \frac{x}{z} \]
            9. Applied rewrites7.3%

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

            if 1.000000000000002e-309 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

            1. Initial program 81.9%

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

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

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

            Alternative 10: 35.1% accurate, 12.6× 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 84.3%

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

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

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

              Reproduce

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