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

Percentage Accurate: 89.1% → 96.8%
Time: 10.2s
Alternatives: 16
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 16 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: 89.1% 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.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 64.3% accurate, 0.5× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z} \cdot \frac{1}{z}\\ t_2 := \frac{\frac{x}{t}}{y}\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-305}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-188}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 0.58:\\ \;\;\;\;t_2\\ \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) (/ 1.0 z))) (t_2 (/ (/ x t) y)))
   (if (<= z -1.7e+20)
     t_1
     (if (<= z -7.5e-113)
       (/ (/ (- x) t) z)
       (if (<= z 2.8e-305)
         (/ x (* y t))
         (if (<= z 2.85e-188)
           t_2
           (if (<= z 3.1e-109)
             (/ x (* z (- t)))
             (if (<= z 0.58) t_2 t_1))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) * (1.0 / z);
	double t_2 = (x / t) / y;
	double tmp;
	if (z <= -1.7e+20) {
		tmp = t_1;
	} else if (z <= -7.5e-113) {
		tmp = (-x / t) / z;
	} else if (z <= 2.8e-305) {
		tmp = x / (y * t);
	} else if (z <= 2.85e-188) {
		tmp = t_2;
	} else if (z <= 3.1e-109) {
		tmp = x / (z * -t);
	} else if (z <= 0.58) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = (x / z) * (1.0d0 / z)
    t_2 = (x / t) / y
    if (z <= (-1.7d+20)) then
        tmp = t_1
    else if (z <= (-7.5d-113)) then
        tmp = (-x / t) / z
    else if (z <= 2.8d-305) then
        tmp = x / (y * t)
    else if (z <= 2.85d-188) then
        tmp = t_2
    else if (z <= 3.1d-109) then
        tmp = x / (z * -t)
    else if (z <= 0.58d0) then
        tmp = t_2
    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) * (1.0 / z);
	double t_2 = (x / t) / y;
	double tmp;
	if (z <= -1.7e+20) {
		tmp = t_1;
	} else if (z <= -7.5e-113) {
		tmp = (-x / t) / z;
	} else if (z <= 2.8e-305) {
		tmp = x / (y * t);
	} else if (z <= 2.85e-188) {
		tmp = t_2;
	} else if (z <= 3.1e-109) {
		tmp = x / (z * -t);
	} else if (z <= 0.58) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / z) * (1.0 / z)
	t_2 = (x / t) / y
	tmp = 0
	if z <= -1.7e+20:
		tmp = t_1
	elif z <= -7.5e-113:
		tmp = (-x / t) / z
	elif z <= 2.8e-305:
		tmp = x / (y * t)
	elif z <= 2.85e-188:
		tmp = t_2
	elif z <= 3.1e-109:
		tmp = x / (z * -t)
	elif z <= 0.58:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) * Float64(1.0 / z))
	t_2 = Float64(Float64(x / t) / y)
	tmp = 0.0
	if (z <= -1.7e+20)
		tmp = t_1;
	elseif (z <= -7.5e-113)
		tmp = Float64(Float64(Float64(-x) / t) / z);
	elseif (z <= 2.8e-305)
		tmp = Float64(x / Float64(y * t));
	elseif (z <= 2.85e-188)
		tmp = t_2;
	elseif (z <= 3.1e-109)
		tmp = Float64(x / Float64(z * Float64(-t)));
	elseif (z <= 0.58)
		tmp = t_2;
	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) * (1.0 / z);
	t_2 = (x / t) / y;
	tmp = 0.0;
	if (z <= -1.7e+20)
		tmp = t_1;
	elseif (z <= -7.5e-113)
		tmp = (-x / t) / z;
	elseif (z <= 2.8e-305)
		tmp = x / (y * t);
	elseif (z <= 2.85e-188)
		tmp = t_2;
	elseif (z <= 3.1e-109)
		tmp = x / (z * -t);
	elseif (z <= 0.58)
		tmp = t_2;
	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[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -1.7e+20], t$95$1, If[LessEqual[z, -7.5e-113], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.8e-305], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.85e-188], t$95$2, If[LessEqual[z, 3.1e-109], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.58], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{1}{z}\\
t_2 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\

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

\mathbf{elif}\;z \leq 2.85 \cdot 10^{-188}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.7e20 or 0.57999999999999996 < z

    1. Initial program 86.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
      2. div-inv79.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    6. Applied egg-rr79.9%

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

    if -1.7e20 < z < -7.5000000000000002e-113

    1. Initial program 95.9%

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. associate-/r*53.5%

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac53.5%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
      4. distribute-neg-frac53.5%

        \[\leadsto \frac{\color{blue}{\frac{-x}{t}}}{z} \]
    5. Simplified53.5%

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

    if -7.5000000000000002e-113 < z < 2.80000000000000014e-305

    1. Initial program 95.1%

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

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

    if 2.80000000000000014e-305 < z < 2.85000000000000013e-188 or 3.1e-109 < z < 0.57999999999999996

    1. Initial program 90.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified75.1%

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

    if 2.85000000000000013e-188 < z < 3.1e-109

    1. Initial program 99.8%

      \[\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)}} \]
    3. Taylor expanded in y around 0 51.8%

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

        \[\leadsto \frac{x}{\color{blue}{-t \cdot z}} \]
      2. distribute-rgt-neg-out51.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-305}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-188}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{-109}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 0.58:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \end{array} \]

Alternative 3: 60.2% accurate, 0.5× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot z}\\ t_2 := \frac{\frac{x}{t}}{y}\\ t_3 := \frac{x}{z \cdot \left(-t\right)}\\ \mathbf{if}\;z \leq -1.55 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-113}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-306}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-198}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-110}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 3.7:\\ \;\;\;\;t_2\\ \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))) (t_2 (/ (/ x t) y)) (t_3 (/ x (* z (- t)))))
   (if (<= z -1.55e+21)
     t_1
     (if (<= z -8.2e-113)
       t_3
       (if (<= z 2.2e-306)
         (/ x (* y t))
         (if (<= z 6.3e-198)
           t_2
           (if (<= z 7.5e-110) t_3 (if (<= z 3.7) t_2 t_1))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double t_2 = (x / t) / y;
	double t_3 = x / (z * -t);
	double tmp;
	if (z <= -1.55e+21) {
		tmp = t_1;
	} else if (z <= -8.2e-113) {
		tmp = t_3;
	} else if (z <= 2.2e-306) {
		tmp = x / (y * t);
	} else if (z <= 6.3e-198) {
		tmp = t_2;
	} else if (z <= 7.5e-110) {
		tmp = t_3;
	} else if (z <= 3.7) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x / (z * z)
    t_2 = (x / t) / y
    t_3 = x / (z * -t)
    if (z <= (-1.55d+21)) then
        tmp = t_1
    else if (z <= (-8.2d-113)) then
        tmp = t_3
    else if (z <= 2.2d-306) then
        tmp = x / (y * t)
    else if (z <= 6.3d-198) then
        tmp = t_2
    else if (z <= 7.5d-110) then
        tmp = t_3
    else if (z <= 3.7d0) then
        tmp = t_2
    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 t_2 = (x / t) / y;
	double t_3 = x / (z * -t);
	double tmp;
	if (z <= -1.55e+21) {
		tmp = t_1;
	} else if (z <= -8.2e-113) {
		tmp = t_3;
	} else if (z <= 2.2e-306) {
		tmp = x / (y * t);
	} else if (z <= 6.3e-198) {
		tmp = t_2;
	} else if (z <= 7.5e-110) {
		tmp = t_3;
	} else if (z <= 3.7) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = x / (z * z)
	t_2 = (x / t) / y
	t_3 = x / (z * -t)
	tmp = 0
	if z <= -1.55e+21:
		tmp = t_1
	elif z <= -8.2e-113:
		tmp = t_3
	elif z <= 2.2e-306:
		tmp = x / (y * t)
	elif z <= 6.3e-198:
		tmp = t_2
	elif z <= 7.5e-110:
		tmp = t_3
	elif z <= 3.7:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * z))
	t_2 = Float64(Float64(x / t) / y)
	t_3 = Float64(x / Float64(z * Float64(-t)))
	tmp = 0.0
	if (z <= -1.55e+21)
		tmp = t_1;
	elseif (z <= -8.2e-113)
		tmp = t_3;
	elseif (z <= 2.2e-306)
		tmp = Float64(x / Float64(y * t));
	elseif (z <= 6.3e-198)
		tmp = t_2;
	elseif (z <= 7.5e-110)
		tmp = t_3;
	elseif (z <= 3.7)
		tmp = t_2;
	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);
	t_2 = (x / t) / y;
	t_3 = x / (z * -t);
	tmp = 0.0;
	if (z <= -1.55e+21)
		tmp = t_1;
	elseif (z <= -8.2e-113)
		tmp = t_3;
	elseif (z <= 2.2e-306)
		tmp = x / (y * t);
	elseif (z <= 6.3e-198)
		tmp = t_2;
	elseif (z <= 7.5e-110)
		tmp = t_3;
	elseif (z <= 3.7)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+21], t$95$1, If[LessEqual[z, -8.2e-113], t$95$3, If[LessEqual[z, 2.2e-306], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.3e-198], t$95$2, If[LessEqual[z, 7.5e-110], t$95$3, If[LessEqual[z, 3.7], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
t_2 := \frac{\frac{x}{t}}{y}\\
t_3 := \frac{x}{z \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-113}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;z \leq 6.3 \cdot 10^{-198}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-110}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 3.7:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.55e21 or 3.7000000000000002 < z

    1. Initial program 86.9%

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

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

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

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

    if -1.55e21 < z < -8.1999999999999999e-113 or 6.30000000000000015e-198 < z < 7.50000000000000053e-110

    1. Initial program 97.3%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{-t \cdot z}} \]
      2. distribute-rgt-neg-out54.7%

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

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

    if -8.1999999999999999e-113 < z < 2.20000000000000016e-306

    1. Initial program 95.1%

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

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

    if 2.20000000000000016e-306 < z < 6.30000000000000015e-198 or 7.50000000000000053e-110 < z < 3.7000000000000002

    1. Initial program 90.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified75.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-113}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-306}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 6.3 \cdot 10^{-198}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-110}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 3.7:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \end{array} \]

Alternative 4: 60.6% accurate, 0.5× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z \cdot z}\\ t_2 := \frac{\frac{x}{t}}{y}\\ \mathbf{if}\;z \leq -5 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-306}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-188}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-107}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;t_2\\ \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))) (t_2 (/ (/ x t) y)))
   (if (<= z -5e+20)
     t_1
     (if (<= z -3.3e-113)
       (/ (/ (- x) t) z)
       (if (<= z 2.3e-306)
         (/ x (* y t))
         (if (<= z 2.5e-188)
           t_2
           (if (<= z 9e-107)
             (/ x (* z (- t)))
             (if (<= z 3.8e-5) t_2 t_1))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = x / (z * z);
	double t_2 = (x / t) / y;
	double tmp;
	if (z <= -5e+20) {
		tmp = t_1;
	} else if (z <= -3.3e-113) {
		tmp = (-x / t) / z;
	} else if (z <= 2.3e-306) {
		tmp = x / (y * t);
	} else if (z <= 2.5e-188) {
		tmp = t_2;
	} else if (z <= 9e-107) {
		tmp = x / (z * -t);
	} else if (z <= 3.8e-5) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = x / (z * z)
    t_2 = (x / t) / y
    if (z <= (-5d+20)) then
        tmp = t_1
    else if (z <= (-3.3d-113)) then
        tmp = (-x / t) / z
    else if (z <= 2.3d-306) then
        tmp = x / (y * t)
    else if (z <= 2.5d-188) then
        tmp = t_2
    else if (z <= 9d-107) then
        tmp = x / (z * -t)
    else if (z <= 3.8d-5) then
        tmp = t_2
    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 t_2 = (x / t) / y;
	double tmp;
	if (z <= -5e+20) {
		tmp = t_1;
	} else if (z <= -3.3e-113) {
		tmp = (-x / t) / z;
	} else if (z <= 2.3e-306) {
		tmp = x / (y * t);
	} else if (z <= 2.5e-188) {
		tmp = t_2;
	} else if (z <= 9e-107) {
		tmp = x / (z * -t);
	} else if (z <= 3.8e-5) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = x / (z * z)
	t_2 = (x / t) / y
	tmp = 0
	if z <= -5e+20:
		tmp = t_1
	elif z <= -3.3e-113:
		tmp = (-x / t) / z
	elif z <= 2.3e-306:
		tmp = x / (y * t)
	elif z <= 2.5e-188:
		tmp = t_2
	elif z <= 9e-107:
		tmp = x / (z * -t)
	elif z <= 3.8e-5:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(x / Float64(z * z))
	t_2 = Float64(Float64(x / t) / y)
	tmp = 0.0
	if (z <= -5e+20)
		tmp = t_1;
	elseif (z <= -3.3e-113)
		tmp = Float64(Float64(Float64(-x) / t) / z);
	elseif (z <= 2.3e-306)
		tmp = Float64(x / Float64(y * t));
	elseif (z <= 2.5e-188)
		tmp = t_2;
	elseif (z <= 9e-107)
		tmp = Float64(x / Float64(z * Float64(-t)));
	elseif (z <= 3.8e-5)
		tmp = t_2;
	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);
	t_2 = (x / t) / y;
	tmp = 0.0;
	if (z <= -5e+20)
		tmp = t_1;
	elseif (z <= -3.3e-113)
		tmp = (-x / t) / z;
	elseif (z <= 2.3e-306)
		tmp = x / (y * t);
	elseif (z <= 2.5e-188)
		tmp = t_2;
	elseif (z <= 9e-107)
		tmp = x / (z * -t);
	elseif (z <= 3.8e-5)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -5e+20], t$95$1, If[LessEqual[z, -3.3e-113], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 2.3e-306], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e-188], t$95$2, If[LessEqual[z, 9e-107], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e-5], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot z}\\
t_2 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;z \leq -5 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-188}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5e20 or 3.8000000000000002e-5 < z

    1. Initial program 86.9%

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

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

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

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

    if -5e20 < z < -3.3000000000000002e-113

    1. Initial program 95.9%

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{t \cdot z}} \]
      2. associate-/r*53.5%

        \[\leadsto -\color{blue}{\frac{\frac{x}{t}}{z}} \]
      3. distribute-neg-frac53.5%

        \[\leadsto \color{blue}{\frac{-\frac{x}{t}}{z}} \]
      4. distribute-neg-frac53.5%

        \[\leadsto \frac{\color{blue}{\frac{-x}{t}}}{z} \]
    5. Simplified53.5%

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

    if -3.3000000000000002e-113 < z < 2.29999999999999989e-306

    1. Initial program 95.1%

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

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

    if 2.29999999999999989e-306 < z < 2.5e-188 or 9.00000000000000032e-107 < z < 3.8000000000000002e-5

    1. Initial program 90.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified75.1%

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

    if 2.5e-188 < z < 9.00000000000000032e-107

    1. Initial program 99.8%

      \[\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)}} \]
    3. Taylor expanded in y around 0 51.8%

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

        \[\leadsto \frac{x}{\color{blue}{-t \cdot z}} \]
      2. distribute-rgt-neg-out51.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+20}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{-113}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-306}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-188}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-107}:\\ \;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot z}\\ \end{array} \]

Alternative 5: 91.8% accurate, 0.5× speedup?

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

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


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

    1. Initial program 95.4%

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

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

    1. Initial program 77.3%

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

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

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

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

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

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

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

Alternative 6: 79.4% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{y - z}}{t}\\ t_2 := \frac{\frac{x}{z}}{z - y}\\ \mathbf{if}\;z \leq -2.2 \cdot 10^{-40}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-23}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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 (- y z)) t)) (t_2 (/ (/ x z) (- z y))))
   (if (<= z -2.2e-40)
     t_2
     (if (<= z 1.4e-81)
       t_1
       (if (<= z 2.2e-52) (/ (/ x y) (- t z)) (if (<= z 1.3e-23) t_1 t_2))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / (y - z)) / t;
	double t_2 = (x / z) / (z - y);
	double tmp;
	if (z <= -2.2e-40) {
		tmp = t_2;
	} else if (z <= 1.4e-81) {
		tmp = t_1;
	} else if (z <= 2.2e-52) {
		tmp = (x / y) / (t - z);
	} else if (z <= 1.3e-23) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (x / (y - z)) / t
    t_2 = (x / z) / (z - y)
    if (z <= (-2.2d-40)) then
        tmp = t_2
    else if (z <= 1.4d-81) then
        tmp = t_1
    else if (z <= 2.2d-52) then
        tmp = (x / y) / (t - z)
    else if (z <= 1.3d-23) then
        tmp = t_1
    else
        tmp = t_2
    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 / (y - z)) / t;
	double t_2 = (x / z) / (z - y);
	double tmp;
	if (z <= -2.2e-40) {
		tmp = t_2;
	} else if (z <= 1.4e-81) {
		tmp = t_1;
	} else if (z <= 2.2e-52) {
		tmp = (x / y) / (t - z);
	} else if (z <= 1.3e-23) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / (y - z)) / t
	t_2 = (x / z) / (z - y)
	tmp = 0
	if z <= -2.2e-40:
		tmp = t_2
	elif z <= 1.4e-81:
		tmp = t_1
	elif z <= 2.2e-52:
		tmp = (x / y) / (t - z)
	elif z <= 1.3e-23:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / Float64(y - z)) / t)
	t_2 = Float64(Float64(x / z) / Float64(z - y))
	tmp = 0.0
	if (z <= -2.2e-40)
		tmp = t_2;
	elseif (z <= 1.4e-81)
		tmp = t_1;
	elseif (z <= 2.2e-52)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (z <= 1.3e-23)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / (y - z)) / t;
	t_2 = (x / z) / (z - y);
	tmp = 0.0;
	if (z <= -2.2e-40)
		tmp = t_2;
	elseif (z <= 1.4e-81)
		tmp = t_1;
	elseif (z <= 2.2e-52)
		tmp = (x / y) / (t - z);
	elseif (z <= 1.3e-23)
		tmp = t_1;
	else
		tmp = t_2;
	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[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e-40], t$95$2, If[LessEqual[z, 1.4e-81], t$95$1, If[LessEqual[z, 2.2e-52], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-23], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y - z}}{t}\\
t_2 := \frac{\frac{x}{z}}{z - y}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{-40}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-23}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.20000000000000009e-40 or 1.3e-23 < z

    1. Initial program 87.3%

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{-\left(y - z\right)} \]
      4. remove-double-neg82.5%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{-\left(y - z\right)} \]
      5. sub-neg82.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{-\color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. distribute-neg-in82.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      7. add-sqr-sqrt46.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      8. sqrt-unprod64.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      9. sqr-neg64.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      10. sqrt-prod24.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      11. add-sqr-sqrt57.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
      12. add-sqr-sqrt32.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      13. sqrt-unprod65.3%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      14. sqr-neg65.3%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \sqrt{\color{blue}{z \cdot z}}} \]
      15. sqrt-prod36.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      16. add-sqr-sqrt82.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{z}} \]
    6. Applied egg-rr82.5%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity82.5%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. neg-mul-182.5%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot y} + z} \]
      4. +-commutative82.5%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + -1 \cdot y}} \]
      5. neg-mul-182.5%

        \[\leadsto \frac{\frac{x}{z}}{z + \color{blue}{\left(-y\right)}} \]
      6. unsub-neg82.5%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - y}} \]
    8. Simplified82.5%

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

    if -2.20000000000000009e-40 < z < 1.3999999999999999e-81 or 2.20000000000000009e-52 < z < 1.3e-23

    1. Initial program 93.8%

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

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

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

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

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

    if 1.3999999999999999e-81 < z < 2.20000000000000009e-52

    1. Initial program 99.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-81}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-23}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \end{array} \]

Alternative 7: 79.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 83.1%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{-x}{z}}{-\left(y - z\right)}} \]
      2. div-inv84.1%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{-\left(y - z\right)} \]
      4. remove-double-neg84.1%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{-\left(y - z\right)} \]
      5. sub-neg84.1%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{-\color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. distribute-neg-in84.1%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      7. add-sqr-sqrt84.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      8. sqrt-unprod72.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      9. sqr-neg72.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      10. sqrt-prod0.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      11. add-sqr-sqrt58.8%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
      12. add-sqr-sqrt58.8%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      13. sqrt-unprod56.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      14. sqr-neg56.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \sqrt{\color{blue}{z \cdot z}}} \]
      15. sqrt-prod0.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      16. add-sqr-sqrt84.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity84.1%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. neg-mul-184.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot y} + z} \]
      4. +-commutative84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + -1 \cdot y}} \]
      5. neg-mul-184.1%

        \[\leadsto \frac{\frac{x}{z}}{z + \color{blue}{\left(-y\right)}} \]
      6. unsub-neg84.1%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z - y}} \]
    8. Simplified84.1%

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

    if -1.1200000000000001e-40 < z < 4.99999999999999981e-81

    1. Initial program 94.5%

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

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

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

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

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

    if 4.99999999999999981e-81 < z < 2.8500000000000002e-5

    1. Initial program 93.6%

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

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

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

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

    if 2.8500000000000002e-5 < z

    1. Initial program 92.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-81}:\\ \;\;\;\;\frac{\frac{x}{y - z}}{t}\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{z}}{t - z}\\ \end{array} \]

Alternative 8: 73.5% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{if}\;z \leq -2.6 \cdot 10^{+21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 6.1 \cdot 10^{+66}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - 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 (* (/ x z) (/ 1.0 z))))
   (if (<= z -2.6e+21)
     t_1
     (if (<= z 4.4e-81)
       (/ x (* (- y z) t))
       (if (<= z 6.1e+66) (/ x (* y (- t z))) t_1)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / z) * (1.0 / z);
	double tmp;
	if (z <= -2.6e+21) {
		tmp = t_1;
	} else if (z <= 4.4e-81) {
		tmp = x / ((y - z) * t);
	} else if (z <= 6.1e+66) {
		tmp = x / (y * (t - 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 = (x / z) * (1.0d0 / z)
    if (z <= (-2.6d+21)) then
        tmp = t_1
    else if (z <= 4.4d-81) then
        tmp = x / ((y - z) * t)
    else if (z <= 6.1d+66) then
        tmp = x / (y * (t - 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 = (x / z) * (1.0 / z);
	double tmp;
	if (z <= -2.6e+21) {
		tmp = t_1;
	} else if (z <= 4.4e-81) {
		tmp = x / ((y - z) * t);
	} else if (z <= 6.1e+66) {
		tmp = x / (y * (t - z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / z) * (1.0 / z)
	tmp = 0
	if z <= -2.6e+21:
		tmp = t_1
	elif z <= 4.4e-81:
		tmp = x / ((y - z) * t)
	elif z <= 6.1e+66:
		tmp = x / (y * (t - z))
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / z) * Float64(1.0 / z))
	tmp = 0.0
	if (z <= -2.6e+21)
		tmp = t_1;
	elseif (z <= 4.4e-81)
		tmp = Float64(x / Float64(Float64(y - z) * t));
	elseif (z <= 6.1e+66)
		tmp = Float64(x / Float64(y * Float64(t - 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 = (x / z) * (1.0 / z);
	tmp = 0.0;
	if (z <= -2.6e+21)
		tmp = t_1;
	elseif (z <= 4.4e-81)
		tmp = x / ((y - z) * t);
	elseif (z <= 6.1e+66)
		tmp = x / (y * (t - 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[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+21], t$95$1, If[LessEqual[z, 4.4e-81], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.1e+66], N[(x / N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{1}{z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+21}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.6e21 or 6.10000000000000021e66 < z

    1. Initial program 84.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
      2. div-inv86.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    6. Applied egg-rr86.0%

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

    if -2.6e21 < z < 4.3999999999999998e-81

    1. Initial program 94.2%

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

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

    if 4.3999999999999998e-81 < z < 6.10000000000000021e66

    1. Initial program 96.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.6 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-81}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 6.1 \cdot 10^{+66}:\\ \;\;\;\;\frac{x}{y \cdot \left(t - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \end{array} \]

Alternative 9: 74.1% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;z \leq 5 \cdot 10^{+66}:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2e21 or 4.99999999999999991e66 < z

    1. Initial program 84.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
      2. div-inv86.0%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    6. Applied egg-rr86.0%

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

    if -3.2e21 < z < 2.2499999999999999e-82

    1. Initial program 94.2%

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

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

    if 2.2499999999999999e-82 < z < 4.99999999999999991e66

    1. Initial program 96.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+21}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \end{array} \]

Alternative 10: 72.5% accurate, 0.8× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.14 \cdot 10^{+21} \lor \neg \left(z \leq 3.6 \cdot 10^{-37}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \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.14e+21) (not (<= z 3.6e-37)))
   (* (/ x z) (/ 1.0 z))
   (/ x (* (- y z) t))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.14e+21) || !(z <= 3.6e-37)) {
		tmp = (x / z) * (1.0 / z);
	} else {
		tmp = x / ((y - z) * t);
	}
	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.14d+21)) .or. (.not. (z <= 3.6d-37))) then
        tmp = (x / z) * (1.0d0 / z)
    else
        tmp = x / ((y - z) * t)
    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.14e+21) || !(z <= 3.6e-37)) {
		tmp = (x / z) * (1.0 / z);
	} else {
		tmp = x / ((y - z) * t);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.14e+21) or not (z <= 3.6e-37):
		tmp = (x / z) * (1.0 / z)
	else:
		tmp = x / ((y - z) * t)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.14e+21) || !(z <= 3.6e-37))
		tmp = Float64(Float64(x / z) * Float64(1.0 / z));
	else
		tmp = Float64(x / Float64(Float64(y - z) * t));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -1.14e+21) || ~((z <= 3.6e-37)))
		tmp = (x / z) * (1.0 / z);
	else
		tmp = x / ((y - z) * t);
	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.14e+21], N[Not[LessEqual[z, 3.6e-37]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{+21} \lor \neg \left(z \leq 3.6 \cdot 10^{-37}\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.14e21 or 3.60000000000000007e-37 < z

    1. Initial program 86.4%

      \[\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. associate-/r*78.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{z}}{z}} \]
      2. div-inv78.9%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \frac{1}{z}} \]
    6. Applied egg-rr78.9%

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

    if -1.14e21 < z < 3.60000000000000007e-37

    1. Initial program 94.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.14 \cdot 10^{+21} \lor \neg \left(z \leq 3.6 \cdot 10^{-37}\right):\\ \;\;\;\;\frac{x}{z} \cdot \frac{1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \]

Alternative 11: 46.3% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -6.2 \cdot 10^{+43} \lor \neg \left(z \leq 4.5 \cdot 10^{+66}\right):\\ \;\;\;\;\frac{x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \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 -6.2e+43) (not (<= z 4.5e+66))) (/ x (* z t)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -6.2e+43) || !(z <= 4.5e+66)) {
		tmp = x / (z * t);
	} else {
		tmp = x / (y * t);
	}
	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 <= (-6.2d+43)) .or. (.not. (z <= 4.5d+66))) then
        tmp = x / (z * t)
    else
        tmp = x / (y * t)
    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 <= -6.2e+43) || !(z <= 4.5e+66)) {
		tmp = x / (z * t);
	} else {
		tmp = x / (y * t);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -6.2e+43) or not (z <= 4.5e+66):
		tmp = x / (z * t)
	else:
		tmp = x / (y * t)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -6.2e+43) || !(z <= 4.5e+66))
		tmp = Float64(x / Float64(z * t));
	else
		tmp = Float64(x / Float64(y * t));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -6.2e+43) || ~((z <= 4.5e+66)))
		tmp = x / (z * t);
	else
		tmp = x / (y * t);
	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, -6.2e+43], N[Not[LessEqual[z, 4.5e+66]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+43} \lor \neg \left(z \leq 4.5 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.2000000000000003e43 or 4.4999999999999998e66 < z

    1. Initial program 84.2%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{-t \cdot z}} \]
      2. distribute-rgt-neg-out42.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{-t \cdot \left(-z\right)}\right)} - 1 \]
      9. distribute-rgt-neg-out62.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{-\color{blue}{\left(-t \cdot z\right)}}\right)} - 1 \]
      10. remove-double-neg62.2%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    9. Simplified39.6%

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

    if -6.2000000000000003e43 < z < 4.4999999999999998e66

    1. Initial program 95.0%

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

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

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

Alternative 12: 61.8% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -4.45 \cdot 10^{-72} \lor \neg \left(z \leq 3 \cdot 10^{-41}\right):\\ \;\;\;\;\frac{x}{z \cdot z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \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 -4.45e-72) (not (<= z 3e-41))) (/ x (* z z)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.45e-72) || !(z <= 3e-41)) {
		tmp = x / (z * z);
	} else {
		tmp = x / (y * t);
	}
	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 <= (-4.45d-72)) .or. (.not. (z <= 3d-41))) then
        tmp = x / (z * z)
    else
        tmp = x / (y * t)
    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 <= -4.45e-72) || !(z <= 3e-41)) {
		tmp = x / (z * z);
	} else {
		tmp = x / (y * t);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if (z <= -4.45e-72) or not (z <= 3e-41):
		tmp = x / (z * z)
	else:
		tmp = x / (y * t)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -4.45e-72) || !(z <= 3e-41))
		tmp = Float64(x / Float64(z * z));
	else
		tmp = Float64(x / Float64(y * t));
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -4.45e-72) || ~((z <= 3e-41)))
		tmp = x / (z * z);
	else
		tmp = x / (y * t);
	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, -4.45e-72], N[Not[LessEqual[z, 3e-41]], $MachinePrecision]], N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.45 \cdot 10^{-72} \lor \neg \left(z \leq 3 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x}{z \cdot z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.4499999999999999e-72 or 2.99999999999999989e-41 < z

    1. Initial program 87.2%

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

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

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

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

    if -4.4499999999999999e-72 < z < 2.99999999999999989e-41

    1. Initial program 94.9%

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

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

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

Alternative 13: 63.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+18} \lor \neg \left(z \leq 0.0165\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 -1.6e+18) (not (<= z 0.0165))) (/ x (* z z)) (/ (/ x t) y)))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.6e+18) || !(z <= 0.0165)) {
		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.6d+18)) .or. (.not. (z <= 0.0165d0))) 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.6e+18) || !(z <= 0.0165)) {
		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.6e+18) or not (z <= 0.0165):
		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.6e+18) || !(z <= 0.0165))
		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 <= -1.6e+18) || ~((z <= 0.0165)))
		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.6e+18], N[Not[LessEqual[z, 0.0165]], $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 -1.6 \cdot 10^{+18} \lor \neg \left(z \leq 0.0165\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 < -1.6e18 or 0.016500000000000001 < z

    1. Initial program 87.0%

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

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

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

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

    if -1.6e18 < z < 0.016500000000000001

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
    4. Simplified65.1%

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

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

Alternative 14: 78.8% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.05 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \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 (<= t 1.05e-65) (/ (/ x z) (- z y)) (/ (/ x t) (- y z))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.05e-65) {
		tmp = (x / z) / (z - y);
	} 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 (t <= 1.05d-65) then
        tmp = (x / z) / (z - y)
    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 (t <= 1.05e-65) {
		tmp = (x / z) / (z - y);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 1.05e-65:
		tmp = (x / z) / (z - y)
	else:
		tmp = (x / t) / (y - z)
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 1.05e-65)
		tmp = Float64(Float64(x / z) / Float64(z - y));
	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 (t <= 1.05e-65)
		tmp = (x / z) / (z - y);
	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[t, 1.05e-65], N[(N[(x / z), $MachinePrecision] / N[(z - y), $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}\;t \leq 1.05 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{x}{z}}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.05000000000000001e-65

    1. Initial program 91.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{-x}{z}}{y - z}} \]
    5. Step-by-step derivation
      1. frac-2neg64.4%

        \[\leadsto \color{blue}{\frac{-\frac{-x}{z}}{-\left(y - z\right)}} \]
      2. div-inv64.4%

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

        \[\leadsto \left(-\color{blue}{\left(-\frac{x}{z}\right)}\right) \cdot \frac{1}{-\left(y - z\right)} \]
      4. remove-double-neg64.4%

        \[\leadsto \color{blue}{\frac{x}{z}} \cdot \frac{1}{-\left(y - z\right)} \]
      5. sub-neg64.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{-\color{blue}{\left(y + \left(-z\right)\right)}} \]
      6. distribute-neg-in64.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\color{blue}{\left(-y\right) + \left(-\left(-z\right)\right)}} \]
      7. add-sqr-sqrt35.9%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{-z} \cdot \sqrt{-z}}\right)} \]
      8. sqrt-unprod48.3%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}\right)} \]
      9. sqr-neg48.3%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\sqrt{\color{blue}{z \cdot z}}\right)} \]
      10. sqrt-prod18.7%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{\sqrt{z} \cdot \sqrt{z}}\right)} \]
      11. add-sqr-sqrt41.5%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \left(-\color{blue}{z}\right)} \]
      12. add-sqr-sqrt22.8%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{-z} \cdot \sqrt{-z}}} \]
      13. sqrt-unprod49.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}}} \]
      14. sqr-neg49.0%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \sqrt{\color{blue}{z \cdot z}}} \]
      15. sqrt-prod28.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} \]
      16. add-sqr-sqrt64.4%

        \[\leadsto \frac{x}{z} \cdot \frac{1}{\left(-y\right) + \color{blue}{z}} \]
    6. Applied egg-rr64.4%

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

        \[\leadsto \color{blue}{\frac{\frac{x}{z} \cdot 1}{\left(-y\right) + z}} \]
      2. *-rgt-identity64.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{z}}}{\left(-y\right) + z} \]
      3. neg-mul-164.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{-1 \cdot y} + z} \]
      4. +-commutative64.4%

        \[\leadsto \frac{\frac{x}{z}}{\color{blue}{z + -1 \cdot y}} \]
      5. neg-mul-164.4%

        \[\leadsto \frac{\frac{x}{z}}{z + \color{blue}{\left(-y\right)}} \]
      6. unsub-neg64.4%

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

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

    if 1.05000000000000001e-65 < t

    1. Initial program 89.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.05 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 15: 97.1% 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 90.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t - z}}{y - z}} \]
    2. un-div-inv96.6%

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

    \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
  6. Final simplification96.6%

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

Alternative 16: 39.7% accurate, 1.8× speedup?

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

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

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

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

Developer target: 88.1% 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 2023293 
(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))))