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

Percentage Accurate: 96.0% → 97.6%
Time: 3.3s
Alternatives: 9
Speedup: N/A×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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: 96.0% 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: 97.6% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+230}:\\ \;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{x}{-1 \cdot \mathsf{fma}\left(-1 \cdot t, z, y\right)}\\ \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) -5e+230)
   (/ (* (/ x t) -1.0) z)
   (* -1.0 (/ x (* -1.0 (fma (* -1.0 t) z y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -5e+230) {
		tmp = ((x / t) * -1.0) / z;
	} else {
		tmp = -1.0 * (x / (-1.0 * fma((-1.0 * t), z, y)));
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * t) <= -5e+230)
		tmp = Float64(Float64(Float64(x / t) * -1.0) / z);
	else
		tmp = Float64(-1.0 * Float64(x / Float64(-1.0 * fma(Float64(-1.0 * t), z, y))));
	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], -5e+230], N[(N[(N[(x / t), $MachinePrecision] * -1.0), $MachinePrecision] / z), $MachinePrecision], N[(-1.0 * N[(x / N[(-1.0 * N[(N[(-1.0 * t), $MachinePrecision] * z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+230}:\\
\;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\

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


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

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot x}{-\mathsf{fma}\left(\color{blue}{-1 \cdot t}, z, y\right)} \]
      18. lower-*.f6477.5

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e230 < (*.f64 z t)

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot x}{-\mathsf{fma}\left(\color{blue}{-1 \cdot t}, z, y\right)} \]
      18. lower-*.f6498.3

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

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

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

Alternative 2: 97.6% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+230}:\\ \;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y - z \cdot 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) -5e+230) (/ (* (/ x t) -1.0) z) (/ x (- y (* z t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -5e+230) {
		tmp = ((x / t) * -1.0) / z;
	} else {
		tmp = x / (y - (z * t));
	}
	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) :: tmp
    if ((z * t) <= (-5d+230)) then
        tmp = ((x / t) * (-1.0d0)) / z
    else
        tmp = x / (y - (z * t))
    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 tmp;
	if ((z * t) <= -5e+230) {
		tmp = ((x / t) * -1.0) / z;
	} else {
		tmp = x / (y - (z * t));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if (z * t) <= -5e+230:
		tmp = ((x / t) * -1.0) / z
	else:
		tmp = x / (y - (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) <= -5e+230)
		tmp = Float64(Float64(Float64(x / t) * -1.0) / z);
	else
		tmp = Float64(x / Float64(y - Float64(z * t)));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z * t) <= -5e+230)
		tmp = ((x / t) * -1.0) / z;
	else
		tmp = x / (y - (z * t));
	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_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+230], N[(N[(N[(x / t), $MachinePrecision] * -1.0), $MachinePrecision] / z), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+230}:\\
\;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\

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


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

    1. Initial program 77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot x}{-\mathsf{fma}\left(\color{blue}{-1 \cdot t}, z, y\right)} \]
      18. lower-*.f6477.5

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000003e230 < (*.f64 z t)

    1. Initial program 98.3%

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

Alternative 3: 74.6% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{t} \cdot -1}{z}\\ \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{-136}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \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) -1.0) z)))
   (if (<= (* z t) -2e-136)
     t_1
     (if (<= (* z t) 5e-46)
       (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ 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) * -1.0) / z;
	double tmp;
	if ((z * t) <= -2e-136) {
		tmp = t_1;
	} else if ((z * t) <= 5e-46) {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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) * (-1.0d0)) / z
    if ((z * t) <= (-2d-136)) then
        tmp = t_1
    else if ((z * t) <= 5d-46) then
        tmp = ((((z * x) * t) / y) / y) - ((-1.0d0) * (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) * -1.0) / z;
	double tmp;
	if ((z * t) <= -2e-136) {
		tmp = t_1;
	} else if ((z * t) <= 5e-46) {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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) * -1.0) / z
	tmp = 0
	if (z * t) <= -2e-136:
		tmp = t_1
	elif (z * t) <= 5e-46:
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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 / t) * -1.0) / z)
	tmp = 0.0
	if (Float64(z * t) <= -2e-136)
		tmp = t_1;
	elseif (Float64(z * t) <= 5e-46)
		tmp = Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * 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) * -1.0) / z;
	tmp = 0.0;
	if ((z * t) <= -2e-136)
		tmp = t_1;
	elseif ((z * t) <= 5e-46)
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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[(N[(x / t), $MachinePrecision] * -1.0), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e-136], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e-46], N[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $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}{t} \cdot -1}{z}\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{-136}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-46}:\\
\;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -2e-136 or 4.99999999999999992e-46 < (*.f64 z t)

    1. Initial program 94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot x}{-\mathsf{fma}\left(\color{blue}{-1 \cdot t}, z, y\right)} \]
      18. lower-*.f6494.6

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e-136 < (*.f64 z t) < 4.99999999999999992e-46

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
    5. Applied rewrites88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
      16. lower-/.f6488.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -2 \cdot 10^{-136}:\\ \;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t} \cdot -1}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.9% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{y \cdot \left(-1 \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right)\\ \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \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 (fma (/ -1.0 z) (/ x t) (/ (* y (* -1.0 x)) (pow (* t z) 2.0)))))
   (if (<= (* z t) -5e-34)
     t_1
     (if (<= (* z t) 5e+18)
       (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ x y)))
       t_1))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = fma((-1.0 / z), (x / t), ((y * (-1.0 * x)) / pow((t * z), 2.0)));
	double tmp;
	if ((z * t) <= -5e-34) {
		tmp = t_1;
	} else if ((z * t) <= 5e+18) {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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 = fma(Float64(-1.0 / z), Float64(x / t), Float64(Float64(y * Float64(-1.0 * x)) / (Float64(t * z) ^ 2.0)))
	tmp = 0.0
	if (Float64(z * t) <= -5e-34)
		tmp = t_1;
	elseif (Float64(z * t) <= 5e+18)
		tmp = Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * Float64(x / 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[(-1.0 / z), $MachinePrecision] * N[(x / t), $MachinePrecision] + N[(N[(y * N[(-1.0 * x), $MachinePrecision]), $MachinePrecision] / N[Power[N[(t * z), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -5e-34], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e+18], N[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{y \cdot \left(-1 \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right)\\
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -5.0000000000000003e-34 or 5e18 < (*.f64 z t)

    1. Initial program 92.7%

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

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

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

        \[\leadsto \frac{-1 \cdot x}{z \cdot t} + -1 \cdot \frac{x \cdot y}{{t}^{2} \cdot {z}^{2}} \]
      3. times-fracN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
      13. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
      14. lower-*.f6475.1

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
    5. Applied rewrites75.1%

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

    if -5.0000000000000003e-34 < (*.f64 z t) < 5e18

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
      16. lower-/.f6474.8

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

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.9%

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

Alternative 5: 71.2% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := {\left(\left(z \cdot t\right) \cdot -1\right)}^{2}\\ t_2 := \frac{x}{t} \cdot -1\\ \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+118}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\ \mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{-34}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot x\right) \cdot -1, z, t\_1 \cdot t\_2\right)}{t\_1 \cdot z}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot {\left(\frac{y}{z} \cdot -1\right)}^{2}\right) \cdot \left(-1 \cdot \frac{x}{\left(t \cdot t\right) \cdot t}\right), -1, t\_2\right) - \left(-1 \cdot \frac{y}{t \cdot t}\right) \cdot \left(-1 \cdot \frac{x}{z}\right)}{z}\\ \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 (pow (* (* z t) -1.0) 2.0)) (t_2 (* (/ x t) -1.0)))
   (if (<= (* z t) -1e+118)
     (/
      (-
       (fma
        (* (* -1.0 (/ x (* (* z z) z))) (* -1.0 (pow (* (/ y t) -1.0) 2.0)))
        -1.0
        (* (/ x z) -1.0))
       (* (* -1.0 (/ x (* z z))) (* -1.0 (/ y t))))
      t)
     (if (<= (* z t) -5e-34)
       (/ (fma (* (* y x) -1.0) z (* t_1 t_2)) (* t_1 z))
       (if (<= (* z t) 5e+18)
         (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ x y)))
         (/
          (-
           (fma
            (*
             (* -1.0 (pow (* (/ y z) -1.0) 2.0))
             (* -1.0 (/ x (* (* t t) t))))
            -1.0
            t_2)
           (* (* -1.0 (/ y (* t t))) (* -1.0 (/ x z))))
          z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = pow(((z * t) * -1.0), 2.0);
	double t_2 = (x / t) * -1.0;
	double tmp;
	if ((z * t) <= -1e+118) {
		tmp = (fma(((-1.0 * (x / ((z * z) * z))) * (-1.0 * pow(((y / t) * -1.0), 2.0))), -1.0, ((x / z) * -1.0)) - ((-1.0 * (x / (z * z))) * (-1.0 * (y / t)))) / t;
	} else if ((z * t) <= -5e-34) {
		tmp = fma(((y * x) * -1.0), z, (t_1 * t_2)) / (t_1 * z);
	} else if ((z * t) <= 5e+18) {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (x / y));
	} else {
		tmp = (fma(((-1.0 * pow(((y / z) * -1.0), 2.0)) * (-1.0 * (x / ((t * t) * t)))), -1.0, t_2) - ((-1.0 * (y / (t * t))) * (-1.0 * (x / z)))) / z;
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(z * t) * -1.0) ^ 2.0
	t_2 = Float64(Float64(x / t) * -1.0)
	tmp = 0.0
	if (Float64(z * t) <= -1e+118)
		tmp = Float64(Float64(fma(Float64(Float64(-1.0 * Float64(x / Float64(Float64(z * z) * z))) * Float64(-1.0 * (Float64(Float64(y / t) * -1.0) ^ 2.0))), -1.0, Float64(Float64(x / z) * -1.0)) - Float64(Float64(-1.0 * Float64(x / Float64(z * z))) * Float64(-1.0 * Float64(y / t)))) / t);
	elseif (Float64(z * t) <= -5e-34)
		tmp = Float64(fma(Float64(Float64(y * x) * -1.0), z, Float64(t_1 * t_2)) / Float64(t_1 * z));
	elseif (Float64(z * t) <= 5e+18)
		tmp = Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * Float64(x / y)));
	else
		tmp = Float64(Float64(fma(Float64(Float64(-1.0 * (Float64(Float64(y / z) * -1.0) ^ 2.0)) * Float64(-1.0 * Float64(x / Float64(Float64(t * t) * t)))), -1.0, t_2) - Float64(Float64(-1.0 * Float64(y / Float64(t * t))) * Float64(-1.0 * Float64(x / z)))) / z);
	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[Power[N[(N[(z * t), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] * -1.0), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -1e+118], N[(N[(N[(N[(N[(-1.0 * N[(x / N[(N[(z * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[Power[N[(N[(y / t), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(x / z), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], -5e-34], N[(N[(N[(N[(y * x), $MachinePrecision] * -1.0), $MachinePrecision] * z + N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+18], N[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-1.0 * N[Power[N[(N[(y / z), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(x / N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + t$95$2), $MachinePrecision] - N[(N[(-1.0 * N[(y / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := {\left(\left(z \cdot t\right) \cdot -1\right)}^{2}\\
t_2 := \frac{x}{t} \cdot -1\\
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\

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

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot {\left(\frac{y}{z} \cdot -1\right)}^{2}\right) \cdot \left(-1 \cdot \frac{x}{\left(t \cdot t\right) \cdot t}\right), -1, t\_2\right) - \left(-1 \cdot \frac{y}{t \cdot t}\right) \cdot \left(-1 \cdot \frac{x}{z}\right)}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 z t) < -9.99999999999999967e117

    1. Initial program 86.0%

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

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

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

    if -9.99999999999999967e117 < (*.f64 z t) < -5.0000000000000003e-34

    1. Initial program 99.7%

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

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

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

        \[\leadsto \frac{-1 \cdot x}{z \cdot t} + -1 \cdot \frac{x \cdot y}{{t}^{2} \cdot {z}^{2}} \]
      3. times-fracN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      8. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      9. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(x \cdot y\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{t}^{2} \cdot {z}^{2}}\right) \]
      12. pow-prod-downN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
      13. lower-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
      14. lower-*.f6462.7

        \[\leadsto \mathsf{fma}\left(\frac{-1}{z}, \frac{x}{t}, \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}}\right) \]
    5. Applied rewrites62.7%

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}} + \frac{-1}{z} \cdot \frac{x}{t} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{-1 \cdot \left(y \cdot x\right)}{{\left(t \cdot z\right)}^{2}} + \frac{-1}{\color{blue}{z}} \cdot \frac{x}{t} \]
      8. unpow-prod-downN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(x \cdot y\right)\right) \cdot z + \left({t}^{2} \cdot {z}^{2}\right) \cdot \left(-1 \cdot \frac{x}{t}\right)}{\color{blue}{\left({t}^{2} \cdot {z}^{2}\right) \cdot z}} \]
    7. Applied rewrites59.4%

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

    if -5.0000000000000003e-34 < (*.f64 z t) < 5e18

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
      16. lower-/.f6474.8

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

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

    if 5e18 < (*.f64 z t)

    1. Initial program 93.1%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(\frac{y}{z} \cdot -1\right)}^{2} \cdot \frac{x}{\left(t \cdot t\right) \cdot t}, -1, \frac{x}{t} \cdot -1\right) - \frac{y}{t \cdot t} \cdot \frac{x}{z}}{z}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+118}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\ \mathbf{elif}\;z \cdot t \leq -5 \cdot 10^{-34}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(y \cdot x\right) \cdot -1, z, {\left(\left(z \cdot t\right) \cdot -1\right)}^{2} \cdot \left(\frac{x}{t} \cdot -1\right)\right)}{{\left(\left(z \cdot t\right) \cdot -1\right)}^{2} \cdot z}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot {\left(\frac{y}{z} \cdot -1\right)}^{2}\right) \cdot \left(-1 \cdot \frac{x}{\left(t \cdot t\right) \cdot t}\right), -1, \frac{x}{t} \cdot -1\right) - \left(-1 \cdot \frac{y}{t \cdot t}\right) \cdot \left(-1 \cdot \frac{x}{z}\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.4% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+68}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot {\left(\frac{y}{z} \cdot -1\right)}^{2}\right) \cdot \left(-1 \cdot \frac{x}{\left(t \cdot t\right) \cdot t}\right), -1, \frac{x}{t} \cdot -1\right) - \left(-1 \cdot \frac{y}{t \cdot t}\right) \cdot \left(-1 \cdot \frac{x}{z}\right)}{z}\\ \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) -1e+68)
   (/
    (-
     (fma
      (* (* -1.0 (/ x (* (* z z) z))) (* -1.0 (pow (* (/ y t) -1.0) 2.0)))
      -1.0
      (* (/ x z) -1.0))
     (* (* -1.0 (/ x (* z z))) (* -1.0 (/ y t))))
    t)
   (if (<= (* z t) 5e+18)
     (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ x y)))
     (/
      (-
       (fma
        (* (* -1.0 (pow (* (/ y z) -1.0) 2.0)) (* -1.0 (/ x (* (* t t) t))))
        -1.0
        (* (/ x t) -1.0))
       (* (* -1.0 (/ y (* t t))) (* -1.0 (/ x z))))
      z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z * t) <= -1e+68) {
		tmp = (fma(((-1.0 * (x / ((z * z) * z))) * (-1.0 * pow(((y / t) * -1.0), 2.0))), -1.0, ((x / z) * -1.0)) - ((-1.0 * (x / (z * z))) * (-1.0 * (y / t)))) / t;
	} else if ((z * t) <= 5e+18) {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (x / y));
	} else {
		tmp = (fma(((-1.0 * pow(((y / z) * -1.0), 2.0)) * (-1.0 * (x / ((t * t) * t)))), -1.0, ((x / t) * -1.0)) - ((-1.0 * (y / (t * t))) * (-1.0 * (x / z)))) / z;
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z * t) <= -1e+68)
		tmp = Float64(Float64(fma(Float64(Float64(-1.0 * Float64(x / Float64(Float64(z * z) * z))) * Float64(-1.0 * (Float64(Float64(y / t) * -1.0) ^ 2.0))), -1.0, Float64(Float64(x / z) * -1.0)) - Float64(Float64(-1.0 * Float64(x / Float64(z * z))) * Float64(-1.0 * Float64(y / t)))) / t);
	elseif (Float64(z * t) <= 5e+18)
		tmp = Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * Float64(x / y)));
	else
		tmp = Float64(Float64(fma(Float64(Float64(-1.0 * (Float64(Float64(y / z) * -1.0) ^ 2.0)) * Float64(-1.0 * Float64(x / Float64(Float64(t * t) * t)))), -1.0, Float64(Float64(x / t) * -1.0)) - Float64(Float64(-1.0 * Float64(y / Float64(t * t))) * Float64(-1.0 * Float64(x / z)))) / z);
	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], -1e+68], N[(N[(N[(N[(N[(-1.0 * N[(x / N[(N[(z * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[Power[N[(N[(y / t), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(x / z), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+18], N[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(-1.0 * N[Power[N[(N[(y / z), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(x / N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(x / t), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 * N[(y / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+68}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\

\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot {\left(\frac{y}{z} \cdot -1\right)}^{2}\right) \cdot \left(-1 \cdot \frac{x}{\left(t \cdot t\right) \cdot t}\right), -1, \frac{x}{t} \cdot -1\right) - \left(-1 \cdot \frac{y}{t \cdot t}\right) \cdot \left(-1 \cdot \frac{x}{z}\right)}{z}\\


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

    1. Initial program 89.4%

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

      \[\leadsto \color{blue}{\frac{\left(-1 \cdot \frac{x}{z} + -1 \cdot \frac{x \cdot {y}^{2}}{{t}^{2} \cdot {z}^{3}}\right) - \frac{x \cdot y}{t \cdot {z}^{2}}}{t}} \]
    4. Applied rewrites75.6%

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

    if -9.99999999999999953e67 < (*.f64 z t) < 5e18

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
    5. Applied rewrites70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
      16. lower-/.f6470.0

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

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

    if 5e18 < (*.f64 z t)

    1. Initial program 93.1%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left({\left(\frac{y}{z} \cdot -1\right)}^{2} \cdot \frac{x}{\left(t \cdot t\right) \cdot t}, -1, \frac{x}{t} \cdot -1\right) - \frac{y}{t \cdot t} \cdot \frac{x}{z}}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.8%

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

Alternative 7: 70.3% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+68} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+18}\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}\\ \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 (or (<= (* z t) -1e+68) (not (<= (* z t) 5e+18)))
   (/
    (-
     (fma
      (* (* -1.0 (/ x (* (* z z) z))) (* -1.0 (pow (* (/ y t) -1.0) 2.0)))
      -1.0
      (* (/ x z) -1.0))
     (* (* -1.0 (/ x (* z z))) (* -1.0 (/ y t))))
    t)
   (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ x y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z * t) <= -1e+68) || !((z * t) <= 5e+18)) {
		tmp = (fma(((-1.0 * (x / ((z * z) * z))) * (-1.0 * pow(((y / t) * -1.0), 2.0))), -1.0, ((x / z) * -1.0)) - ((-1.0 * (x / (z * z))) * (-1.0 * (y / t)))) / t;
	} else {
		tmp = ((((z * x) * t) / y) / y) - (-1.0 * (x / y));
	}
	return tmp;
}
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z * t) <= -1e+68) || !(Float64(z * t) <= 5e+18))
		tmp = Float64(Float64(fma(Float64(Float64(-1.0 * Float64(x / Float64(Float64(z * z) * z))) * Float64(-1.0 * (Float64(Float64(y / t) * -1.0) ^ 2.0))), -1.0, Float64(Float64(x / z) * -1.0)) - Float64(Float64(-1.0 * Float64(x / Float64(z * z))) * Float64(-1.0 * Float64(y / t)))) / t);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * Float64(x / y)));
	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[Or[LessEqual[N[(z * t), $MachinePrecision], -1e+68], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+18]], $MachinePrecision]], N[(N[(N[(N[(N[(-1.0 * N[(x / N[(N[(z * z), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[Power[N[(N[(y / t), $MachinePrecision] * -1.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(N[(x / z), $MachinePrecision] * -1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 * N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+68} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-1 \cdot \frac{x}{\left(z \cdot z\right) \cdot z}\right) \cdot \left(-1 \cdot {\left(\frac{y}{t} \cdot -1\right)}^{2}\right), -1, \frac{x}{z} \cdot -1\right) - \left(-1 \cdot \frac{x}{z \cdot z}\right) \cdot \left(-1 \cdot \frac{y}{t}\right)}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 z t) < -9.99999999999999953e67 or 5e18 < (*.f64 z t)

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{\frac{\left(-1 \cdot \frac{x}{z} + -1 \cdot \frac{x \cdot {y}^{2}}{{t}^{2} \cdot {z}^{3}}\right) - \frac{x \cdot y}{t \cdot {z}^{2}}}{t}} \]
    4. Applied rewrites74.6%

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

    if -9.99999999999999953e67 < (*.f64 z t) < 5e18

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
    5. Applied rewrites70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
      16. lower-/.f6470.0

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

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.8%

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

Alternative 8: 47.7% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + 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 (/ (+ (/ (* (* z x) t) y) x) y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return ((((z * x) * t) / y) + 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 = ((((z * x) * t) / y) + x) / y
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return ((((z * x) * t) / y) + x) / y;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return ((((z * x) * t) / y) + x) / y
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) + x) / y)
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = ((((z * x) * t) / y) + 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[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y}
\end{array}
Derivation
  1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
  5. Applied rewrites46.3%

    \[\leadsto \color{blue}{\frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y}} \]
  6. Final simplification46.3%

    \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
  7. Add Preprocessing

Alternative 9: 47.2% accurate, N/A× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \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
 (- (/ (/ (* (* z x) t) y) y) (* -1.0 (/ x y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return ((((z * x) * t) / y) / y) - (-1.0 * (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 = ((((z * x) * t) / y) / y) - ((-1.0d0) * (x / y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return ((((z * x) * t) / y) / y) - (-1.0 * (x / y));
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return ((((z * x) * t) / y) / y) - (-1.0 * (x / y))
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(Float64(z * x) * t) / y) / y) - Float64(-1.0 * Float64(x / y)))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = ((((z * x) * t) / y) / y) - (-1.0 * (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[(N[(N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] / y), $MachinePrecision] / y), $MachinePrecision] - N[(-1.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} - -1 \cdot \frac{x}{y}
\end{array}
Derivation
  1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y} + x}{y} \]
  5. Applied rewrites46.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{y} \]
    16. lower-/.f6446.3

      \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \frac{x}{\color{blue}{y}} \]
  7. Applied rewrites46.3%

    \[\leadsto \frac{\frac{\left(z \cdot x\right) \cdot t}{y}}{y} + \color{blue}{\frac{x}{y}} \]
  8. Final simplification46.3%

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

Reproduce

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

  :alt
  (! :herbie-platform default (if (< x -161819597360704900000000000000000000000000000000000) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 213783064348764440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t))))))

  (/ x (- y (* z t))))