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

Percentage Accurate: 83.7% → 97.2%
Time: 3.8s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 83.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.2% accurate, 0.8× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;x\_m \leq 6 \cdot 10^{+195}:\\ \;\;\;\;x\_m \cdot \frac{z - y}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= x_m 6e+195)
    (* x_m (/ (- z y) (- z t)))
    (* (- y z) (/ x_m (- t z))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 6e+195) {
		tmp = x_m * ((z - y) / (z - t));
	} else {
		tmp = (y - z) * (x_m / (t - z));
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x_m <= 6d+195) then
        tmp = x_m * ((z - y) / (z - t))
    else
        tmp = (y - z) * (x_m / (t - z))
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (x_m <= 6e+195) {
		tmp = x_m * ((z - y) / (z - t));
	} else {
		tmp = (y - z) * (x_m / (t - z));
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	tmp = 0
	if x_m <= 6e+195:
		tmp = x_m * ((z - y) / (z - t))
	else:
		tmp = (y - z) * (x_m / (t - z))
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (x_m <= 6e+195)
		tmp = Float64(x_m * Float64(Float64(z - y) / Float64(z - t)));
	else
		tmp = Float64(Float64(y - z) * Float64(x_m / Float64(t - z)));
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	tmp = 0.0;
	if (x_m <= 6e+195)
		tmp = x_m * ((z - y) / (z - t));
	else
		tmp = (y - z) * (x_m / (t - z));
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[x$95$m, 6e+195], N[(x$95$m * N[(N[(z - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;x\_m \leq 6 \cdot 10^{+195}:\\
\;\;\;\;x\_m \cdot \frac{z - y}{z - t}\\

\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x\_m}{t - z}\\


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

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
      12. lower--.f6497.2

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

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

    if 6.0000000000000001e195 < x

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(y - z\right) \cdot \color{blue}{\frac{x}{t - z}} \]
      10. lift--.f6484.8

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

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

Alternative 2: 96.9% accurate, 1.0× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \frac{z - y}{z - t}\right) \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (* x_s (* x_m (/ (- z y) (- z t)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((z - y) / (z - t)));
}
x\_m =     private
x\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x_s * (x_m * ((z - y) / (z - t)))
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	return x_s * (x_m * ((z - y) / (z - t)));
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	return x_s * (x_m * ((z - y) / (z - t)))
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	return Float64(x_s * Float64(x_m * Float64(Float64(z - y) / Float64(z - t))))
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp = code(x_s, x_m, y, z, t)
	tmp = x_s * (x_m * ((z - y) / (z - t)));
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * N[(N[(z - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \left(x\_m \cdot \frac{z - y}{z - t}\right)
\end{array}
Derivation
  1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
    12. lower--.f6497.2

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

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

Alternative 3: 75.6% accurate, 0.7× speedup?

\[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-22}:\\ \;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (let* ((t_1 (- x_m (* x_m (/ y z)))))
   (*
    x_s
    (if (<= z -1.5e+22) t_1 (if (<= z 1.45e-22) (/ (* x_m (- y z)) t) t_1)))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m - (x_m * (y / z));
	double tmp;
	if (z <= -1.5e+22) {
		tmp = t_1;
	} else if (z <= 1.45e-22) {
		tmp = (x_m * (y - z)) / t;
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m =     private
x\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x_s, x_m, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x_s
    real(8), intent (in) :: x_m
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x_m - (x_m * (y / z))
    if (z <= (-1.5d+22)) then
        tmp = t_1
    else if (z <= 1.45d-22) then
        tmp = (x_m * (y - z)) / t
    else
        tmp = t_1
    end if
    code = x_s * tmp
end function
x\_m = Math.abs(x);
x\_s = Math.copySign(1.0, x);
public static double code(double x_s, double x_m, double y, double z, double t) {
	double t_1 = x_m - (x_m * (y / z));
	double tmp;
	if (z <= -1.5e+22) {
		tmp = t_1;
	} else if (z <= 1.45e-22) {
		tmp = (x_m * (y - z)) / t;
	} else {
		tmp = t_1;
	}
	return x_s * tmp;
}
x\_m = math.fabs(x)
x\_s = math.copysign(1.0, x)
def code(x_s, x_m, y, z, t):
	t_1 = x_m - (x_m * (y / z))
	tmp = 0
	if z <= -1.5e+22:
		tmp = t_1
	elif z <= 1.45e-22:
		tmp = (x_m * (y - z)) / t
	else:
		tmp = t_1
	return x_s * tmp
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	t_1 = Float64(x_m - Float64(x_m * Float64(y / z)))
	tmp = 0.0
	if (z <= -1.5e+22)
		tmp = t_1;
	elseif (z <= 1.45e-22)
		tmp = Float64(Float64(x_m * Float64(y - z)) / t);
	else
		tmp = t_1;
	end
	return Float64(x_s * tmp)
end
x\_m = abs(x);
x\_s = sign(x) * abs(1.0);
function tmp_2 = code(x_s, x_m, y, z, t)
	t_1 = x_m - (x_m * (y / z));
	tmp = 0.0;
	if (z <= -1.5e+22)
		tmp = t_1;
	elseif (z <= 1.45e-22)
		tmp = (x_m * (y - z)) / t;
	else
		tmp = t_1;
	end
	tmp_2 = x_s * tmp;
end
x\_m = N[Abs[x], $MachinePrecision]
x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.5e+22], t$95$1, If[LessEqual[z, 1.45e-22], N[(N[(x$95$m * N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], t$95$1]]), $MachinePrecision]]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
\begin{array}{l}
t_1 := x\_m - x\_m \cdot \frac{y}{z}\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-22}:\\
\;\;\;\;\frac{x\_m \cdot \left(y - z\right)}{t}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e22 or 1.4500000000000001e-22 < z

    1. Initial program 83.7%

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(\frac{x \cdot y - t \cdot x}{z}\right)\right) \]
      5. sub-flip-reverseN/A

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

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

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

        \[\leadsto x - \frac{y \cdot x - t \cdot x}{z} \]
      9. distribute-rgt-out--N/A

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

        \[\leadsto x - \frac{x \cdot \left(y - t\right)}{z} \]
      11. lower--.f6447.6

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

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

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

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

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

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

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

    if -1.5e22 < z < 1.4500000000000001e-22

    1. Initial program 83.7%

      \[\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.9%

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

    Alternative 4: 74.1% accurate, 0.7× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-67}:\\ \;\;\;\;x\_m \cdot \frac{y - z}{t}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z t)
     :precision binary64
     (let* ((t_1 (- x_m (* x_m (/ y z)))))
       (*
        x_s
        (if (<= z -1.5e+22) t_1 (if (<= z 1.95e-67) (* x_m (/ (- y z) t)) t_1)))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    double code(double x_s, double x_m, double y, double z, double t) {
    	double t_1 = x_m - (x_m * (y / z));
    	double tmp;
    	if (z <= -1.5e+22) {
    		tmp = t_1;
    	} else if (z <= 1.95e-67) {
    		tmp = x_m * ((y - z) / t);
    	} else {
    		tmp = t_1;
    	}
    	return x_s * tmp;
    }
    
    x\_m =     private
    x\_s =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x_s, x_m, y, z, t)
    use fmin_fmax_functions
        real(8), intent (in) :: x_s
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = x_m - (x_m * (y / z))
        if (z <= (-1.5d+22)) then
            tmp = t_1
        else if (z <= 1.95d-67) then
            tmp = x_m * ((y - z) / t)
        else
            tmp = t_1
        end if
        code = x_s * tmp
    end function
    
    x\_m = Math.abs(x);
    x\_s = Math.copySign(1.0, x);
    public static double code(double x_s, double x_m, double y, double z, double t) {
    	double t_1 = x_m - (x_m * (y / z));
    	double tmp;
    	if (z <= -1.5e+22) {
    		tmp = t_1;
    	} else if (z <= 1.95e-67) {
    		tmp = x_m * ((y - z) / t);
    	} else {
    		tmp = t_1;
    	}
    	return x_s * tmp;
    }
    
    x\_m = math.fabs(x)
    x\_s = math.copysign(1.0, x)
    def code(x_s, x_m, y, z, t):
    	t_1 = x_m - (x_m * (y / z))
    	tmp = 0
    	if z <= -1.5e+22:
    		tmp = t_1
    	elif z <= 1.95e-67:
    		tmp = x_m * ((y - z) / t)
    	else:
    		tmp = t_1
    	return x_s * tmp
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    function code(x_s, x_m, y, z, t)
    	t_1 = Float64(x_m - Float64(x_m * Float64(y / z)))
    	tmp = 0.0
    	if (z <= -1.5e+22)
    		tmp = t_1;
    	elseif (z <= 1.95e-67)
    		tmp = Float64(x_m * Float64(Float64(y - z) / t));
    	else
    		tmp = t_1;
    	end
    	return Float64(x_s * tmp)
    end
    
    x\_m = abs(x);
    x\_s = sign(x) * abs(1.0);
    function tmp_2 = code(x_s, x_m, y, z, t)
    	t_1 = x_m - (x_m * (y / z));
    	tmp = 0.0;
    	if (z <= -1.5e+22)
    		tmp = t_1;
    	elseif (z <= 1.95e-67)
    		tmp = x_m * ((y - z) / t);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = x_s * tmp;
    end
    
    x\_m = N[Abs[x], $MachinePrecision]
    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.5e+22], t$95$1, If[LessEqual[z, 1.95e-67], N[(x$95$m * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    
    \\
    \begin{array}{l}
    t_1 := x\_m - x\_m \cdot \frac{y}{z}\\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -1.5 \cdot 10^{+22}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 1.95 \cdot 10^{-67}:\\
    \;\;\;\;x\_m \cdot \frac{y - z}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.5e22 or 1.9499999999999999e-67 < z

      1. Initial program 83.7%

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

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

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

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

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

          \[\leadsto x + \left(\mathsf{neg}\left(\frac{x \cdot y - t \cdot x}{z}\right)\right) \]
        5. sub-flip-reverseN/A

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

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

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

          \[\leadsto x - \frac{y \cdot x - t \cdot x}{z} \]
        9. distribute-rgt-out--N/A

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

          \[\leadsto x - \frac{x \cdot \left(y - t\right)}{z} \]
        11. lower--.f6447.6

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

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

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

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

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

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

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

      if -1.5e22 < z < 1.9499999999999999e-67

      1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
        12. lower--.f6497.2

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

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

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

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

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

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

          \[\leadsto x \cdot \frac{y - z}{t} \]
        5. lower--.f6451.0

          \[\leadsto x \cdot \frac{y - z}{t} \]
      6. Applied rewrites51.0%

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

    Alternative 5: 74.1% accurate, 0.7× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ \begin{array}{l} t_1 := x\_m - x\_m \cdot \frac{y}{z}\\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 105000:\\ \;\;\;\;y \cdot \frac{x\_m}{t - z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z t)
     :precision binary64
     (let* ((t_1 (- x_m (* x_m (/ y z)))))
       (*
        x_s
        (if (<= z -1.45e+22) t_1 (if (<= z 105000.0) (* y (/ x_m (- t z))) t_1)))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    double code(double x_s, double x_m, double y, double z, double t) {
    	double t_1 = x_m - (x_m * (y / z));
    	double tmp;
    	if (z <= -1.45e+22) {
    		tmp = t_1;
    	} else if (z <= 105000.0) {
    		tmp = y * (x_m / (t - z));
    	} else {
    		tmp = t_1;
    	}
    	return x_s * tmp;
    }
    
    x\_m =     private
    x\_s =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x_s, x_m, y, z, t)
    use fmin_fmax_functions
        real(8), intent (in) :: x_s
        real(8), intent (in) :: x_m
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = x_m - (x_m * (y / z))
        if (z <= (-1.45d+22)) then
            tmp = t_1
        else if (z <= 105000.0d0) then
            tmp = y * (x_m / (t - z))
        else
            tmp = t_1
        end if
        code = x_s * tmp
    end function
    
    x\_m = Math.abs(x);
    x\_s = Math.copySign(1.0, x);
    public static double code(double x_s, double x_m, double y, double z, double t) {
    	double t_1 = x_m - (x_m * (y / z));
    	double tmp;
    	if (z <= -1.45e+22) {
    		tmp = t_1;
    	} else if (z <= 105000.0) {
    		tmp = y * (x_m / (t - z));
    	} else {
    		tmp = t_1;
    	}
    	return x_s * tmp;
    }
    
    x\_m = math.fabs(x)
    x\_s = math.copysign(1.0, x)
    def code(x_s, x_m, y, z, t):
    	t_1 = x_m - (x_m * (y / z))
    	tmp = 0
    	if z <= -1.45e+22:
    		tmp = t_1
    	elif z <= 105000.0:
    		tmp = y * (x_m / (t - z))
    	else:
    		tmp = t_1
    	return x_s * tmp
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    function code(x_s, x_m, y, z, t)
    	t_1 = Float64(x_m - Float64(x_m * Float64(y / z)))
    	tmp = 0.0
    	if (z <= -1.45e+22)
    		tmp = t_1;
    	elseif (z <= 105000.0)
    		tmp = Float64(y * Float64(x_m / Float64(t - z)));
    	else
    		tmp = t_1;
    	end
    	return Float64(x_s * tmp)
    end
    
    x\_m = abs(x);
    x\_s = sign(x) * abs(1.0);
    function tmp_2 = code(x_s, x_m, y, z, t)
    	t_1 = x_m - (x_m * (y / z));
    	tmp = 0.0;
    	if (z <= -1.45e+22)
    		tmp = t_1;
    	elseif (z <= 105000.0)
    		tmp = y * (x_m / (t - z));
    	else
    		tmp = t_1;
    	end
    	tmp_2 = x_s * tmp;
    end
    
    x\_m = N[Abs[x], $MachinePrecision]
    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[x$95$s_, x$95$m_, y_, z_, t_] := Block[{t$95$1 = N[(x$95$m - N[(x$95$m * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x$95$s * If[LessEqual[z, -1.45e+22], t$95$1, If[LessEqual[z, 105000.0], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]), $MachinePrecision]]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    
    \\
    \begin{array}{l}
    t_1 := x\_m - x\_m \cdot \frac{y}{z}\\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;z \leq 105000:\\
    \;\;\;\;y \cdot \frac{x\_m}{t - z}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.45e22 or 105000 < z

      1. Initial program 83.7%

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

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

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

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

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

          \[\leadsto x + \left(\mathsf{neg}\left(\frac{x \cdot y - t \cdot x}{z}\right)\right) \]
        5. sub-flip-reverseN/A

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

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

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

          \[\leadsto x - \frac{y \cdot x - t \cdot x}{z} \]
        9. distribute-rgt-out--N/A

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

          \[\leadsto x - \frac{x \cdot \left(y - t\right)}{z} \]
        11. lower--.f6447.6

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

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

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

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

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

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

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

      if -1.45e22 < z < 105000

      1. Initial program 83.7%

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

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

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

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

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

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

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

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

    Alternative 6: 70.0% accurate, 0.6× speedup?

    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 500:\\ \;\;\;\;y \cdot \frac{x\_m}{t - z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+153}:\\ \;\;\;\;z \cdot \frac{x\_m}{z - t}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot 1\\ \end{array} \end{array} \]
    x\_m = (fabs.f64 x)
    x\_s = (copysign.f64 #s(literal 1 binary64) x)
    (FPCore (x_s x_m y z t)
     :precision binary64
     (*
      x_s
      (if (<= z -1.45e+22)
        (fma t (/ x_m z) x_m)
        (if (<= z 500.0)
          (* y (/ x_m (- t z)))
          (if (<= z 6e+153) (* z (/ x_m (- z t))) (* x_m 1.0))))))
    x\_m = fabs(x);
    x\_s = copysign(1.0, x);
    double code(double x_s, double x_m, double y, double z, double t) {
    	double tmp;
    	if (z <= -1.45e+22) {
    		tmp = fma(t, (x_m / z), x_m);
    	} else if (z <= 500.0) {
    		tmp = y * (x_m / (t - z));
    	} else if (z <= 6e+153) {
    		tmp = z * (x_m / (z - t));
    	} else {
    		tmp = x_m * 1.0;
    	}
    	return x_s * tmp;
    }
    
    x\_m = abs(x)
    x\_s = copysign(1.0, x)
    function code(x_s, x_m, y, z, t)
    	tmp = 0.0
    	if (z <= -1.45e+22)
    		tmp = fma(t, Float64(x_m / z), x_m);
    	elseif (z <= 500.0)
    		tmp = Float64(y * Float64(x_m / Float64(t - z)));
    	elseif (z <= 6e+153)
    		tmp = Float64(z * Float64(x_m / Float64(z - t)));
    	else
    		tmp = Float64(x_m * 1.0);
    	end
    	return Float64(x_s * tmp)
    end
    
    x\_m = N[Abs[x], $MachinePrecision]
    x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.45e+22], N[(t * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 500.0], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+153], N[(z * N[(x$95$m / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * 1.0), $MachinePrecision]]]]), $MachinePrecision]
    
    \begin{array}{l}
    x\_m = \left|x\right|
    \\
    x\_s = \mathsf{copysign}\left(1, x\right)
    
    \\
    x\_s \cdot \begin{array}{l}
    \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\
    \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\
    
    \mathbf{elif}\;z \leq 500:\\
    \;\;\;\;y \cdot \frac{x\_m}{t - z}\\
    
    \mathbf{elif}\;z \leq 6 \cdot 10^{+153}:\\
    \;\;\;\;z \cdot \frac{x\_m}{z - t}\\
    
    \mathbf{else}:\\
    \;\;\;\;x\_m \cdot 1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if z < -1.45e22

      1. Initial program 83.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{z \cdot x}{z - \color{blue}{t}} \]
        7. lower--.f6444.4

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

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

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

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

          \[\leadsto t \cdot \frac{x}{z} + x \]
        3. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(t, \frac{x}{\color{blue}{z}}, x\right) \]
        4. lower-/.f6436.3

          \[\leadsto \mathsf{fma}\left(t, \frac{x}{z}, x\right) \]
      7. Applied rewrites36.3%

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

      if -1.45e22 < z < 500

      1. Initial program 83.7%

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

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

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

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

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

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

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

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

      if 500 < z < 6.00000000000000037e153

      1. Initial program 83.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{z \cdot x}{z - \color{blue}{t}} \]
        7. lower--.f6444.4

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

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

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

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

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

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

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

          \[\leadsto z \cdot \frac{x}{\color{blue}{z - t}} \]
        7. lift--.f6446.2

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

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

      if 6.00000000000000037e153 < z

      1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
        12. lower--.f6497.2

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

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

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

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

      Alternative 7: 68.1% accurate, 0.7× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+118}:\\ \;\;\;\;y \cdot \frac{x\_m}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot 1\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (<= z -1.45e+22)
          (fma t (/ x_m z) x_m)
          (if (<= z 5.5e+118) (* y (/ x_m (- t z))) (* x_m 1.0)))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if (z <= -1.45e+22) {
      		tmp = fma(t, (x_m / z), x_m);
      	} else if (z <= 5.5e+118) {
      		tmp = y * (x_m / (t - z));
      	} else {
      		tmp = x_m * 1.0;
      	}
      	return x_s * tmp;
      }
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      function code(x_s, x_m, y, z, t)
      	tmp = 0.0
      	if (z <= -1.45e+22)
      		tmp = fma(t, Float64(x_m / z), x_m);
      	elseif (z <= 5.5e+118)
      		tmp = Float64(y * Float64(x_m / Float64(t - z)));
      	else
      		tmp = Float64(x_m * 1.0);
      	end
      	return Float64(x_s * tmp)
      end
      
      x\_m = N[Abs[x], $MachinePrecision]
      x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.45e+22], N[(t * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 5.5e+118], N[(y * N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$95$m * 1.0), $MachinePrecision]]]), $MachinePrecision]
      
      \begin{array}{l}
      x\_m = \left|x\right|
      \\
      x\_s = \mathsf{copysign}\left(1, x\right)
      
      \\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -1.45 \cdot 10^{+22}:\\
      \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\
      
      \mathbf{elif}\;z \leq 5.5 \cdot 10^{+118}:\\
      \;\;\;\;y \cdot \frac{x\_m}{t - z}\\
      
      \mathbf{else}:\\
      \;\;\;\;x\_m \cdot 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -1.45e22

        1. Initial program 83.7%

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

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

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

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

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

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

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

            \[\leadsto \frac{z \cdot x}{z - \color{blue}{t}} \]
          7. lower--.f6444.4

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

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

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

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

            \[\leadsto t \cdot \frac{x}{z} + x \]
          3. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(t, \frac{x}{\color{blue}{z}}, x\right) \]
          4. lower-/.f6436.3

            \[\leadsto \mathsf{fma}\left(t, \frac{x}{z}, x\right) \]
        7. Applied rewrites36.3%

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

        if -1.45e22 < z < 5.5000000000000003e118

        1. Initial program 83.7%

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

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

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

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

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

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

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

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

        if 5.5000000000000003e118 < z

        1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
          12. lower--.f6497.2

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

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

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

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

        Alternative 8: 62.0% accurate, 0.8× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+80}:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot 1\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        (FPCore (x_s x_m y z t)
         :precision binary64
         (*
          x_s
          (if (<= z -1.65e+22)
            (fma t (/ x_m z) x_m)
            (if (<= z 3e+80) (* x_m (/ y t)) (* x_m 1.0)))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        double code(double x_s, double x_m, double y, double z, double t) {
        	double tmp;
        	if (z <= -1.65e+22) {
        		tmp = fma(t, (x_m / z), x_m);
        	} else if (z <= 3e+80) {
        		tmp = x_m * (y / t);
        	} else {
        		tmp = x_m * 1.0;
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        function code(x_s, x_m, y, z, t)
        	tmp = 0.0
        	if (z <= -1.65e+22)
        		tmp = fma(t, Float64(x_m / z), x_m);
        	elseif (z <= 3e+80)
        		tmp = Float64(x_m * Float64(y / t));
        	else
        		tmp = Float64(x_m * 1.0);
        	end
        	return Float64(x_s * tmp)
        end
        
        x\_m = N[Abs[x], $MachinePrecision]
        x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.65e+22], N[(t * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 3e+80], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * 1.0), $MachinePrecision]]]), $MachinePrecision]
        
        \begin{array}{l}
        x\_m = \left|x\right|
        \\
        x\_s = \mathsf{copysign}\left(1, x\right)
        
        \\
        x\_s \cdot \begin{array}{l}
        \mathbf{if}\;z \leq -1.65 \cdot 10^{+22}:\\
        \;\;\;\;\mathsf{fma}\left(t, \frac{x\_m}{z}, x\_m\right)\\
        
        \mathbf{elif}\;z \leq 3 \cdot 10^{+80}:\\
        \;\;\;\;x\_m \cdot \frac{y}{t}\\
        
        \mathbf{else}:\\
        \;\;\;\;x\_m \cdot 1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -1.6499999999999999e22

          1. Initial program 83.7%

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

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

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

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

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

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

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

              \[\leadsto \frac{z \cdot x}{z - \color{blue}{t}} \]
            7. lower--.f6444.4

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

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

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

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

              \[\leadsto t \cdot \frac{x}{z} + x \]
            3. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(t, \frac{x}{\color{blue}{z}}, x\right) \]
            4. lower-/.f6436.3

              \[\leadsto \mathsf{fma}\left(t, \frac{x}{z}, x\right) \]
          7. Applied rewrites36.3%

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

          if -1.6499999999999999e22 < z < 2.99999999999999987e80

          1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
            12. lower--.f6497.2

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

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

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

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

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

          if 2.99999999999999987e80 < z

          1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
            12. lower--.f6497.2

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

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

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

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

          Alternative 9: 62.0% accurate, 0.8× speedup?

          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+22}:\\ \;\;\;\;x\_m \cdot 1\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+80}:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot 1\\ \end{array} \end{array} \]
          x\_m = (fabs.f64 x)
          x\_s = (copysign.f64 #s(literal 1 binary64) x)
          (FPCore (x_s x_m y z t)
           :precision binary64
           (*
            x_s
            (if (<= z -1.65e+22)
              (* x_m 1.0)
              (if (<= z 3e+80) (* x_m (/ y t)) (* x_m 1.0)))))
          x\_m = fabs(x);
          x\_s = copysign(1.0, x);
          double code(double x_s, double x_m, double y, double z, double t) {
          	double tmp;
          	if (z <= -1.65e+22) {
          		tmp = x_m * 1.0;
          	} else if (z <= 3e+80) {
          		tmp = x_m * (y / t);
          	} else {
          		tmp = x_m * 1.0;
          	}
          	return x_s * tmp;
          }
          
          x\_m =     private
          x\_s =     private
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x_s, x_m, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x_s
              real(8), intent (in) :: x_m
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (z <= (-1.65d+22)) then
                  tmp = x_m * 1.0d0
              else if (z <= 3d+80) then
                  tmp = x_m * (y / t)
              else
                  tmp = x_m * 1.0d0
              end if
              code = x_s * tmp
          end function
          
          x\_m = Math.abs(x);
          x\_s = Math.copySign(1.0, x);
          public static double code(double x_s, double x_m, double y, double z, double t) {
          	double tmp;
          	if (z <= -1.65e+22) {
          		tmp = x_m * 1.0;
          	} else if (z <= 3e+80) {
          		tmp = x_m * (y / t);
          	} else {
          		tmp = x_m * 1.0;
          	}
          	return x_s * tmp;
          }
          
          x\_m = math.fabs(x)
          x\_s = math.copysign(1.0, x)
          def code(x_s, x_m, y, z, t):
          	tmp = 0
          	if z <= -1.65e+22:
          		tmp = x_m * 1.0
          	elif z <= 3e+80:
          		tmp = x_m * (y / t)
          	else:
          		tmp = x_m * 1.0
          	return x_s * tmp
          
          x\_m = abs(x)
          x\_s = copysign(1.0, x)
          function code(x_s, x_m, y, z, t)
          	tmp = 0.0
          	if (z <= -1.65e+22)
          		tmp = Float64(x_m * 1.0);
          	elseif (z <= 3e+80)
          		tmp = Float64(x_m * Float64(y / t));
          	else
          		tmp = Float64(x_m * 1.0);
          	end
          	return Float64(x_s * tmp)
          end
          
          x\_m = abs(x);
          x\_s = sign(x) * abs(1.0);
          function tmp_2 = code(x_s, x_m, y, z, t)
          	tmp = 0.0;
          	if (z <= -1.65e+22)
          		tmp = x_m * 1.0;
          	elseif (z <= 3e+80)
          		tmp = x_m * (y / t);
          	else
          		tmp = x_m * 1.0;
          	end
          	tmp_2 = x_s * tmp;
          end
          
          x\_m = N[Abs[x], $MachinePrecision]
          x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.65e+22], N[(x$95$m * 1.0), $MachinePrecision], If[LessEqual[z, 3e+80], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * 1.0), $MachinePrecision]]]), $MachinePrecision]
          
          \begin{array}{l}
          x\_m = \left|x\right|
          \\
          x\_s = \mathsf{copysign}\left(1, x\right)
          
          \\
          x\_s \cdot \begin{array}{l}
          \mathbf{if}\;z \leq -1.65 \cdot 10^{+22}:\\
          \;\;\;\;x\_m \cdot 1\\
          
          \mathbf{elif}\;z \leq 3 \cdot 10^{+80}:\\
          \;\;\;\;x\_m \cdot \frac{y}{t}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\_m \cdot 1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -1.6499999999999999e22 or 2.99999999999999987e80 < z

            1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
              12. lower--.f6497.2

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

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

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

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

              if -1.6499999999999999e22 < z < 2.99999999999999987e80

              1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
                12. lower--.f6497.2

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

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

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

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

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

            Alternative 10: 61.0% accurate, 0.8× speedup?

            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+22}:\\ \;\;\;\;x\_m \cdot 1\\ \mathbf{elif}\;z \leq 105000:\\ \;\;\;\;y \cdot \frac{x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot 1\\ \end{array} \end{array} \]
            x\_m = (fabs.f64 x)
            x\_s = (copysign.f64 #s(literal 1 binary64) x)
            (FPCore (x_s x_m y z t)
             :precision binary64
             (*
              x_s
              (if (<= z -1.3e+22)
                (* x_m 1.0)
                (if (<= z 105000.0) (* y (/ x_m t)) (* x_m 1.0)))))
            x\_m = fabs(x);
            x\_s = copysign(1.0, x);
            double code(double x_s, double x_m, double y, double z, double t) {
            	double tmp;
            	if (z <= -1.3e+22) {
            		tmp = x_m * 1.0;
            	} else if (z <= 105000.0) {
            		tmp = y * (x_m / t);
            	} else {
            		tmp = x_m * 1.0;
            	}
            	return x_s * tmp;
            }
            
            x\_m =     private
            x\_s =     private
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x_s, x_m, y, z, t)
            use fmin_fmax_functions
                real(8), intent (in) :: x_s
                real(8), intent (in) :: x_m
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8) :: tmp
                if (z <= (-1.3d+22)) then
                    tmp = x_m * 1.0d0
                else if (z <= 105000.0d0) then
                    tmp = y * (x_m / t)
                else
                    tmp = x_m * 1.0d0
                end if
                code = x_s * tmp
            end function
            
            x\_m = Math.abs(x);
            x\_s = Math.copySign(1.0, x);
            public static double code(double x_s, double x_m, double y, double z, double t) {
            	double tmp;
            	if (z <= -1.3e+22) {
            		tmp = x_m * 1.0;
            	} else if (z <= 105000.0) {
            		tmp = y * (x_m / t);
            	} else {
            		tmp = x_m * 1.0;
            	}
            	return x_s * tmp;
            }
            
            x\_m = math.fabs(x)
            x\_s = math.copysign(1.0, x)
            def code(x_s, x_m, y, z, t):
            	tmp = 0
            	if z <= -1.3e+22:
            		tmp = x_m * 1.0
            	elif z <= 105000.0:
            		tmp = y * (x_m / t)
            	else:
            		tmp = x_m * 1.0
            	return x_s * tmp
            
            x\_m = abs(x)
            x\_s = copysign(1.0, x)
            function code(x_s, x_m, y, z, t)
            	tmp = 0.0
            	if (z <= -1.3e+22)
            		tmp = Float64(x_m * 1.0);
            	elseif (z <= 105000.0)
            		tmp = Float64(y * Float64(x_m / t));
            	else
            		tmp = Float64(x_m * 1.0);
            	end
            	return Float64(x_s * tmp)
            end
            
            x\_m = abs(x);
            x\_s = sign(x) * abs(1.0);
            function tmp_2 = code(x_s, x_m, y, z, t)
            	tmp = 0.0;
            	if (z <= -1.3e+22)
            		tmp = x_m * 1.0;
            	elseif (z <= 105000.0)
            		tmp = y * (x_m / t);
            	else
            		tmp = x_m * 1.0;
            	end
            	tmp_2 = x_s * tmp;
            end
            
            x\_m = N[Abs[x], $MachinePrecision]
            x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * If[LessEqual[z, -1.3e+22], N[(x$95$m * 1.0), $MachinePrecision], If[LessEqual[z, 105000.0], N[(y * N[(x$95$m / t), $MachinePrecision]), $MachinePrecision], N[(x$95$m * 1.0), $MachinePrecision]]]), $MachinePrecision]
            
            \begin{array}{l}
            x\_m = \left|x\right|
            \\
            x\_s = \mathsf{copysign}\left(1, x\right)
            
            \\
            x\_s \cdot \begin{array}{l}
            \mathbf{if}\;z \leq -1.3 \cdot 10^{+22}:\\
            \;\;\;\;x\_m \cdot 1\\
            
            \mathbf{elif}\;z \leq 105000:\\
            \;\;\;\;y \cdot \frac{x\_m}{t}\\
            
            \mathbf{else}:\\
            \;\;\;\;x\_m \cdot 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -1.3e22 or 105000 < z

              1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
                12. lower--.f6497.2

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

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

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

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

                if -1.3e22 < z < 105000

                1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

                    \[\leadsto y \cdot \color{blue}{\frac{x}{t}} \]
                  5. lower-/.f6437.9

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

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

              Alternative 11: 35.1% accurate, 3.2× speedup?

              \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot 1\right) \end{array} \]
              x\_m = (fabs.f64 x)
              x\_s = (copysign.f64 #s(literal 1 binary64) x)
              (FPCore (x_s x_m y z t) :precision binary64 (* x_s (* x_m 1.0)))
              x\_m = fabs(x);
              x\_s = copysign(1.0, x);
              double code(double x_s, double x_m, double y, double z, double t) {
              	return x_s * (x_m * 1.0);
              }
              
              x\_m =     private
              x\_s =     private
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x_s, x_m, y, z, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: x_s
                  real(8), intent (in) :: x_m
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  code = x_s * (x_m * 1.0d0)
              end function
              
              x\_m = Math.abs(x);
              x\_s = Math.copySign(1.0, x);
              public static double code(double x_s, double x_m, double y, double z, double t) {
              	return x_s * (x_m * 1.0);
              }
              
              x\_m = math.fabs(x)
              x\_s = math.copysign(1.0, x)
              def code(x_s, x_m, y, z, t):
              	return x_s * (x_m * 1.0)
              
              x\_m = abs(x)
              x\_s = copysign(1.0, x)
              function code(x_s, x_m, y, z, t)
              	return Float64(x_s * Float64(x_m * 1.0))
              end
              
              x\_m = abs(x);
              x\_s = sign(x) * abs(1.0);
              function tmp = code(x_s, x_m, y, z, t)
              	tmp = x_s * (x_m * 1.0);
              end
              
              x\_m = N[Abs[x], $MachinePrecision]
              x\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[x$95$s_, x$95$m_, y_, z_, t_] := N[(x$95$s * N[(x$95$m * 1.0), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              x\_m = \left|x\right|
              \\
              x\_s = \mathsf{copysign}\left(1, x\right)
              
              \\
              x\_s \cdot \left(x\_m \cdot 1\right)
              \end{array}
              
              Derivation
              1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot \frac{z - y}{\color{blue}{z - t}} \]
                12. lower--.f6497.2

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

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

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

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

                Reproduce

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