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

Percentage Accurate: 84.7% → 98.2%
Time: 10.9s
Alternatives: 12
Speedup: 0.7×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

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

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

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

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

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

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

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


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

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(y - z\right) \cdot x}{\color{blue}{\frac{t \cdot t - z \cdot z}{t + z}}} \]
      8. difference-of-squares-revN/A

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

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

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

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

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

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

        \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\left(t + z\right)} \]
      15. flip-+N/A

        \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\frac{t \cdot t - z \cdot z}{t - z}} \]
      16. difference-of-squares-revN/A

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

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

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

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

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

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

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

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

    if -0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4.9999999999999997e303

    1. Initial program 98.9%

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

    if 4.9999999999999997e303 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 36.3%

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

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

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

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

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

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

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

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

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

Alternative 2: 98.4% accurate, 0.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -4.0000000000000002e289 or 4.9999999999999997e303 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z))

    1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

    if -4.0000000000000002e289 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4.9999999999999997e303

    1. Initial program 98.0%

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

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

Alternative 3: 74.2% 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 -5.2 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-81}:\\ \;\;\;\;\frac{x\_m}{t - z} \cdot y\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\ \end{array} \end{array} \]
x\_m = (fabs.f64 x)
x\_s = (copysign.f64 #s(literal 1 binary64) x)
(FPCore (x_s x_m y z t)
 :precision binary64
 (*
  x_s
  (if (<= z -5.2e-17)
    (fma (- x_m) (/ y z) x_m)
    (if (<= z 1.5e-81)
      (* (/ x_m (- t z)) y)
      (if (<= z 6.2e+54) (/ (* (- y z) x_m) t) (fma (- y) (/ x_m z) x_m))))))
x\_m = fabs(x);
x\_s = copysign(1.0, x);
double code(double x_s, double x_m, double y, double z, double t) {
	double tmp;
	if (z <= -5.2e-17) {
		tmp = fma(-x_m, (y / z), x_m);
	} else if (z <= 1.5e-81) {
		tmp = (x_m / (t - z)) * y;
	} else if (z <= 6.2e+54) {
		tmp = ((y - z) * x_m) / t;
	} else {
		tmp = fma(-y, (x_m / z), x_m);
	}
	return x_s * tmp;
}
x\_m = abs(x)
x\_s = copysign(1.0, x)
function code(x_s, x_m, y, z, t)
	tmp = 0.0
	if (z <= -5.2e-17)
		tmp = fma(Float64(-x_m), Float64(y / z), x_m);
	elseif (z <= 1.5e-81)
		tmp = Float64(Float64(x_m / Float64(t - z)) * y);
	elseif (z <= 6.2e+54)
		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
	else
		tmp = fma(Float64(-y), Float64(x_m / z), x_m);
	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, -5.2e-17], N[((-x$95$m) * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 1.5e-81], N[(N[(x$95$m / N[(t - z), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 6.2e+54], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], N[((-y) * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
x\_m = \left|x\right|
\\
x\_s = \mathsf{copysign}\left(1, x\right)

\\
x\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{-81}:\\
\;\;\;\;\frac{x\_m}{t - z} \cdot y\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.20000000000000006e-17

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
    5. 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}} \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
      2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
    7. Applied rewrites71.5%

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

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

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

      if -5.20000000000000006e-17 < z < 1.4999999999999999e-81

      1. Initial program 93.8%

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

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

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

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

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

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

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

      if 1.4999999999999999e-81 < z < 6.1999999999999999e54

      1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{\left(y - z\right) \cdot x}}{t} \]
        4. lower--.f6479.0

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

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

      if 6.1999999999999999e54 < z

      1. Initial program 74.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
      5. 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}} \]
      6. Step-by-step derivation
        1. associate--l+N/A

          \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
        2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
      7. Applied rewrites85.2%

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

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

          \[\leadsto \mathsf{fma}\left(-y, \frac{\color{blue}{x}}{z}, x\right) \]
      10. Recombined 4 regimes into one program.
      11. Final simplification83.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, x\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{t - z} \cdot y\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x}{z}, x\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 4: 87.4% accurate, 0.7× speedup?

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

        1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(y - z\right) \cdot x}{\color{blue}{\frac{t \cdot t - z \cdot z}{t + z}}} \]
          8. difference-of-squares-revN/A

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

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

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

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

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

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

            \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\left(t + z\right)} \]
          15. flip-+N/A

            \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\frac{t \cdot t - z \cdot z}{t - z}} \]
          16. difference-of-squares-revN/A

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

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

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

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

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

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

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

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

          \[\leadsto x \cdot \color{blue}{\left(\left(1 + -1 \cdot \frac{y}{z}\right) - -1 \cdot \frac{t}{z}\right)} \]
        8. Step-by-step derivation
          1. fp-cancel-sub-sign-invN/A

            \[\leadsto x \cdot \color{blue}{\left(\left(1 + -1 \cdot \frac{y}{z}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{t}{z}\right)} \]
          2. fp-cancel-sign-sub-invN/A

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

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

            \[\leadsto x \cdot \left(\left(1 - \color{blue}{\frac{y}{z}}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{t}{z}\right) \]
          5. metadata-evalN/A

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

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

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

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

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

            \[\leadsto x \cdot \left(1 - \color{blue}{\frac{y - t}{z}}\right) \]
          11. lower--.f6479.8

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

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

        if -165000 < z < 6.6e201

        1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

        if 6.6e201 < z

        1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
          10. lower-neg.f6499.9

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

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

      Alternative 5: 73.7% accurate, 0.7× speedup?

      \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-17} \lor \neg \left(z \leq 6.2 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \end{array} \end{array} \]
      x\_m = (fabs.f64 x)
      x\_s = (copysign.f64 #s(literal 1 binary64) x)
      (FPCore (x_s x_m y z t)
       :precision binary64
       (*
        x_s
        (if (or (<= z -5.2e-17) (not (<= z 6.2e+54)))
          (fma (- x_m) (/ y z) x_m)
          (/ (* (- y z) x_m) t))))
      x\_m = fabs(x);
      x\_s = copysign(1.0, x);
      double code(double x_s, double x_m, double y, double z, double t) {
      	double tmp;
      	if ((z <= -5.2e-17) || !(z <= 6.2e+54)) {
      		tmp = fma(-x_m, (y / z), x_m);
      	} else {
      		tmp = ((y - z) * x_m) / t;
      	}
      	return x_s * tmp;
      }
      
      x\_m = abs(x)
      x\_s = copysign(1.0, x)
      function code(x_s, x_m, y, z, t)
      	tmp = 0.0
      	if ((z <= -5.2e-17) || !(z <= 6.2e+54))
      		tmp = fma(Float64(-x_m), Float64(y / z), x_m);
      	else
      		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
      	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[Or[LessEqual[z, -5.2e-17], N[Not[LessEqual[z, 6.2e+54]], $MachinePrecision]], N[((-x$95$m) * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision]]), $MachinePrecision]
      
      \begin{array}{l}
      x\_m = \left|x\right|
      \\
      x\_s = \mathsf{copysign}\left(1, x\right)
      
      \\
      x\_s \cdot \begin{array}{l}
      \mathbf{if}\;z \leq -5.2 \cdot 10^{-17} \lor \neg \left(z \leq 6.2 \cdot 10^{+54}\right):\\
      \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -5.20000000000000006e-17 or 6.1999999999999999e54 < z

        1. Initial program 77.5%

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
        5. 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}} \]
        6. Step-by-step derivation
          1. associate--l+N/A

            \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
          2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
        7. Applied rewrites77.8%

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

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

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

          if -5.20000000000000006e-17 < z < 6.1999999999999999e54

          1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-17} \lor \neg \left(z \leq 6.2 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 6: 68.2% accurate, 0.7× speedup?

        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-73} \lor \neg \left(z \leq 4.2 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x\_m}{t}\\ \end{array} \end{array} \]
        x\_m = (fabs.f64 x)
        x\_s = (copysign.f64 #s(literal 1 binary64) x)
        (FPCore (x_s x_m y z t)
         :precision binary64
         (*
          x_s
          (if (or (<= z -3.9e-73) (not (<= z 4.2e+54)))
            (fma (- x_m) (/ y z) x_m)
            (/ (* y x_m) t))))
        x\_m = fabs(x);
        x\_s = copysign(1.0, x);
        double code(double x_s, double x_m, double y, double z, double t) {
        	double tmp;
        	if ((z <= -3.9e-73) || !(z <= 4.2e+54)) {
        		tmp = fma(-x_m, (y / z), x_m);
        	} else {
        		tmp = (y * x_m) / t;
        	}
        	return x_s * tmp;
        }
        
        x\_m = abs(x)
        x\_s = copysign(1.0, x)
        function code(x_s, x_m, y, z, t)
        	tmp = 0.0
        	if ((z <= -3.9e-73) || !(z <= 4.2e+54))
        		tmp = fma(Float64(-x_m), Float64(y / z), x_m);
        	else
        		tmp = Float64(Float64(y * x_m) / t);
        	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[Or[LessEqual[z, -3.9e-73], N[Not[LessEqual[z, 4.2e+54]], $MachinePrecision]], N[((-x$95$m) * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision], N[(N[(y * x$95$m), $MachinePrecision] / t), $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 -3.9 \cdot 10^{-73} \lor \neg \left(z \leq 4.2 \cdot 10^{+54}\right):\\
        \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{y \cdot x\_m}{t}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.89999999999999982e-73 or 4.19999999999999972e54 < z

          1. Initial program 78.9%

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
          5. 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}} \]
          6. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
            2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
          7. Applied rewrites74.6%

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

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

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

            if -3.89999999999999982e-73 < z < 4.19999999999999972e54

            1. Initial program 95.0%

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

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

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

                \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
              3. lower-*.f6467.5

                \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
            5. Applied rewrites67.5%

              \[\leadsto \color{blue}{\frac{y \cdot x}{t}} \]
          10. Recombined 2 regimes into one program.
          11. Final simplification73.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{-73} \lor \neg \left(z \leq 4.2 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{t}\\ \end{array} \]
          12. Add Preprocessing

          Alternative 7: 74.8% accurate, 0.7× speedup?

          \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\ \;\;\;\;x\_m \cdot \left(1 - \frac{y - t}{z}\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{y \cdot x\_m}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\ \end{array} \end{array} \]
          x\_m = (fabs.f64 x)
          x\_s = (copysign.f64 #s(literal 1 binary64) x)
          (FPCore (x_s x_m y z t)
           :precision binary64
           (*
            x_s
            (if (<= z -5.8e-17)
              (* x_m (- 1.0 (/ (- y t) z)))
              (if (<= z 6.8e+54) (/ (* y x_m) (- t z)) (fma (- y) (/ x_m z) x_m)))))
          x\_m = fabs(x);
          x\_s = copysign(1.0, x);
          double code(double x_s, double x_m, double y, double z, double t) {
          	double tmp;
          	if (z <= -5.8e-17) {
          		tmp = x_m * (1.0 - ((y - t) / z));
          	} else if (z <= 6.8e+54) {
          		tmp = (y * x_m) / (t - z);
          	} else {
          		tmp = fma(-y, (x_m / z), x_m);
          	}
          	return x_s * tmp;
          }
          
          x\_m = abs(x)
          x\_s = copysign(1.0, x)
          function code(x_s, x_m, y, z, t)
          	tmp = 0.0
          	if (z <= -5.8e-17)
          		tmp = Float64(x_m * Float64(1.0 - Float64(Float64(y - t) / z)));
          	elseif (z <= 6.8e+54)
          		tmp = Float64(Float64(y * x_m) / Float64(t - z));
          	else
          		tmp = fma(Float64(-y), Float64(x_m / z), x_m);
          	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, -5.8e-17], N[(x$95$m * N[(1.0 - N[(N[(y - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+54], N[(N[(y * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[((-y) * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
          
          \begin{array}{l}
          x\_m = \left|x\right|
          \\
          x\_s = \mathsf{copysign}\left(1, x\right)
          
          \\
          x\_s \cdot \begin{array}{l}
          \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\
          \;\;\;\;x\_m \cdot \left(1 - \frac{y - t}{z}\right)\\
          
          \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\
          \;\;\;\;\frac{y \cdot x\_m}{t - z}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if z < -5.8000000000000006e-17

            1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(y - z\right) \cdot x}{\color{blue}{\frac{t \cdot t - z \cdot z}{t + z}}} \]
              8. difference-of-squares-revN/A

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

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

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

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

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

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

                \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\left(t + z\right)} \]
              15. flip-+N/A

                \[\leadsto \frac{\left(y - z\right) \cdot x}{\left(t + z\right) \cdot \left(t - z\right)} \cdot \color{blue}{\frac{t \cdot t - z \cdot z}{t - z}} \]
              16. difference-of-squares-revN/A

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

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

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

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

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

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

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

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

              \[\leadsto x \cdot \color{blue}{\left(\left(1 + -1 \cdot \frac{y}{z}\right) - -1 \cdot \frac{t}{z}\right)} \]
            8. Step-by-step derivation
              1. fp-cancel-sub-sign-invN/A

                \[\leadsto x \cdot \color{blue}{\left(\left(1 + -1 \cdot \frac{y}{z}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{t}{z}\right)} \]
              2. fp-cancel-sign-sub-invN/A

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

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

                \[\leadsto x \cdot \left(\left(1 - \color{blue}{\frac{y}{z}}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \frac{t}{z}\right) \]
              5. metadata-evalN/A

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

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

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

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

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

                \[\leadsto x \cdot \left(1 - \color{blue}{\frac{y - t}{z}}\right) \]
              11. lower--.f6480.7

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

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

            if -5.8000000000000006e-17 < z < 6.8000000000000001e54

            1. Initial program 94.8%

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

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

                \[\leadsto \frac{\color{blue}{y \cdot x}}{t - z} \]
              2. lower-*.f6482.0

                \[\leadsto \frac{\color{blue}{y \cdot x}}{t - z} \]
            5. Applied rewrites82.0%

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

            if 6.8000000000000001e54 < z

            1. Initial program 74.6%

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
            5. 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}} \]
            6. Step-by-step derivation
              1. associate--l+N/A

                \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
              2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
            7. Applied rewrites85.2%

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

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

                \[\leadsto \mathsf{fma}\left(-y, \frac{\color{blue}{x}}{z}, x\right) \]
            10. Recombined 3 regimes into one program.
            11. Final simplification82.4%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\ \;\;\;\;x \cdot \left(1 - \frac{y - t}{z}\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{y \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x}{z}, x\right)\\ \end{array} \]
            12. Add Preprocessing

            Alternative 8: 74.9% accurate, 0.7× speedup?

            \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{y \cdot x\_m}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\ \end{array} \end{array} \]
            x\_m = (fabs.f64 x)
            x\_s = (copysign.f64 #s(literal 1 binary64) x)
            (FPCore (x_s x_m y z t)
             :precision binary64
             (*
              x_s
              (if (<= z -5.8e-17)
                (fma (- x_m) (/ y z) x_m)
                (if (<= z 6.8e+54) (/ (* y x_m) (- t z)) (fma (- y) (/ x_m z) x_m)))))
            x\_m = fabs(x);
            x\_s = copysign(1.0, x);
            double code(double x_s, double x_m, double y, double z, double t) {
            	double tmp;
            	if (z <= -5.8e-17) {
            		tmp = fma(-x_m, (y / z), x_m);
            	} else if (z <= 6.8e+54) {
            		tmp = (y * x_m) / (t - z);
            	} else {
            		tmp = fma(-y, (x_m / z), x_m);
            	}
            	return x_s * tmp;
            }
            
            x\_m = abs(x)
            x\_s = copysign(1.0, x)
            function code(x_s, x_m, y, z, t)
            	tmp = 0.0
            	if (z <= -5.8e-17)
            		tmp = fma(Float64(-x_m), Float64(y / z), x_m);
            	elseif (z <= 6.8e+54)
            		tmp = Float64(Float64(y * x_m) / Float64(t - z));
            	else
            		tmp = fma(Float64(-y), Float64(x_m / z), x_m);
            	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, -5.8e-17], N[((-x$95$m) * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 6.8e+54], N[(N[(y * x$95$m), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[((-y) * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
            
            \begin{array}{l}
            x\_m = \left|x\right|
            \\
            x\_s = \mathsf{copysign}\left(1, x\right)
            
            \\
            x\_s \cdot \begin{array}{l}
            \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\
            \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\
            
            \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\
            \;\;\;\;\frac{y \cdot x\_m}{t - z}\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if z < -5.8000000000000006e-17

              1. Initial program 79.9%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
              5. 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}} \]
              6. Step-by-step derivation
                1. associate--l+N/A

                  \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
                2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
              7. Applied rewrites71.5%

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

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

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

                if -5.8000000000000006e-17 < z < 6.8000000000000001e54

                1. Initial program 94.8%

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

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

                    \[\leadsto \frac{\color{blue}{y \cdot x}}{t - z} \]
                  2. lower-*.f6482.0

                    \[\leadsto \frac{\color{blue}{y \cdot x}}{t - z} \]
                5. Applied rewrites82.0%

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

                if 6.8000000000000001e54 < z

                1. Initial program 74.6%

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
                5. 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}} \]
                6. Step-by-step derivation
                  1. associate--l+N/A

                    \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
                  2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
                7. Applied rewrites85.2%

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

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

                    \[\leadsto \mathsf{fma}\left(-y, \frac{\color{blue}{x}}{z}, x\right) \]
                10. Recombined 3 regimes into one program.
                11. Final simplification82.3%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, x\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{+54}:\\ \;\;\;\;\frac{y \cdot x}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x}{z}, x\right)\\ \end{array} \]
                12. Add Preprocessing

                Alternative 9: 73.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 -5.2 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\ \end{array} \end{array} \]
                x\_m = (fabs.f64 x)
                x\_s = (copysign.f64 #s(literal 1 binary64) x)
                (FPCore (x_s x_m y z t)
                 :precision binary64
                 (*
                  x_s
                  (if (<= z -5.2e-17)
                    (fma (- x_m) (/ y z) x_m)
                    (if (<= z 6.2e+54) (/ (* (- y z) x_m) t) (fma (- y) (/ x_m z) x_m)))))
                x\_m = fabs(x);
                x\_s = copysign(1.0, x);
                double code(double x_s, double x_m, double y, double z, double t) {
                	double tmp;
                	if (z <= -5.2e-17) {
                		tmp = fma(-x_m, (y / z), x_m);
                	} else if (z <= 6.2e+54) {
                		tmp = ((y - z) * x_m) / t;
                	} else {
                		tmp = fma(-y, (x_m / z), x_m);
                	}
                	return x_s * tmp;
                }
                
                x\_m = abs(x)
                x\_s = copysign(1.0, x)
                function code(x_s, x_m, y, z, t)
                	tmp = 0.0
                	if (z <= -5.2e-17)
                		tmp = fma(Float64(-x_m), Float64(y / z), x_m);
                	elseif (z <= 6.2e+54)
                		tmp = Float64(Float64(Float64(y - z) * x_m) / t);
                	else
                		tmp = fma(Float64(-y), Float64(x_m / z), x_m);
                	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, -5.2e-17], N[((-x$95$m) * N[(y / z), $MachinePrecision] + x$95$m), $MachinePrecision], If[LessEqual[z, 6.2e+54], N[(N[(N[(y - z), $MachinePrecision] * x$95$m), $MachinePrecision] / t), $MachinePrecision], N[((-y) * N[(x$95$m / z), $MachinePrecision] + x$95$m), $MachinePrecision]]]), $MachinePrecision]
                
                \begin{array}{l}
                x\_m = \left|x\right|
                \\
                x\_s = \mathsf{copysign}\left(1, x\right)
                
                \\
                x\_s \cdot \begin{array}{l}
                \mathbf{if}\;z \leq -5.2 \cdot 10^{-17}:\\
                \;\;\;\;\mathsf{fma}\left(-x\_m, \frac{y}{z}, x\_m\right)\\
                
                \mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\
                \;\;\;\;\frac{\left(y - z\right) \cdot x\_m}{t}\\
                
                \mathbf{else}:\\
                \;\;\;\;\mathsf{fma}\left(-y, \frac{x\_m}{z}, x\_m\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if z < -5.20000000000000006e-17

                  1. Initial program 79.9%

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
                  5. 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}} \]
                  6. Step-by-step derivation
                    1. associate--l+N/A

                      \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
                    2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
                  7. Applied rewrites71.5%

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

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

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

                    if -5.20000000000000006e-17 < z < 6.1999999999999999e54

                    1. Initial program 94.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 6.1999999999999999e54 < z

                    1. Initial program 74.6%

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
                    5. 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}} \]
                    6. Step-by-step derivation
                      1. associate--l+N/A

                        \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
                      2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
                    7. Applied rewrites85.2%

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

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

                        \[\leadsto \mathsf{fma}\left(-y, \frac{\color{blue}{x}}{z}, x\right) \]
                    10. Recombined 3 regimes into one program.
                    11. Final simplification78.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{-17}:\\ \;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, x\right)\\ \mathbf{elif}\;z \leq 6.2 \cdot 10^{+54}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot x}{t}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, \frac{x}{z}, x\right)\\ \end{array} \]
                    12. Add Preprocessing

                    Alternative 10: 61.6% accurate, 0.8× speedup?

                    \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \begin{array}{l} \mathbf{if}\;z \leq -750 \lor \neg \left(z \leq 1.42 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{x\_m}{z}, t, x\_m\right)\\ \mathbf{else}:\\ \;\;\;\;x\_m \cdot \frac{y}{t}\\ \end{array} \end{array} \]
                    x\_m = (fabs.f64 x)
                    x\_s = (copysign.f64 #s(literal 1 binary64) x)
                    (FPCore (x_s x_m y z t)
                     :precision binary64
                     (*
                      x_s
                      (if (or (<= z -750.0) (not (<= z 1.42e+54)))
                        (fma (/ x_m z) t x_m)
                        (* x_m (/ y t)))))
                    x\_m = fabs(x);
                    x\_s = copysign(1.0, x);
                    double code(double x_s, double x_m, double y, double z, double t) {
                    	double tmp;
                    	if ((z <= -750.0) || !(z <= 1.42e+54)) {
                    		tmp = fma((x_m / z), t, x_m);
                    	} else {
                    		tmp = x_m * (y / t);
                    	}
                    	return x_s * tmp;
                    }
                    
                    x\_m = abs(x)
                    x\_s = copysign(1.0, x)
                    function code(x_s, x_m, y, z, t)
                    	tmp = 0.0
                    	if ((z <= -750.0) || !(z <= 1.42e+54))
                    		tmp = fma(Float64(x_m / z), t, x_m);
                    	else
                    		tmp = Float64(x_m * Float64(y / t));
                    	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[Or[LessEqual[z, -750.0], N[Not[LessEqual[z, 1.42e+54]], $MachinePrecision]], N[(N[(x$95$m / z), $MachinePrecision] * t + x$95$m), $MachinePrecision], N[(x$95$m * N[(y / t), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    x\_m = \left|x\right|
                    \\
                    x\_s = \mathsf{copysign}\left(1, x\right)
                    
                    \\
                    x\_s \cdot \begin{array}{l}
                    \mathbf{if}\;z \leq -750 \lor \neg \left(z \leq 1.42 \cdot 10^{+54}\right):\\
                    \;\;\;\;\mathsf{fma}\left(\frac{x\_m}{z}, t, x\_m\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x\_m \cdot \frac{y}{t}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if z < -750 or 1.41999999999999995e54 < z

                      1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{z}{t - z} \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                        10. lower-neg.f6470.6

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

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

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

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

                        if -750 < z < 1.41999999999999995e54

                        1. Initial program 94.8%

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

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

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

                            \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                          3. lower-*.f6464.4

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

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

                            \[\leadsto x \cdot \color{blue}{\frac{y}{t}} \]
                        7. Recombined 2 regimes into one program.
                        8. Final simplification63.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -750 \lor \neg \left(z \leq 1.42 \cdot 10^{+54}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{x}{z}, t, x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{y}{t}\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 11: 39.1% accurate, 1.4× speedup?

                        \[\begin{array}{l} x\_m = \left|x\right| \\ x\_s = \mathsf{copysign}\left(1, x\right) \\ x\_s \cdot \left(x\_m \cdot \frac{y}{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 (/ y 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 * (y / 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 * (y / 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 * (y / 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 * (y / 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(y / 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 * (y / 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[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        x\_m = \left|x\right|
                        \\
                        x\_s = \mathsf{copysign}\left(1, x\right)
                        
                        \\
                        x\_s \cdot \left(x\_m \cdot \frac{y}{t}\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 87.1%

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

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

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

                            \[\leadsto \frac{\color{blue}{y \cdot x}}{t} \]
                          3. lower-*.f6441.4

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

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

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

                          Alternative 12: 6.4% accurate, 1.4× speedup?

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

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

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

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

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

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

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

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

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

                            \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \left(y - z\right)} \]
                          5. 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}} \]
                          6. Step-by-step derivation
                            1. associate--l+N/A

                              \[\leadsto \color{blue}{x + \left(-1 \cdot \frac{x \cdot y}{z} - -1 \cdot \frac{t \cdot x}{z}\right)} \]
                            2. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(t + -1 \cdot y, \frac{x}{z}, x\right)} \]
                          7. Applied rewrites51.3%

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

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

                              \[\leadsto \frac{x}{z} \cdot \color{blue}{t} \]
                            2. Final simplification6.0%

                              \[\leadsto \frac{x}{z} \cdot t \]
                            3. Add Preprocessing

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

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

                            Reproduce

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