Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B

Percentage Accurate: 88.6% → 96.9%
Time: 16.5s
Alternatives: 15
Speedup: 1.0×

Specification

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

\\
\frac{x}{\left(y - z\right) \cdot \left(t - z\right)}
\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 15 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: 88.6% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 1.0× speedup?

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

    \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
  2. Step-by-step derivation
    1. frac-2neg89.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-x\right) \cdot 1}{\left(y - z\right) \cdot \left(-\left(t - z\right)\right)}} \]
    2. *-commutative89.7%

      \[\leadsto \frac{\left(-x\right) \cdot 1}{\color{blue}{\left(-\left(t - z\right)\right) \cdot \left(y - z\right)}} \]
    3. *-rgt-identity89.7%

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

      \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
  5. Simplified97.2%

    \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
  6. Step-by-step derivation
    1. expm1-log1p-u82.3%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-x}{-\left(t - z\right)}\right)\right)}}{y - z} \]
    2. expm1-udef59.6%

      \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\frac{-x}{-\left(t - z\right)}\right)} - 1}}{y - z} \]
    3. frac-2neg59.6%

      \[\leadsto \frac{e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{t - z}}\right)} - 1}{y - z} \]
  7. Applied egg-rr59.6%

    \[\leadsto \frac{\color{blue}{e^{\mathsf{log1p}\left(\frac{x}{t - z}\right)} - 1}}{y - z} \]
  8. Step-by-step derivation
    1. expm1-def82.3%

      \[\leadsto \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{t - z}\right)\right)}}{y - z} \]
    2. expm1-log1p97.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z} \]
  9. Simplified97.2%

    \[\leadsto \frac{\color{blue}{\frac{x}{t - z}}}{y - z} \]
  10. Final simplification97.2%

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

Alternative 2: 73.0% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-304}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-73}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.1e-43)
   (/ x (* (- t z) y))
   (if (<= y -1.75e-304)
     (/ 1.0 (* z (/ z x)))
     (if (<= y 1.02e-73)
       (/ x (* t (- y z)))
       (if (<= y 8.2e-58) (/ x (* z z)) (/ (/ x t) (- y z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.1e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.75e-304) {
		tmp = 1.0 / (z * (z / x));
	} else if (y <= 1.02e-73) {
		tmp = x / (t * (y - z));
	} else if (y <= 8.2e-58) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.1d-43)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-1.75d-304)) then
        tmp = 1.0d0 / (z * (z / x))
    else if (y <= 1.02d-73) then
        tmp = x / (t * (y - z))
    else if (y <= 8.2d-58) then
        tmp = x / (z * z)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.1e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= -1.75e-304) {
		tmp = 1.0 / (z * (z / x));
	} else if (y <= 1.02e-73) {
		tmp = x / (t * (y - z));
	} else if (y <= 8.2e-58) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.1e-43:
		tmp = x / ((t - z) * y)
	elif y <= -1.75e-304:
		tmp = 1.0 / (z * (z / x))
	elif y <= 1.02e-73:
		tmp = x / (t * (y - z))
	elif y <= 8.2e-58:
		tmp = x / (z * z)
	else:
		tmp = (x / t) / (y - z)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.1e-43)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -1.75e-304)
		tmp = Float64(1.0 / Float64(z * Float64(z / x)));
	elseif (y <= 1.02e-73)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	elseif (y <= 8.2e-58)
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.1e-43)
		tmp = x / ((t - z) * y);
	elseif (y <= -1.75e-304)
		tmp = 1.0 / (z * (z / x));
	elseif (y <= 1.02e-73)
		tmp = x / (t * (y - z));
	elseif (y <= 8.2e-58)
		tmp = x / (z * z);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.75e-304], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-73], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-58], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

\mathbf{elif}\;y \leq -1.75 \cdot 10^{-304}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\

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

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.1000000000000001e-43

    1. Initial program 87.1%

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

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

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

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

    if -2.1000000000000001e-43 < y < -1.75e-304

    1. Initial program 93.9%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow271.3%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified71.3%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
    5. Step-by-step derivation
      1. clear-num72.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. inv-pow72.3%

        \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    6. Applied egg-rr72.3%

      \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-172.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. *-lft-identity72.3%

        \[\leadsto \frac{1}{\frac{z \cdot z}{\color{blue}{1 \cdot x}}} \]
      3. times-frac76.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{1} \cdot \frac{z}{x}}} \]
      4. /-rgt-identity76.3%

        \[\leadsto \frac{1}{\color{blue}{z} \cdot \frac{z}{x}} \]
    8. Simplified76.3%

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

    if -1.75e-304 < y < 1.0199999999999999e-73

    1. Initial program 88.1%

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

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

    if 1.0199999999999999e-73 < y < 8.20000000000000056e-58

    1. Initial program 91.9%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow253.5%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified53.5%

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

    if 8.20000000000000056e-58 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    4. Simplified61.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification70.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -1.75 \cdot 10^{-304}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-73}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-58}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 3: 74.1% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-308}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-57}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -5.8e-44)
   (/ (/ x y) (- t z))
   (if (<= y 2e-308)
     (/ 1.0 (* z (/ z x)))
     (if (<= y 5.5e-84)
       (/ x (* t (- y z)))
       (if (<= y 1.65e-57) (/ x (* z z)) (/ (/ x t) (- y z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -5.8e-44) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2e-308) {
		tmp = 1.0 / (z * (z / x));
	} else if (y <= 5.5e-84) {
		tmp = x / (t * (y - z));
	} else if (y <= 1.65e-57) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-5.8d-44)) then
        tmp = (x / y) / (t - z)
    else if (y <= 2d-308) then
        tmp = 1.0d0 / (z * (z / x))
    else if (y <= 5.5d-84) then
        tmp = x / (t * (y - z))
    else if (y <= 1.65d-57) then
        tmp = x / (z * z)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -5.8e-44) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2e-308) {
		tmp = 1.0 / (z * (z / x));
	} else if (y <= 5.5e-84) {
		tmp = x / (t * (y - z));
	} else if (y <= 1.65e-57) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -5.8e-44:
		tmp = (x / y) / (t - z)
	elif y <= 2e-308:
		tmp = 1.0 / (z * (z / x))
	elif y <= 5.5e-84:
		tmp = x / (t * (y - z))
	elif y <= 1.65e-57:
		tmp = x / (z * z)
	else:
		tmp = (x / t) / (y - z)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -5.8e-44)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 2e-308)
		tmp = Float64(1.0 / Float64(z * Float64(z / x)));
	elseif (y <= 5.5e-84)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	elseif (y <= 1.65e-57)
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -5.8e-44)
		tmp = (x / y) / (t - z);
	elseif (y <= 2e-308)
		tmp = 1.0 / (z * (z / x));
	elseif (y <= 5.5e-84)
		tmp = x / (t * (y - z));
	elseif (y <= 1.65e-57)
		tmp = x / (z * z);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -5.8e-44], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-308], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-84], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-57], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\

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

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-57}:\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.8000000000000003e-44

    1. Initial program 87.1%

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

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

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

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

    if -5.8000000000000003e-44 < y < 1.9999999999999998e-308

    1. Initial program 93.9%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow271.3%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified71.3%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
    5. Step-by-step derivation
      1. clear-num72.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. inv-pow72.3%

        \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    6. Applied egg-rr72.3%

      \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-172.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. *-lft-identity72.3%

        \[\leadsto \frac{1}{\frac{z \cdot z}{\color{blue}{1 \cdot x}}} \]
      3. times-frac76.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{1} \cdot \frac{z}{x}}} \]
      4. /-rgt-identity76.3%

        \[\leadsto \frac{1}{\color{blue}{z} \cdot \frac{z}{x}} \]
    8. Simplified76.3%

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

    if 1.9999999999999998e-308 < y < 5.50000000000000019e-84

    1. Initial program 87.8%

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

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

    if 5.50000000000000019e-84 < y < 1.6499999999999999e-57

    1. Initial program 93.3%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow261.3%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified61.3%

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

    if 1.6499999999999999e-57 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    4. Simplified61.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-308}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-57}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 4: 81.6% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -7.6e+42)
   (/ (/ x y) (- t z))
   (if (<= y -3.3e-13)
     (/ (/ (- x) z) (- y z))
     (if (<= y -1.9e-43)
       (/ x (* (- t z) y))
       (if (<= y 1.7e-57) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.6e+42) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3.3e-13) {
		tmp = (-x / z) / (y - z);
	} else if (y <= -1.9e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= 1.7e-57) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-7.6d+42)) then
        tmp = (x / y) / (t - z)
    else if (y <= (-3.3d-13)) then
        tmp = (-x / z) / (y - z)
    else if (y <= (-1.9d-43)) then
        tmp = x / ((t - z) * y)
    else if (y <= 1.7d-57) then
        tmp = (x / z) / (z - t)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.6e+42) {
		tmp = (x / y) / (t - z);
	} else if (y <= -3.3e-13) {
		tmp = (-x / z) / (y - z);
	} else if (y <= -1.9e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= 1.7e-57) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -7.6e+42:
		tmp = (x / y) / (t - z)
	elif y <= -3.3e-13:
		tmp = (-x / z) / (y - z)
	elif y <= -1.9e-43:
		tmp = x / ((t - z) * y)
	elif y <= 1.7e-57:
		tmp = (x / z) / (z - t)
	else:
		tmp = (x / t) / (y - z)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -7.6e+42)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= -3.3e-13)
		tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z));
	elseif (y <= -1.9e-43)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= 1.7e-57)
		tmp = Float64(Float64(x / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -7.6e+42)
		tmp = (x / y) / (t - z);
	elseif (y <= -3.3e-13)
		tmp = (-x / z) / (y - z);
	elseif (y <= -1.9e-43)
		tmp = x / ((t - z) * y);
	elseif (y <= 1.7e-57)
		tmp = (x / z) / (z - t);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -7.6e+42], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.3e-13], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-57], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{-x}{z}}{y - z}\\

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

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.5999999999999997e42

    1. Initial program 84.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    4. Simplified91.4%

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

    if -7.5999999999999997e42 < y < -3.3000000000000001e-13

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-\frac{x}{z \cdot \left(y - z\right)}} \]
      2. distribute-frac-neg68.5%

        \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(y - z\right)}} \]
      3. associate-/r*68.4%

        \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{y - z}} \]
    4. Simplified68.4%

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

    if -3.3000000000000001e-13 < y < -1.89999999999999985e-43

    1. Initial program 99.6%

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

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

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

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

    if -1.89999999999999985e-43 < y < 1.70000000000000008e-57

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. frac-2neg91.3%

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

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

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

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

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

        \[\leadsto \frac{\left(-x\right) \cdot 1}{\color{blue}{\left(-\left(t - z\right)\right) \cdot \left(y - z\right)}} \]
      3. *-rgt-identity91.3%

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

        \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
    5. Simplified95.8%

      \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
    6. Taylor expanded in y around 0 75.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    8. Simplified81.8%

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

    if 1.70000000000000008e-57 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    4. Simplified61.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification77.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{+42}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 5: 67.6% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{if}\;z \leq -6.2 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+17}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 1.0 (* z (/ z x)))))
   (if (<= z -6.2e+46)
     t_1
     (if (<= z -1.7e-13)
       (/ (- x) (* z y))
       (if (<= z 2.15e+17) (/ (/ x t) y) t_1)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 / (z * (z / x));
	double tmp;
	if (z <= -6.2e+46) {
		tmp = t_1;
	} else if (z <= -1.7e-13) {
		tmp = -x / (z * y);
	} else if (z <= 2.15e+17) {
		tmp = (x / t) / y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 / (z * (z / x))
    if (z <= (-6.2d+46)) then
        tmp = t_1
    else if (z <= (-1.7d-13)) then
        tmp = -x / (z * y)
    else if (z <= 2.15d+17) then
        tmp = (x / t) / y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = 1.0 / (z * (z / x));
	double tmp;
	if (z <= -6.2e+46) {
		tmp = t_1;
	} else if (z <= -1.7e-13) {
		tmp = -x / (z * y);
	} else if (z <= 2.15e+17) {
		tmp = (x / t) / y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = 1.0 / (z * (z / x))
	tmp = 0
	if z <= -6.2e+46:
		tmp = t_1
	elif z <= -1.7e-13:
		tmp = -x / (z * y)
	elif z <= 2.15e+17:
		tmp = (x / t) / y
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(1.0 / Float64(z * Float64(z / x)))
	tmp = 0.0
	if (z <= -6.2e+46)
		tmp = t_1;
	elseif (z <= -1.7e-13)
		tmp = Float64(Float64(-x) / Float64(z * y));
	elseif (z <= 2.15e+17)
		tmp = Float64(Float64(x / t) / y);
	else
		tmp = t_1;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 / (z * (z / x));
	tmp = 0.0;
	if (z <= -6.2e+46)
		tmp = t_1;
	elseif (z <= -1.7e-13)
		tmp = -x / (z * y);
	elseif (z <= 2.15e+17)
		tmp = (x / t) / y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.2e+46], t$95$1, If[LessEqual[z, -1.7e-13], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+17], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.7 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.1999999999999995e46 or 2.15e17 < z

    1. Initial program 86.5%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow273.4%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified73.4%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
    5. Step-by-step derivation
      1. clear-num73.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. inv-pow73.7%

        \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    6. Applied egg-rr73.7%

      \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-173.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. *-lft-identity73.7%

        \[\leadsto \frac{1}{\frac{z \cdot z}{\color{blue}{1 \cdot x}}} \]
      3. times-frac77.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{1} \cdot \frac{z}{x}}} \]
      4. /-rgt-identity77.4%

        \[\leadsto \frac{1}{\color{blue}{z} \cdot \frac{z}{x}} \]
    8. Simplified77.4%

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

    if -6.1999999999999995e46 < z < -1.70000000000000008e-13

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{y \cdot z}} \]
      2. neg-mul-152.9%

        \[\leadsto \frac{\color{blue}{-x}}{y \cdot z} \]
    7. Simplified52.9%

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

    if -1.70000000000000008e-13 < z < 2.15e17

    1. Initial program 92.1%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. associate-/r*62.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified62.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+46}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;z \leq -1.7 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{+17}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \]

Alternative 6: 72.8% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{if}\;z \leq -2.65 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{+28}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ 1.0 (* z (/ z x)))))
   (if (<= z -2.65e+53)
     t_1
     (if (<= z -3e-13)
       (/ (- x) (* z y))
       (if (<= z 1.26e+28) (/ x (* t (- y z))) t_1)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = 1.0 / (z * (z / x));
	double tmp;
	if (z <= -2.65e+53) {
		tmp = t_1;
	} else if (z <= -3e-13) {
		tmp = -x / (z * y);
	} else if (z <= 1.26e+28) {
		tmp = x / (t * (y - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 1.0d0 / (z * (z / x))
    if (z <= (-2.65d+53)) then
        tmp = t_1
    else if (z <= (-3d-13)) then
        tmp = -x / (z * y)
    else if (z <= 1.26d+28) then
        tmp = x / (t * (y - z))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = 1.0 / (z * (z / x));
	double tmp;
	if (z <= -2.65e+53) {
		tmp = t_1;
	} else if (z <= -3e-13) {
		tmp = -x / (z * y);
	} else if (z <= 1.26e+28) {
		tmp = x / (t * (y - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = 1.0 / (z * (z / x))
	tmp = 0
	if z <= -2.65e+53:
		tmp = t_1
	elif z <= -3e-13:
		tmp = -x / (z * y)
	elif z <= 1.26e+28:
		tmp = x / (t * (y - z))
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(1.0 / Float64(z * Float64(z / x)))
	tmp = 0.0
	if (z <= -2.65e+53)
		tmp = t_1;
	elseif (z <= -3e-13)
		tmp = Float64(Float64(-x) / Float64(z * y));
	elseif (z <= 1.26e+28)
		tmp = Float64(x / Float64(t * Float64(y - z)));
	else
		tmp = t_1;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = 1.0 / (z * (z / x));
	tmp = 0.0;
	if (z <= -2.65e+53)
		tmp = t_1;
	elseif (z <= -3e-13)
		tmp = -x / (z * y);
	elseif (z <= 1.26e+28)
		tmp = x / (t * (y - z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e+53], t$95$1, If[LessEqual[z, -3e-13], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.26e+28], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{z \cdot \frac{z}{x}}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+53}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -3 \cdot 10^{-13}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6500000000000001e53 or 1.26e28 < z

    1. Initial program 86.2%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow273.5%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified73.5%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
    5. Step-by-step derivation
      1. clear-num73.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. inv-pow73.9%

        \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    6. Applied egg-rr73.9%

      \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-173.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. *-lft-identity73.9%

        \[\leadsto \frac{1}{\frac{z \cdot z}{\color{blue}{1 \cdot x}}} \]
      3. times-frac77.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{1} \cdot \frac{z}{x}}} \]
      4. /-rgt-identity77.6%

        \[\leadsto \frac{1}{\color{blue}{z} \cdot \frac{z}{x}} \]
    8. Simplified77.6%

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

    if -2.6500000000000001e53 < z < -2.99999999999999984e-13

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{y \cdot z}} \]
      2. neg-mul-152.9%

        \[\leadsto \frac{\color{blue}{-x}}{y \cdot z} \]
    7. Simplified52.9%

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

    if -2.99999999999999984e-13 < z < 1.26e28

    1. Initial program 92.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+53}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-13}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 1.26 \cdot 10^{+28}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \end{array} \]

Alternative 7: 63.9% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot z}\\ \mathbf{if}\;z \leq -1.65 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-11}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 2120000000:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (/ x (* z z))))
   (if (<= z -1.65e+47)
     t_1
     (if (<= z -1.06e-11)
       (/ (- x) (* z y))
       (if (<= z 2120000000.0) (/ (/ x t) y) t_1)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double tmp;
	if (z <= -1.65e+47) {
		tmp = t_1;
	} else if (z <= -1.06e-11) {
		tmp = -x / (z * y);
	} else if (z <= 2120000000.0) {
		tmp = (x / t) / y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x / (z * z)
    if (z <= (-1.65d+47)) then
        tmp = t_1
    else if (z <= (-1.06d-11)) then
        tmp = -x / (z * y)
    else if (z <= 2120000000.0d0) then
        tmp = (x / t) / y
    else
        tmp = t_1
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double tmp;
	if (z <= -1.65e+47) {
		tmp = t_1;
	} else if (z <= -1.06e-11) {
		tmp = -x / (z * y);
	} else if (z <= 2120000000.0) {
		tmp = (x / t) / y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = x / (z * z)
	tmp = 0
	if z <= -1.65e+47:
		tmp = t_1
	elif z <= -1.06e-11:
		tmp = -x / (z * y)
	elif z <= 2120000000.0:
		tmp = (x / t) / y
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * z))
	tmp = 0.0
	if (z <= -1.65e+47)
		tmp = t_1;
	elseif (z <= -1.06e-11)
		tmp = Float64(Float64(-x) / Float64(z * y));
	elseif (z <= 2120000000.0)
		tmp = Float64(Float64(x / t) / y);
	else
		tmp = t_1;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = x / (z * z);
	tmp = 0.0;
	if (z <= -1.65e+47)
		tmp = t_1;
	elseif (z <= -1.06e-11)
		tmp = -x / (z * y);
	elseif (z <= 2120000000.0)
		tmp = (x / t) / y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+47], t$95$1, If[LessEqual[z, -1.06e-11], N[((-x) / N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2120000000.0], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+47}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.06 \cdot 10^{-11}:\\
\;\;\;\;\frac{-x}{z \cdot y}\\

\mathbf{elif}\;z \leq 2120000000:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.65e47 or 2.12e9 < z

    1. Initial program 86.5%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow273.4%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified73.4%

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

    if -1.65e47 < z < -1.05999999999999993e-11

    1. Initial program 99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{y \cdot z}} \]
      2. neg-mul-152.9%

        \[\leadsto \frac{\color{blue}{-x}}{y \cdot z} \]
    7. Simplified52.9%

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

    if -1.05999999999999993e-11 < z < 2.12e9

    1. Initial program 92.1%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. associate-/r*62.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified62.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+47}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;z \leq -1.06 \cdot 10^{-11}:\\ \;\;\;\;\frac{-x}{z \cdot y}\\ \mathbf{elif}\;z \leq 2120000000:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \end{array} \]

Alternative 8: 72.4% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3.55 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-305}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -3.55e-43)
   (/ x (* (- t z) y))
   (if (<= y -4.2e-305) (/ 1.0 (* z (/ z x))) (/ x (* t (- y z))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.55e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= -4.2e-305) {
		tmp = 1.0 / (z * (z / x));
	} else {
		tmp = x / (t * (y - z));
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-3.55d-43)) then
        tmp = x / ((t - z) * y)
    else if (y <= (-4.2d-305)) then
        tmp = 1.0d0 / (z * (z / x))
    else
        tmp = x / (t * (y - z))
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -3.55e-43) {
		tmp = x / ((t - z) * y);
	} else if (y <= -4.2e-305) {
		tmp = 1.0 / (z * (z / x));
	} else {
		tmp = x / (t * (y - z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -3.55e-43:
		tmp = x / ((t - z) * y)
	elif y <= -4.2e-305:
		tmp = 1.0 / (z * (z / x))
	else:
		tmp = x / (t * (y - z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -3.55e-43)
		tmp = Float64(x / Float64(Float64(t - z) * y));
	elseif (y <= -4.2e-305)
		tmp = Float64(1.0 / Float64(z * Float64(z / x)));
	else
		tmp = Float64(x / Float64(t * Float64(y - z)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -3.55e-43)
		tmp = x / ((t - z) * y);
	elseif (y <= -4.2e-305)
		tmp = 1.0 / (z * (z / x));
	else
		tmp = x / (t * (y - z));
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -3.55e-43], N[(x / N[(N[(t - z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.2e-305], N[(1.0 / N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.55 \cdot 10^{-43}:\\
\;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-305}:\\
\;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.55000000000000013e-43

    1. Initial program 87.1%

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

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

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

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

    if -3.55000000000000013e-43 < y < -4.2e-305

    1. Initial program 93.9%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow271.3%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified71.3%

      \[\leadsto \color{blue}{\frac{x}{z \cdot z}} \]
    5. Step-by-step derivation
      1. clear-num72.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. inv-pow72.3%

        \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    6. Applied egg-rr72.3%

      \[\leadsto \color{blue}{{\left(\frac{z \cdot z}{x}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-172.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{z \cdot z}{x}}} \]
      2. *-lft-identity72.3%

        \[\leadsto \frac{1}{\frac{z \cdot z}{\color{blue}{1 \cdot x}}} \]
      3. times-frac76.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{z}{1} \cdot \frac{z}{x}}} \]
      4. /-rgt-identity76.3%

        \[\leadsto \frac{1}{\color{blue}{z} \cdot \frac{z}{x}} \]
    8. Simplified76.3%

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

    if -4.2e-305 < y

    1. Initial program 89.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.55 \cdot 10^{-43}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-305}:\\ \;\;\;\;\frac{1}{z \cdot \frac{z}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]

Alternative 9: 82.0% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-43}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.8e-43)
   (/ (/ x y) (- t z))
   (if (<= y 2.1e-57) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.8e-43) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.1e-57) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.8d-43)) then
        tmp = (x / y) / (t - z)
    else if (y <= 2.1d-57) then
        tmp = (x / z) / (z - t)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.8e-43) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.1e-57) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.8e-43:
		tmp = (x / y) / (t - z)
	elif y <= 2.1e-57:
		tmp = (x / z) / (z - t)
	else:
		tmp = (x / t) / (y - z)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.8e-43)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 2.1e-57)
		tmp = Float64(Float64(x / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.8e-43)
		tmp = (x / y) / (t - z);
	elseif (y <= 2.1e-57)
		tmp = (x / z) / (z - t);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-43], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-57], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.7999999999999998e-43

    1. Initial program 87.1%

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

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

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

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

    if -2.7999999999999998e-43 < y < 2.0999999999999999e-57

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. frac-2neg91.3%

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

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

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

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

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

        \[\leadsto \frac{\left(-x\right) \cdot 1}{\color{blue}{\left(-\left(t - z\right)\right) \cdot \left(y - z\right)}} \]
      3. *-rgt-identity91.3%

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

        \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
    5. Simplified95.8%

      \[\leadsto \color{blue}{\frac{\frac{-x}{-\left(t - z\right)}}{y - z}} \]
    6. Taylor expanded in y around 0 75.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z - t}} \]
    8. Simplified81.8%

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

    if 2.0999999999999999e-57 < y

    1. Initial program 90.5%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
    4. Simplified61.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y - z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-43}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 10: 90.4% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{+159}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -2.95e+159) (/ (/ x y) (- t z)) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.95e+159) {
		tmp = (x / y) / (t - z);
	} else {
		tmp = x / ((t - z) * (y - z));
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-2.95d+159)) then
        tmp = (x / y) / (t - z)
    else
        tmp = x / ((t - z) * (y - z))
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.95e+159) {
		tmp = (x / y) / (t - z);
	} else {
		tmp = x / ((t - z) * (y - z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -2.95e+159:
		tmp = (x / y) / (t - z)
	else:
		tmp = x / ((t - z) * (y - z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -2.95e+159)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	else
		tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -2.95e+159)
		tmp = (x / y) / (t - z);
	else
		tmp = x / ((t - z) * (y - z));
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -2.95e+159], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.95 \cdot 10^{+159}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.94999999999999996e159

    1. Initial program 77.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    4. Simplified95.9%

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

    if -2.94999999999999996e159 < y

    1. Initial program 91.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{+159}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\ \end{array} \]

Alternative 11: 90.4% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+161}:\\ \;\;\;\;\frac{x \cdot \frac{1}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -7.2e+161) (/ (* x (/ 1.0 y)) (- t z)) (/ x (* (- t z) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.2e+161) {
		tmp = (x * (1.0 / y)) / (t - z);
	} else {
		tmp = x / ((t - z) * (y - z));
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y <= (-7.2d+161)) then
        tmp = (x * (1.0d0 / y)) / (t - z)
    else
        tmp = x / ((t - z) * (y - z))
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -7.2e+161) {
		tmp = (x * (1.0 / y)) / (t - z);
	} else {
		tmp = x / ((t - z) * (y - z));
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -7.2e+161:
		tmp = (x * (1.0 / y)) / (t - z)
	else:
		tmp = x / ((t - z) * (y - z))
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -7.2e+161)
		tmp = Float64(Float64(x * Float64(1.0 / y)) / Float64(t - z));
	else
		tmp = Float64(x / Float64(Float64(t - z) * Float64(y - z)));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -7.2e+161)
		tmp = (x * (1.0 / y)) / (t - z);
	else
		tmp = x / ((t - z) * (y - z));
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -7.2e+161], N[(N[(x * N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(t - z), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+161}:\\
\;\;\;\;\frac{x \cdot \frac{1}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.19999999999999967e161

    1. Initial program 77.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. associate-/r*96.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y - z}}{t - z}} \]
    4. Step-by-step derivation
      1. clear-num96.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y - z}{x}}}}{t - z} \]
      2. associate-/r/96.8%

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

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

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

    if -7.19999999999999967e161 < y

    1. Initial program 91.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+161}:\\ \;\;\;\;\frac{x \cdot \frac{1}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\ \end{array} \]

Alternative 12: 46.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+154} \lor \neg \left(z \leq 4.4 \cdot 10^{+69}\right):\\ \;\;\;\;\frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -3.4e+154) (not (<= z 4.4e+69))) (/ x (* t z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+154) || !(z <= 4.4e+69)) {
		tmp = x / (t * z);
	} else {
		tmp = x / (t * y);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-3.4d+154)) .or. (.not. (z <= 4.4d+69))) then
        tmp = x / (t * z)
    else
        tmp = x / (t * y)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -3.4e+154) || !(z <= 4.4e+69)) {
		tmp = x / (t * z);
	} else {
		tmp = x / (t * y);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -3.4e+154) or not (z <= 4.4e+69):
		tmp = x / (t * z)
	else:
		tmp = x / (t * y)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -3.4e+154) || !(z <= 4.4e+69))
		tmp = Float64(x / Float64(t * z));
	else
		tmp = Float64(x / Float64(t * y));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -3.4e+154) || ~((z <= 4.4e+69)))
		tmp = x / (t * z);
	else
		tmp = x / (t * y);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.4e+154], N[Not[LessEqual[z, 4.4e+69]], $MachinePrecision]], N[(x / N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+154} \lor \neg \left(z \leq 4.4 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{x}{t \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.39999999999999974e154 or 4.4000000000000003e69 < z

    1. Initial program 82.8%

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

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

        \[\leadsto \color{blue}{-\frac{x}{z \cdot \left(t - z\right)}} \]
      2. distribute-frac-neg79.8%

        \[\leadsto \color{blue}{\frac{-x}{z \cdot \left(t - z\right)}} \]
      3. associate-/r*89.6%

        \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{t - z}} \]
    4. Simplified89.6%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{t \cdot z}} \]
      2. neg-mul-138.1%

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

        \[\leadsto \frac{-x}{\color{blue}{z \cdot t}} \]
    7. Simplified38.1%

      \[\leadsto \color{blue}{\frac{-x}{z \cdot t}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u37.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-x}{z \cdot t}\right)\right)} \]
      2. expm1-udef65.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-x}{z \cdot t}\right)} - 1} \]
      3. add-sqr-sqrt34.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}{z \cdot t}\right)} - 1 \]
      4. sqrt-unprod62.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}{z \cdot t}\right)} - 1 \]
      5. sqr-neg62.5%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\sqrt{\color{blue}{x \cdot x}}}{z \cdot t}\right)} - 1 \]
      6. sqrt-unprod31.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}{z \cdot t}\right)} - 1 \]
      7. add-sqr-sqrt65.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{z \cdot t}\right)} - 1 \]
      8. *-commutative65.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{\color{blue}{t \cdot z}}\right)} - 1 \]
    9. Applied egg-rr65.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{t \cdot z}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def36.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{t \cdot z}\right)\right)} \]
      2. expm1-log1p36.5%

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    11. Simplified36.5%

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

    if -3.39999999999999974e154 < z < 4.4000000000000003e69

    1. Initial program 93.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+154} \lor \neg \left(z \leq 4.4 \cdot 10^{+69}\right):\\ \;\;\;\;\frac{x}{t \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]

Alternative 13: 62.6% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 27000000\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -1.35e-9) (not (<= z 27000000.0))) (/ x (* z z)) (/ x (* t y))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.35e-9) || !(z <= 27000000.0)) {
		tmp = x / (z * z);
	} else {
		tmp = x / (t * y);
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-1.35d-9)) .or. (.not. (z <= 27000000.0d0))) then
        tmp = x / (z * z)
    else
        tmp = x / (t * y)
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.35e-9) || !(z <= 27000000.0)) {
		tmp = x / (z * z);
	} else {
		tmp = x / (t * y);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.35e-9) or not (z <= 27000000.0):
		tmp = x / (z * z)
	else:
		tmp = x / (t * y)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.35e-9) || !(z <= 27000000.0))
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(x / Float64(t * y));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.35e-9) || ~((z <= 27000000.0)))
		tmp = x / (z * z);
	else
		tmp = x / (t * y);
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.35e-9], N[Not[LessEqual[z, 27000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(t * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 27000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.3500000000000001e-9 or 2.7e7 < z

    1. Initial program 87.8%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow269.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified69.7%

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

    if -1.3500000000000001e-9 < z < 2.7e7

    1. Initial program 92.2%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.35 \cdot 10^{-9} \lor \neg \left(z \leq 27000000\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot y}\\ \end{array} \]

Alternative 14: 64.0% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{-9} \lor \neg \left(z \leq 135000000000\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -7.4e-9) (not (<= z 135000000000.0)))
   (/ x (* z z))
   (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.4e-9) || !(z <= 135000000000.0)) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
NOTE: y and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
    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 <= (-7.4d-9)) .or. (.not. (z <= 135000000000.0d0))) then
        tmp = x / (z * z)
    else
        tmp = (x / t) / y
    end if
    code = tmp
end function
assert y < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -7.4e-9) || !(z <= 135000000000.0)) {
		tmp = x / (z * z);
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -7.4e-9) or not (z <= 135000000000.0):
		tmp = x / (z * z)
	else:
		tmp = (x / t) / y
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -7.4e-9) || !(z <= 135000000000.0))
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(Float64(x / t) / y);
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -7.4e-9) || ~((z <= 135000000000.0)))
		tmp = x / (z * z);
	else
		tmp = (x / t) / y;
	end
	tmp_2 = tmp;
end
NOTE: y and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.4e-9], N[Not[LessEqual[z, 135000000000.0]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-9} \lor \neg \left(z \leq 135000000000\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.4e-9 or 1.35e11 < z

    1. Initial program 87.8%

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

      \[\leadsto \color{blue}{\frac{x}{{z}^{2}}} \]
    3. Step-by-step derivation
      1. unpow269.7%

        \[\leadsto \frac{x}{\color{blue}{z \cdot z}} \]
    4. Simplified69.7%

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

    if -7.4e-9 < z < 1.35e11

    1. Initial program 92.2%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. associate-/r*62.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified62.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{-9} \lor \neg \left(z \leq 135000000000\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]

Alternative 15: 40.3% accurate, 1.8× speedup?

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

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

    \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
  3. Final simplification41.0%

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

Developer target: 87.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot \left(t - z\right)\\ \mathbf{if}\;\frac{x}{t_1} < 0:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{t_1}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) (- t z))))
   (if (< (/ x t_1) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    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 = (y - z) * (t - z)
    if ((x / t_1) < 0.0d0) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x * (1.0d0 / t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * (t - z);
	double tmp;
	if ((x / t_1) < 0.0) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x * (1.0 / t_1);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (x / t_1) < 0.0:
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x * (1.0 / t_1)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * Float64(t - z))
	tmp = 0.0
	if (Float64(x / t_1) < 0.0)
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x * Float64(1.0 / t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - z) * (t - z);
	tmp = 0.0;
	if ((x / t_1) < 0.0)
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x * (1.0 / t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Less[N[(x / t$95$1), $MachinePrecision], 0.0], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t_1}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023279 
(FPCore (x y z t)
  :name "Data.Random.Distribution.Triangular:triangularCDF from random-fu-0.2.6.2, B"
  :precision binary64

  :herbie-target
  (if (< (/ x (* (- y z) (- t z))) 0.0) (/ (/ x (- y z)) (- t z)) (* x (/ 1.0 (* (- y z) (- t z)))))

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