Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B

Percentage Accurate: 95.9% → 99.8%
Time: 3.5s
Alternatives: 8
Speedup: 0.4×

Specification

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

\\
\frac{x}{y - z \cdot t}
\end{array}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 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: 95.9% accurate, 1.0× speedup?

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

\\
\frac{x}{y - z \cdot t}
\end{array}

Alternative 1: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{\frac{y}{z} - t}}{z}\\ \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 10^{+165}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ (/ x (- (/ y z) t)) z)))
   (if (<= (* z t) (- INFINITY))
     t_1
     (if (<= (* z t) 1e+165) (/ x (fma (- z) t y)) t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / ((y / z) - t)) / z;
	double tmp;
	if ((z * t) <= -((double) INFINITY)) {
		tmp = t_1;
	} else if ((z * t) <= 1e+165) {
		tmp = x / fma(-z, t, y);
	} else {
		tmp = t_1;
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(Float64(y / z) - t)) / z)
	tmp = 0.0
	if (Float64(z * t) <= Float64(-Inf))
		tmp = t_1;
	elseif (Float64(z * t) <= 1e+165)
		tmp = Float64(x / fma(Float64(-z), t, y));
	else
		tmp = t_1;
	end
	return tmp
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+165], N[(x / N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{\frac{y}{z} - t}}{z}\\
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 10^{+165}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -inf.0 or 9.99999999999999899e164 < (*.f64 z t)

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
      5. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
      6. rem-exp-logN/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
      9. rem-exp-logN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
      10. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
      11. rem-exp-logN/A

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

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
      13. lower-neg.f6495.9

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
    3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x \cdot \left(\color{blue}{{y}^{-1}} \cdot y\right)}{\mathsf{neg}\left(\left(-z\right)\right)}}{\mathsf{neg}\left(\left(t + \frac{y}{-z}\right)\right)} \]
      14. pow-plusN/A

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(z\right)\right)}\right)}}{\mathsf{neg}\left(\left(t + \frac{y}{-z}\right)\right)} \]
      21. remove-double-negN/A

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

        \[\leadsto \frac{\frac{x}{z}}{\mathsf{neg}\left(\color{blue}{\left(t + \frac{y}{-z}\right)}\right)} \]
    6. Applied rewrites84.5%

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

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{\frac{y}{z} - t}} \]
      3. metadata-evalN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{1}{\color{blue}{\frac{y}{z} - t}}}{z} \]
      18. mult-flip-revN/A

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{z} - t}}}{z} \]
      19. lower-/.f6484.7

        \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y}{z} - t}}}{z} \]
    8. Applied rewrites84.7%

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

    if -inf.0 < (*.f64 z t) < 9.99999999999999899e164

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
      5. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
      6. rem-exp-logN/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
      9. rem-exp-logN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
      10. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
      11. rem-exp-logN/A

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

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
      13. lower-neg.f6495.9

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
    3. Applied rewrites95.9%

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

Alternative 2: 99.8% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -\infty:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-1}{t}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{-1}{z}}{t}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= (* z t) (- INFINITY))
   (* (/ x z) (/ -1.0 t))
   (if (<= (* z t) 5e+293) (/ x (fma (- z) t y)) (/ (* x (/ -1.0 z)) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -((double) INFINITY)) {
		tmp = (x / z) * (-1.0 / t);
	} else if ((z * t) <= 5e+293) {
		tmp = x / fma(-z, t, y);
	} else {
		tmp = (x * (-1.0 / z)) / t;
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * t) <= Float64(-Inf))
		tmp = Float64(Float64(x / z) * Float64(-1.0 / t));
	elseif (Float64(z * t) <= 5e+293)
		tmp = Float64(x / fma(Float64(-z), t, y));
	else
		tmp = Float64(Float64(x * Float64(-1.0 / z)) / t);
	end
	return tmp
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+293], N[(x / N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{t}\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -inf.0

    1. Initial program 95.9%

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

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

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

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

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
      5. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
      6. rem-exp-logN/A

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

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

        \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
      9. rem-exp-logN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
      10. exp-fabsN/A

        \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
      11. rem-exp-logN/A

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

        \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
      13. lower-neg.f6495.9

        \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
    3. Applied rewrites95.9%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x}{y} \cdot \frac{y}{-z}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(t\right)}} \]
      3. Applied rewrites52.1%

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

      if -inf.0 < (*.f64 z t) < 5.00000000000000033e293

      1. Initial program 95.9%

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

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

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

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

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
        5. exp-fabsN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
        6. rem-exp-logN/A

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
        9. rem-exp-logN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
        10. exp-fabsN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
        11. rem-exp-logN/A

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

          \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
        13. lower-neg.f6495.9

          \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
      3. Applied rewrites95.9%

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

      if 5.00000000000000033e293 < (*.f64 z t)

      1. Initial program 95.9%

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

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

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

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

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
        5. exp-fabsN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
        6. rem-exp-logN/A

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

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

          \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
        9. rem-exp-logN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
        10. exp-fabsN/A

          \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
        11. rem-exp-logN/A

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

          \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
        13. lower-neg.f6495.9

          \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
      3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{x \cdot \frac{1}{-z}}}{t} \]
          22. metadata-evalN/A

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

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

            \[\leadsto \frac{x \cdot \color{blue}{\frac{-1}{z}}}{t} \]
          25. lower-/.f6452.1

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

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

      Alternative 3: 99.8% accurate, 0.3× speedup?

      \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := y - z \cdot t\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\frac{\frac{-x}{z}}{t}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{-1}{t}\\ \end{array} \end{array} \]
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (- y (* z t))))
         (if (<= t_1 (- INFINITY))
           (/ (/ (- x) z) t)
           (if (<= t_1 2e+307) (/ x (fma (- z) t y)) (* (/ x z) (/ -1.0 t))))))
      assert(x < y && y < z && z < t);
      double code(double x, double y, double z, double t) {
      	double t_1 = y - (z * t);
      	double tmp;
      	if (t_1 <= -((double) INFINITY)) {
      		tmp = (-x / z) / t;
      	} else if (t_1 <= 2e+307) {
      		tmp = x / fma(-z, t, y);
      	} else {
      		tmp = (x / z) * (-1.0 / t);
      	}
      	return tmp;
      }
      
      x, y, z, t = sort([x, y, z, t])
      function code(x, y, z, t)
      	t_1 = Float64(y - Float64(z * t))
      	tmp = 0.0
      	if (t_1 <= Float64(-Inf))
      		tmp = Float64(Float64(Float64(-x) / z) / t);
      	elseif (t_1 <= 2e+307)
      		tmp = Float64(x / fma(Float64(-z), t, y));
      	else
      		tmp = Float64(Float64(x / z) * Float64(-1.0 / t));
      	end
      	return tmp
      end
      
      NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t$95$1, 2e+307], N[(x / N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
      \\
      \begin{array}{l}
      t_1 := y - z \cdot t\\
      \mathbf{if}\;t\_1 \leq -\infty:\\
      \;\;\;\;\frac{\frac{-x}{z}}{t}\\
      
      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\
      \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{z} \cdot \frac{-1}{t}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (-.f64 y (*.f64 z t)) < -inf.0

        1. Initial program 95.9%

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

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

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

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

            \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
          5. exp-fabsN/A

            \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
          6. rem-exp-logN/A

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

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

            \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
          9. rem-exp-logN/A

            \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
          10. exp-fabsN/A

            \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
          11. rem-exp-logN/A

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

            \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
          13. lower-neg.f6495.9

            \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
        3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\frac{x}{z}}\right)}{t} \]
            17. distribute-neg-fracN/A

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

              \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t} \]
            19. lower-neg.f6452.2

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

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

          if -inf.0 < (-.f64 y (*.f64 z t)) < 1.99999999999999997e307

          1. Initial program 95.9%

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

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

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

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

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
            5. exp-fabsN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
            6. rem-exp-logN/A

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

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

              \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
            9. rem-exp-logN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
            10. exp-fabsN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
            11. rem-exp-logN/A

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

              \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
            13. lower-neg.f6495.9

              \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
          3. Applied rewrites95.9%

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

          if 1.99999999999999997e307 < (-.f64 y (*.f64 z t))

          1. Initial program 95.9%

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

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

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

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

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
            5. exp-fabsN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
            6. rem-exp-logN/A

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

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

              \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
            9. rem-exp-logN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
            10. exp-fabsN/A

              \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
            11. rem-exp-logN/A

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

              \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
            13. lower-neg.f6495.9

              \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
          3. Applied rewrites95.9%

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{x}{y} \cdot \frac{y}{-z}\right)\right) \cdot \frac{1}{\mathsf{neg}\left(t\right)}} \]
            3. Applied rewrites52.1%

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

          Alternative 4: 99.8% accurate, 0.3× speedup?

          \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := y - z \cdot t\\ t_2 := \frac{\frac{-x}{z}}{t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
          NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (- y (* z t))) (t_2 (/ (/ (- x) z) t)))
             (if (<= t_1 (- INFINITY))
               t_2
               (if (<= t_1 2e+307) (/ x (fma (- z) t y)) t_2))))
          assert(x < y && y < z && z < t);
          double code(double x, double y, double z, double t) {
          	double t_1 = y - (z * t);
          	double t_2 = (-x / z) / t;
          	double tmp;
          	if (t_1 <= -((double) INFINITY)) {
          		tmp = t_2;
          	} else if (t_1 <= 2e+307) {
          		tmp = x / fma(-z, t, y);
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          x, y, z, t = sort([x, y, z, t])
          function code(x, y, z, t)
          	t_1 = Float64(y - Float64(z * t))
          	t_2 = Float64(Float64(Float64(-x) / z) / t)
          	tmp = 0.0
          	if (t_1 <= Float64(-Inf))
          		tmp = t_2;
          	elseif (t_1 <= 2e+307)
          		tmp = Float64(x / fma(Float64(-z), t, y));
          	else
          		tmp = t_2;
          	end
          	return tmp
          end
          
          NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2e+307], N[(x / N[((-z) * t + y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
          
          \begin{array}{l}
          [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
          \\
          \begin{array}{l}
          t_1 := y - z \cdot t\\
          t_2 := \frac{\frac{-x}{z}}{t}\\
          \mathbf{if}\;t\_1 \leq -\infty:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\
          \;\;\;\;\frac{x}{\mathsf{fma}\left(-z, t, y\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_2\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (-.f64 y (*.f64 z t)) < -inf.0 or 1.99999999999999997e307 < (-.f64 y (*.f64 z t))

            1. Initial program 95.9%

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

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

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

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

                \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
              5. exp-fabsN/A

                \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
              6. rem-exp-logN/A

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

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

                \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
              9. rem-exp-logN/A

                \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
              10. exp-fabsN/A

                \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
              11. rem-exp-logN/A

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

                \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
              13. lower-neg.f6495.9

                \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
            3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\frac{x}{z}}\right)}{t} \]
                17. distribute-neg-fracN/A

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

                  \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t} \]
                19. lower-neg.f6452.2

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

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

              if -inf.0 < (-.f64 y (*.f64 z t)) < 1.99999999999999997e307

              1. Initial program 95.9%

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

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

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

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

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
                5. exp-fabsN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
                6. rem-exp-logN/A

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

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

                  \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
                9. rem-exp-logN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
                10. exp-fabsN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
                11. rem-exp-logN/A

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

                  \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
                13. lower-neg.f6495.9

                  \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
              3. Applied rewrites95.9%

                \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(-z, t, y\right)}} \]
            7. Recombined 2 regimes into one program.
            8. Add Preprocessing

            Alternative 5: 99.6% accurate, 0.3× speedup?

            \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := y - z \cdot t\\ t_2 := \frac{\frac{-x}{z}}{t}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\ \;\;\;\;\frac{x}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            (FPCore (x y z t)
             :precision binary64
             (let* ((t_1 (- y (* z t))) (t_2 (/ (/ (- x) z) t)))
               (if (<= t_1 (- INFINITY)) t_2 (if (<= t_1 2e+307) (/ x t_1) t_2))))
            assert(x < y && y < z && z < t);
            double code(double x, double y, double z, double t) {
            	double t_1 = y - (z * t);
            	double t_2 = (-x / z) / t;
            	double tmp;
            	if (t_1 <= -((double) INFINITY)) {
            		tmp = t_2;
            	} else if (t_1 <= 2e+307) {
            		tmp = x / t_1;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            assert x < y && y < z && z < t;
            public static double code(double x, double y, double z, double t) {
            	double t_1 = y - (z * t);
            	double t_2 = (-x / z) / t;
            	double tmp;
            	if (t_1 <= -Double.POSITIVE_INFINITY) {
            		tmp = t_2;
            	} else if (t_1 <= 2e+307) {
            		tmp = x / t_1;
            	} else {
            		tmp = t_2;
            	}
            	return tmp;
            }
            
            [x, y, z, t] = sort([x, y, z, t])
            def code(x, y, z, t):
            	t_1 = y - (z * t)
            	t_2 = (-x / z) / t
            	tmp = 0
            	if t_1 <= -math.inf:
            		tmp = t_2
            	elif t_1 <= 2e+307:
            		tmp = x / t_1
            	else:
            		tmp = t_2
            	return tmp
            
            x, y, z, t = sort([x, y, z, t])
            function code(x, y, z, t)
            	t_1 = Float64(y - Float64(z * t))
            	t_2 = Float64(Float64(Float64(-x) / z) / t)
            	tmp = 0.0
            	if (t_1 <= Float64(-Inf))
            		tmp = t_2;
            	elseif (t_1 <= 2e+307)
            		tmp = Float64(x / t_1);
            	else
            		tmp = t_2;
            	end
            	return tmp
            end
            
            x, y, z, t = num2cell(sort([x, y, z, t])){:}
            function tmp_2 = code(x, y, z, t)
            	t_1 = y - (z * t);
            	t_2 = (-x / z) / t;
            	tmp = 0.0;
            	if (t_1 <= -Inf)
            		tmp = t_2;
            	elseif (t_1 <= 2e+307)
            		tmp = x / t_1;
            	else
            		tmp = t_2;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
            code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2e+307], N[(x / t$95$1), $MachinePrecision], t$95$2]]]]
            
            \begin{array}{l}
            [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
            \\
            \begin{array}{l}
            t_1 := y - z \cdot t\\
            t_2 := \frac{\frac{-x}{z}}{t}\\
            \mathbf{if}\;t\_1 \leq -\infty:\\
            \;\;\;\;t\_2\\
            
            \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\
            \;\;\;\;\frac{x}{t\_1}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_2\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (-.f64 y (*.f64 z t)) < -inf.0 or 1.99999999999999997e307 < (-.f64 y (*.f64 z t))

              1. Initial program 95.9%

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

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

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

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

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
                5. exp-fabsN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
                6. rem-exp-logN/A

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

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

                  \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
                9. rem-exp-logN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
                10. exp-fabsN/A

                  \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
                11. rem-exp-logN/A

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

                  \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
                13. lower-neg.f6495.9

                  \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
              3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\frac{x}{z}}\right)}{t} \]
                  17. distribute-neg-fracN/A

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

                    \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t} \]
                  19. lower-neg.f6452.2

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

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

                if -inf.0 < (-.f64 y (*.f64 z t)) < 1.99999999999999997e307

                1. Initial program 95.9%

                  \[\frac{x}{y - z \cdot t} \]
              7. Recombined 2 regimes into one program.
              8. Add Preprocessing

              Alternative 6: 78.4% accurate, 0.4× speedup?

              \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{-x}{z}}{t}\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-53}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+63}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
              (FPCore (x y z t)
               :precision binary64
               (let* ((t_1 (/ (/ (- x) z) t)))
                 (if (<= (* z t) -1e-53) t_1 (if (<= (* z t) 2e+63) (/ x y) t_1))))
              assert(x < y && y < z && z < t);
              double code(double x, double y, double z, double t) {
              	double t_1 = (-x / z) / t;
              	double tmp;
              	if ((z * t) <= -1e-53) {
              		tmp = t_1;
              	} else if ((z * t) <= 2e+63) {
              		tmp = x / y;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y, z, t)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: t
                  real(8) :: t_1
                  real(8) :: tmp
                  t_1 = (-x / z) / t
                  if ((z * t) <= (-1d-53)) then
                      tmp = t_1
                  else if ((z * t) <= 2d+63) then
                      tmp = x / y
                  else
                      tmp = t_1
                  end if
                  code = tmp
              end function
              
              assert x < y && y < z && z < t;
              public static double code(double x, double y, double z, double t) {
              	double t_1 = (-x / z) / t;
              	double tmp;
              	if ((z * t) <= -1e-53) {
              		tmp = t_1;
              	} else if ((z * t) <= 2e+63) {
              		tmp = x / y;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              [x, y, z, t] = sort([x, y, z, t])
              def code(x, y, z, t):
              	t_1 = (-x / z) / t
              	tmp = 0
              	if (z * t) <= -1e-53:
              		tmp = t_1
              	elif (z * t) <= 2e+63:
              		tmp = x / y
              	else:
              		tmp = t_1
              	return tmp
              
              x, y, z, t = sort([x, y, z, t])
              function code(x, y, z, t)
              	t_1 = Float64(Float64(Float64(-x) / z) / t)
              	tmp = 0.0
              	if (Float64(z * t) <= -1e-53)
              		tmp = t_1;
              	elseif (Float64(z * t) <= 2e+63)
              		tmp = Float64(x / y);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              x, y, z, t = num2cell(sort([x, y, z, t])){:}
              function tmp_2 = code(x, y, z, t)
              	t_1 = (-x / z) / t;
              	tmp = 0.0;
              	if ((z * t) <= -1e-53)
              		tmp = t_1;
              	elseif ((z * t) <= 2e+63)
              		tmp = x / y;
              	else
              		tmp = t_1;
              	end
              	tmp_2 = tmp;
              end
              
              NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e-53], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+63], N[(x / y), $MachinePrecision], t$95$1]]]
              
              \begin{array}{l}
              [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
              \\
              \begin{array}{l}
              t_1 := \frac{\frac{-x}{z}}{t}\\
              \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-53}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+63}:\\
              \;\;\;\;\frac{x}{y}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 z t) < -1.00000000000000003e-53 or 2.00000000000000012e63 < (*.f64 z t)

                1. Initial program 95.9%

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

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

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

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

                    \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
                  5. exp-fabsN/A

                    \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
                  6. rem-exp-logN/A

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

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

                    \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
                  9. rem-exp-logN/A

                    \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
                  10. exp-fabsN/A

                    \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
                  11. rem-exp-logN/A

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

                    \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
                  13. lower-neg.f6495.9

                    \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
                3. Applied rewrites95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\frac{x}{z}}\right)}{t} \]
                    17. distribute-neg-fracN/A

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

                      \[\leadsto \frac{\color{blue}{\frac{\mathsf{neg}\left(x\right)}{z}}}{t} \]
                    19. lower-neg.f6452.2

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

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

                  if -1.00000000000000003e-53 < (*.f64 z t) < 2.00000000000000012e63

                  1. Initial program 95.9%

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

                    \[\leadsto \color{blue}{\frac{x}{y}} \]
                  3. Step-by-step derivation
                    1. lower-/.f6453.9

                      \[\leadsto \frac{x}{\color{blue}{y}} \]
                  4. Applied rewrites53.9%

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

                Alternative 7: 62.9% accurate, 0.5× speedup?

                \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{t \cdot z}\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+215}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+104}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                (FPCore (x y z t)
                 :precision binary64
                 (let* ((t_1 (/ x (* t z))))
                   (if (<= (* z t) -5e+215) t_1 (if (<= (* z t) 2e+104) (/ x y) t_1))))
                assert(x < y && y < z && z < t);
                double code(double x, double y, double z, double t) {
                	double t_1 = x / (t * z);
                	double tmp;
                	if ((z * t) <= -5e+215) {
                		tmp = t_1;
                	} else if ((z * t) <= 2e+104) {
                		tmp = x / y;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8) :: t_1
                    real(8) :: tmp
                    t_1 = x / (t * z)
                    if ((z * t) <= (-5d+215)) then
                        tmp = t_1
                    else if ((z * t) <= 2d+104) then
                        tmp = x / y
                    else
                        tmp = t_1
                    end if
                    code = tmp
                end function
                
                assert x < y && y < z && z < t;
                public static double code(double x, double y, double z, double t) {
                	double t_1 = x / (t * z);
                	double tmp;
                	if ((z * t) <= -5e+215) {
                		tmp = t_1;
                	} else if ((z * t) <= 2e+104) {
                		tmp = x / y;
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                [x, y, z, t] = sort([x, y, z, t])
                def code(x, y, z, t):
                	t_1 = x / (t * z)
                	tmp = 0
                	if (z * t) <= -5e+215:
                		tmp = t_1
                	elif (z * t) <= 2e+104:
                		tmp = x / y
                	else:
                		tmp = t_1
                	return tmp
                
                x, y, z, t = sort([x, y, z, t])
                function code(x, y, z, t)
                	t_1 = Float64(x / Float64(t * z))
                	tmp = 0.0
                	if (Float64(z * t) <= -5e+215)
                		tmp = t_1;
                	elseif (Float64(z * t) <= 2e+104)
                		tmp = Float64(x / y);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                x, y, z, t = num2cell(sort([x, y, z, t])){:}
                function tmp_2 = code(x, y, z, t)
                	t_1 = x / (t * z);
                	tmp = 0.0;
                	if ((z * t) <= -5e+215)
                		tmp = t_1;
                	elseif ((z * t) <= 2e+104)
                		tmp = x / y;
                	else
                		tmp = t_1;
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e+215], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 2e+104], N[(x / y), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                \\
                \begin{array}{l}
                t_1 := \frac{x}{t \cdot z}\\
                \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+215}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+104}:\\
                \;\;\;\;\frac{x}{y}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 z t) < -5.0000000000000001e215 or 2e104 < (*.f64 z t)

                  1. Initial program 95.9%

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

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

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

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

                      \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{e^{\log y}}} \]
                    5. exp-fabsN/A

                      \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z \cdot t\right)\right) + \color{blue}{\left|e^{\log y}\right|}} \]
                    6. rem-exp-logN/A

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

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

                      \[\leadsto \frac{x}{\color{blue}{\left(\mathsf{neg}\left(z\right)\right) \cdot t} + \left|y\right|} \]
                    9. rem-exp-logN/A

                      \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \left|\color{blue}{e^{\log y}}\right|} \]
                    10. exp-fabsN/A

                      \[\leadsto \frac{x}{\left(\mathsf{neg}\left(z\right)\right) \cdot t + \color{blue}{e^{\log y}}} \]
                    11. rem-exp-logN/A

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

                      \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(z\right), t, y\right)}} \]
                    13. lower-neg.f6495.9

                      \[\leadsto \frac{x}{\mathsf{fma}\left(\color{blue}{-z}, t, y\right)} \]
                  3. Applied rewrites95.9%

                    \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(-z, t, y\right)}} \]
                  4. Applied rewrites64.8%

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

                    \[\leadsto \frac{x}{\color{blue}{t \cdot z}} \]
                  6. Step-by-step derivation
                    1. lower-*.f6421.0

                      \[\leadsto \frac{x}{t \cdot \color{blue}{z}} \]
                  7. Applied rewrites21.0%

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

                  if -5.0000000000000001e215 < (*.f64 z t) < 2e104

                  1. Initial program 95.9%

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

                    \[\leadsto \color{blue}{\frac{x}{y}} \]
                  3. Step-by-step derivation
                    1. lower-/.f6453.9

                      \[\leadsto \frac{x}{\color{blue}{y}} \]
                  4. Applied rewrites53.9%

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

                Alternative 8: 53.9% accurate, 2.3× speedup?

                \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{x}{y} \end{array} \]
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                (FPCore (x y z t) :precision binary64 (/ x y))
                assert(x < y && y < z && z < t);
                double code(double x, double y, double z, double t) {
                	return x / y;
                }
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                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
                end function
                
                assert x < y && y < z && z < t;
                public static double code(double x, double y, double z, double t) {
                	return x / y;
                }
                
                [x, y, z, t] = sort([x, y, z, t])
                def code(x, y, z, t):
                	return x / y
                
                x, y, z, t = sort([x, y, z, t])
                function code(x, y, z, t)
                	return Float64(x / y)
                end
                
                x, y, z, t = num2cell(sort([x, y, z, t])){:}
                function tmp = code(x, y, z, t)
                	tmp = x / y;
                end
                
                NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
                
                \begin{array}{l}
                [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
                \\
                \frac{x}{y}
                \end{array}
                
                Derivation
                1. Initial program 95.9%

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

                  \[\leadsto \color{blue}{\frac{x}{y}} \]
                3. Step-by-step derivation
                  1. lower-/.f6453.9

                    \[\leadsto \frac{x}{\color{blue}{y}} \]
                4. Applied rewrites53.9%

                  \[\leadsto \color{blue}{\frac{x}{y}} \]
                5. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2025150 
                (FPCore (x y z t)
                  :name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
                  :precision binary64
                  (/ x (- y (* z t))))