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

Percentage Accurate: 84.2% → 97.1%
Time: 3.4s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
(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]
\frac{x \cdot \left(y - z\right)}{t - z}

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 12 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.2% accurate, 1.0× speedup?

\[\frac{x \cdot \left(y - z\right)}{t - z} \]
(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]
\frac{x \cdot \left(y - z\right)}{t - z}

Alternative 1: 97.1% accurate, 1.0× speedup?

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

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

real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((z - y) / (z - t)) * x
end function
public static double code(double x, double y, double z, double t) {
	return ((z - y) / (z - t)) * x;
}
def code(x, y, z, t):
	return ((z - y) / (z - t)) * x
function code(x, y, z, t)
	return Float64(Float64(Float64(z - y) / Float64(z - t)) * x)
end
function tmp = code(x, y, z, t)
	tmp = ((z - y) / (z - t)) * x;
end
code[x_, y_, z_, t_] := N[(N[(N[(z - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{z - y}{z - t} \cdot x
Derivation
  1. Initial program 84.2%

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. 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. associate-/l*N/A

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

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

      \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
    6. frac-2negN/A

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

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

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

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

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

      \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
    12. sub-negate-revN/A

      \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
    13. lower--.f6497.1%

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

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

Alternative 2: 89.0% accurate, 0.1× speedup?

\[\begin{array}{l} t_1 := \frac{\left|x\right|}{z - t} \cdot \left(z - y\right)\\ t_2 := \frac{\left|x\right| \cdot \left(y - z\right)}{t - z}\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-137}:\\ \;\;\;\;\frac{z}{z - t} \cdot \left|x\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
  :precision binary64
  (let* ((t_1 (* (/ (fabs x) (- z t)) (- z y)))
       (t_2 (/ (* (fabs x) (- y z)) (- t z))))
  (*
   (copysign 1.0 x)
   (if (<= t_2 0.0)
     t_1
     (if (<= t_2 2e-137) (* (/ z (- z t)) (fabs x)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (fabs(x) / (z - t)) * (z - y);
	double t_2 = (fabs(x) * (y - z)) / (t - z);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 2e-137) {
		tmp = (z / (z - t)) * fabs(x);
	} else {
		tmp = t_1;
	}
	return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
	double t_1 = (Math.abs(x) / (z - t)) * (z - y);
	double t_2 = (Math.abs(x) * (y - z)) / (t - z);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = t_1;
	} else if (t_2 <= 2e-137) {
		tmp = (z / (z - t)) * Math.abs(x);
	} else {
		tmp = t_1;
	}
	return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t):
	t_1 = (math.fabs(x) / (z - t)) * (z - y)
	t_2 = (math.fabs(x) * (y - z)) / (t - z)
	tmp = 0
	if t_2 <= 0.0:
		tmp = t_1
	elif t_2 <= 2e-137:
		tmp = (z / (z - t)) * math.fabs(x)
	else:
		tmp = t_1
	return math.copysign(1.0, x) * tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(abs(x) / Float64(z - t)) * Float64(z - y))
	t_2 = Float64(Float64(abs(x) * Float64(y - z)) / Float64(t - z))
	tmp = 0.0
	if (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 2e-137)
		tmp = Float64(Float64(z / Float64(z - t)) * abs(x));
	else
		tmp = t_1;
	end
	return Float64(copysign(1.0, x) * tmp)
end
function tmp_2 = code(x, y, z, t)
	t_1 = (abs(x) / (z - t)) * (z - y);
	t_2 = (abs(x) * (y - z)) / (t - z);
	tmp = 0.0;
	if (t_2 <= 0.0)
		tmp = t_1;
	elseif (t_2 <= 2e-137)
		tmp = (z / (z - t)) * abs(x);
	else
		tmp = t_1;
	end
	tmp_2 = (sign(x) * abs(1.0)) * tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Abs[x], $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Abs[x], $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 2e-137], N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left|x\right|}{z - t} \cdot \left(z - y\right)\\
t_2 := \frac{\left|x\right| \cdot \left(y - z\right)}{t - z}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-137}:\\
\;\;\;\;\frac{z}{z - t} \cdot \left|x\right|\\

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


\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 2e-137 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 84.2%

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)\right) \cdot x}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
      7. sub-negate-revN/A

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

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

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

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

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

        \[\leadsto \frac{x}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot \left(z - y\right) \]
      13. sub-negate-revN/A

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

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

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

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

    if -0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2e-137

    1. Initial program 84.2%

      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
    2. 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. associate-/l*N/A

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

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

        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
      6. frac-2negN/A

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

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

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

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

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

        \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
      12. sub-negate-revN/A

        \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
      13. lower--.f6497.1%

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

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

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

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

    Alternative 3: 74.8% accurate, 0.6× speedup?

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

      1. Initial program 84.2%

        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
      2. 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. associate-/l*N/A

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

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

          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
        6. frac-2negN/A

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

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

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

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

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

          \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
        12. sub-negate-revN/A

          \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
        13. lower--.f6497.1%

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

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

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

          \[\leadsto \frac{z - y}{\color{blue}{z}} \cdot x \]
        2. lower--.f6452.7%

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

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

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

          \[\leadsto \frac{z - y}{z} \cdot x \]
        3. div-subN/A

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

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

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

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

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

      if -5.7999999999999996e37 < z < -3.5e-36

      1. Initial program 84.2%

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{y - z}{t} \cdot x} \]
          6. lower-/.f6450.1%

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

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

        if -3.5e-36 < z < 6.0000000000000003e-12

        1. Initial program 84.2%

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

          \[\leadsto \frac{\color{blue}{x \cdot y}}{t - z} \]
        3. Step-by-step derivation
          1. lower-*.f6449.8%

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

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

        if 6.0000000000000003e-12 < z

        1. Initial program 84.2%

          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
        2. 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. associate-/l*N/A

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

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

            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
          6. frac-2negN/A

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

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

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

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

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

            \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
          12. sub-negate-revN/A

            \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
          13. lower--.f6497.1%

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

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

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

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

        Alternative 4: 73.7% accurate, 0.7× speedup?

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

          1. Initial program 84.2%

            \[\frac{x \cdot \left(y - z\right)}{t - z} \]
          2. 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. associate-/l*N/A

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

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

              \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
            6. frac-2negN/A

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

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

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

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

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

              \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
            12. sub-negate-revN/A

              \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
            13. lower--.f6497.1%

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

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

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

              \[\leadsto \frac{z - y}{\color{blue}{z}} \cdot x \]
            2. lower--.f6452.7%

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

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

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

              \[\leadsto \frac{z - y}{z} \cdot x \]
            3. div-subN/A

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

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

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

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

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

          if -5.7999999999999996e37 < z < 3.8499999999999998e-13

          1. Initial program 84.2%

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{y - z}{t} \cdot x} \]
              6. lower-/.f6450.1%

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

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

            if 3.8499999999999998e-13 < z

            1. Initial program 84.2%

              \[\frac{x \cdot \left(y - z\right)}{t - z} \]
            2. 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. associate-/l*N/A

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

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

                \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
              6. frac-2negN/A

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

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

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

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

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

                \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
              12. sub-negate-revN/A

                \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
              13. lower--.f6497.1%

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

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

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

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

            Alternative 5: 72.8% accurate, 0.7× speedup?

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

              1. Initial program 84.2%

                \[\frac{x \cdot \left(y - z\right)}{t - z} \]
              2. 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. associate-/l*N/A

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

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

                  \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                6. frac-2negN/A

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

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

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

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

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

                  \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                12. sub-negate-revN/A

                  \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                13. lower--.f6497.1%

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

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

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

                  \[\leadsto \frac{z - y}{\color{blue}{z}} \cdot x \]
                2. lower--.f6452.7%

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

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

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

                  \[\leadsto \frac{z - y}{z} \cdot x \]
                3. div-subN/A

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

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

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

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

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

              if -1.9999999999999999e37 < z < 1.9999999999999998e-24

              1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 1.9999999999999998e-24 < z

                1. Initial program 84.2%

                  \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                2. 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. associate-/l*N/A

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

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

                    \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                  6. frac-2negN/A

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

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

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

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

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

                    \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                  12. sub-negate-revN/A

                    \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                  13. lower--.f6497.1%

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

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

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

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

                Alternative 6: 71.0% accurate, 0.7× speedup?

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

                  1. Initial program 84.2%

                    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                  2. 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. associate-/l*N/A

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

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

                      \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                    6. frac-2negN/A

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

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

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

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

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

                      \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                    12. sub-negate-revN/A

                      \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                    13. lower--.f6497.1%

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

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

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

                      \[\leadsto \frac{z - y}{\color{blue}{z}} \cdot x \]
                    2. lower--.f6452.7%

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

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

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

                      \[\leadsto \frac{z - y}{z} \cdot x \]
                    3. div-subN/A

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

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

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

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

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

                  if -1.9999999999999999e37 < z < 1.8e126

                  1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 7: 68.3% accurate, 0.7× speedup?

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

                    1. Initial program 84.2%

                      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                    2. 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. associate-/l*N/A

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

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

                        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                      6. frac-2negN/A

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

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

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

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

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

                        \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                      12. sub-negate-revN/A

                        \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                      13. lower--.f6497.1%

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

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

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

                        \[\leadsto \frac{z - y}{\color{blue}{z}} \cdot x \]
                      2. lower--.f6452.7%

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

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

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

                        \[\leadsto \frac{z - y}{z} \cdot x \]
                      3. div-subN/A

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

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

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

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

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

                    if -5.5e-52 < z < 6.2000000000000004e31

                    1. Initial program 84.2%

                      \[\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. lower-*.f6436.8%

                        \[\leadsto \frac{x \cdot y}{t} \]
                    4. Applied rewrites36.8%

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

                  Alternative 8: 62.0% accurate, 0.7× speedup?

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

                    1. Initial program 84.2%

                      \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                    2. 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. associate-/l*N/A

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

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

                        \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                      6. frac-2negN/A

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

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

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

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

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

                        \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                      12. sub-negate-revN/A

                        \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                      13. lower--.f6497.1%

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

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

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

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

                      if -1.15e238 < z < -5.5e-52

                      1. Initial program 84.2%

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

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

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

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

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

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

                          \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{\left(y - z\right)}\right)\right) \cdot x}{\mathsf{neg}\left(\left(t - z\right)\right)} \]
                        7. sub-negate-revN/A

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

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

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

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

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

                          \[\leadsto \frac{x}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot \left(z - y\right) \]
                        13. sub-negate-revN/A

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

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

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

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

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

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

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

                      if -5.5e-52 < z < 8.4999999999999998e32

                      1. Initial program 84.2%

                        \[\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. lower-*.f6436.8%

                          \[\leadsto \frac{x \cdot y}{t} \]
                      4. Applied rewrites36.8%

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

                    Alternative 9: 61.7% accurate, 0.7× speedup?

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

                      1. Initial program 84.2%

                        \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                      2. 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. associate-/l*N/A

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

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

                          \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                        6. frac-2negN/A

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

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

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

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

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

                          \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                        12. sub-negate-revN/A

                          \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                        13. lower--.f6497.1%

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

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

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

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

                        if -3.2999999999999998e211 < z < -5.5e-52

                        1. Initial program 84.2%

                          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                        2. 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. associate-/l*N/A

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

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

                            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                          6. frac-2negN/A

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

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

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

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

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

                            \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                          12. sub-negate-revN/A

                            \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                          13. lower--.f6497.1%

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

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

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

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

                            \[\leadsto \frac{x \cdot \left(z - y\right)}{z} \]
                          3. lower--.f6445.1%

                            \[\leadsto \frac{x \cdot \left(z - y\right)}{z} \]
                        6. Applied rewrites45.1%

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

                        if -5.5e-52 < z < 8.4999999999999998e32

                        1. Initial program 84.2%

                          \[\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. lower-*.f6436.8%

                            \[\leadsto \frac{x \cdot y}{t} \]
                        4. Applied rewrites36.8%

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

                      Alternative 10: 59.4% accurate, 0.8× speedup?

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

                        1. Initial program 84.2%

                          \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                        2. 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. associate-/l*N/A

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

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

                            \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                          6. frac-2negN/A

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

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

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

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

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

                            \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                          12. sub-negate-revN/A

                            \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                          13. lower--.f6497.1%

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

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

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

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

                          if -1.32e38 < z < 8.4999999999999998e32

                          1. Initial program 84.2%

                            \[\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. lower-*.f6436.8%

                              \[\leadsto \frac{x \cdot y}{t} \]
                          4. Applied rewrites36.8%

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

                        Alternative 11: 59.3% accurate, 0.8× speedup?

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

                          1. Initial program 84.2%

                            \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                          2. 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. associate-/l*N/A

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

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

                              \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                            6. frac-2negN/A

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

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

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

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

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

                              \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                            12. sub-negate-revN/A

                              \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                            13. lower--.f6497.1%

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

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

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

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

                            if -1.32e38 < z < 8.0000000000000006e-15

                            1. Initial program 84.2%

                              \[\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. lower-*.f6436.8%

                                \[\leadsto \frac{x \cdot y}{t} \]
                            4. Applied rewrites36.8%

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

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

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

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

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

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

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

                                \[\leadsto \left(x \cdot \frac{1}{t}\right) \cdot \color{blue}{y} \]
                              8. mult-flip-revN/A

                                \[\leadsto \frac{x}{t} \cdot y \]
                              9. lower-/.f6436.9%

                                \[\leadsto \frac{x}{t} \cdot y \]
                            6. Applied rewrites36.9%

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

                          Alternative 12: 34.6% accurate, 3.8× speedup?

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

                            \[\frac{x \cdot \left(y - z\right)}{t - z} \]
                          2. 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. associate-/l*N/A

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

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

                              \[\leadsto \color{blue}{\frac{y - z}{t - z} \cdot x} \]
                            6. frac-2negN/A

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

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

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

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

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

                              \[\leadsto \frac{z - y}{\mathsf{neg}\left(\color{blue}{\left(t - z\right)}\right)} \cdot x \]
                            12. sub-negate-revN/A

                              \[\leadsto \frac{z - y}{\color{blue}{z - t}} \cdot x \]
                            13. lower--.f6497.1%

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

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

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

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

                            Reproduce

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