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

Percentage Accurate: 88.9% → 98.7%
Time: 12.6s
Alternatives: 15
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 88.9% 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: 98.7% accurate, 0.4× 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 -2 \cdot 10^{+295} \lor \neg \left(t_1 \leq 2 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{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 (* (- y z) (- t z))))
   (if (or (<= t_1 -2e+295) (not (<= t_1 2e+193)))
     (/ (/ x (- y z)) (- t z))
     (/ x t_1))))
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 <= -2e+295) || !(t_1 <= 2e+193)) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x / 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 = (y - z) * (t - z)
    if ((t_1 <= (-2d+295)) .or. (.not. (t_1 <= 2d+193))) then
        tmp = (x / (y - z)) / (t - z)
    else
        tmp = x / 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 = (y - z) * (t - z);
	double tmp;
	if ((t_1 <= -2e+295) || !(t_1 <= 2e+193)) {
		tmp = (x / (y - z)) / (t - z);
	} else {
		tmp = x / t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (y - z) * (t - z)
	tmp = 0
	if (t_1 <= -2e+295) or not (t_1 <= 2e+193):
		tmp = (x / (y - z)) / (t - z)
	else:
		tmp = x / t_1
	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 <= -2e+295) || !(t_1 <= 2e+193))
		tmp = Float64(Float64(x / Float64(y - z)) / Float64(t - z));
	else
		tmp = Float64(x / t_1);
	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 <= -2e+295) || ~((t_1 <= 2e+193)))
		tmp = (x / (y - z)) / (t - z);
	else
		tmp = x / 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[(y - z), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+295], N[Not[LessEqual[t$95$1, 2e+193]], $MachinePrecision]], N[(N[(x / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x / t$95$1), $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 -2 \cdot 10^{+295} \lor \neg \left(t_1 \leq 2 \cdot 10^{+193}\right):\\
\;\;\;\;\frac{\frac{x}{y - z}}{t - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 y z) (-.f64 t z)) < -2e295 or 2.00000000000000013e193 < (*.f64 (-.f64 y z) (-.f64 t z))

    1. Initial program 81.1%

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

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}} \]
    4. Taylor expanded in x around 0 81.1%

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

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

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

    if -2e295 < (*.f64 (-.f64 y z) (-.f64 t z)) < 2.00000000000000013e193

    1. Initial program 98.9%

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

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

Alternative 2: 51.6% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{t}}{y}\\ \mathbf{if}\;t \leq -2.15 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-16}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+171}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{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 (/ (/ x t) y)))
   (if (<= t -2.15e-47)
     t_1
     (if (<= t 1.55e-16)
       (/ (- x) (* y z))
       (if (<= t 3.2e+143)
         (/ (- x) (* z t))
         (if (<= t 2.5e+171) t_1 (/ (/ (- x) t) z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / t) / y;
	double tmp;
	if (t <= -2.15e-47) {
		tmp = t_1;
	} else if (t <= 1.55e-16) {
		tmp = -x / (y * z);
	} else if (t <= 3.2e+143) {
		tmp = -x / (z * t);
	} else if (t <= 2.5e+171) {
		tmp = t_1;
	} else {
		tmp = (-x / 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 = (x / t) / y
    if (t <= (-2.15d-47)) then
        tmp = t_1
    else if (t <= 1.55d-16) then
        tmp = -x / (y * z)
    else if (t <= 3.2d+143) then
        tmp = -x / (z * t)
    else if (t <= 2.5d+171) then
        tmp = t_1
    else
        tmp = (-x / 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 = (x / t) / y;
	double tmp;
	if (t <= -2.15e-47) {
		tmp = t_1;
	} else if (t <= 1.55e-16) {
		tmp = -x / (y * z);
	} else if (t <= 3.2e+143) {
		tmp = -x / (z * t);
	} else if (t <= 2.5e+171) {
		tmp = t_1;
	} else {
		tmp = (-x / t) / z;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / t) / y
	tmp = 0
	if t <= -2.15e-47:
		tmp = t_1
	elif t <= 1.55e-16:
		tmp = -x / (y * z)
	elif t <= 3.2e+143:
		tmp = -x / (z * t)
	elif t <= 2.5e+171:
		tmp = t_1
	else:
		tmp = (-x / t) / z
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / t) / y)
	tmp = 0.0
	if (t <= -2.15e-47)
		tmp = t_1;
	elseif (t <= 1.55e-16)
		tmp = Float64(Float64(-x) / Float64(y * z));
	elseif (t <= 3.2e+143)
		tmp = Float64(Float64(-x) / Float64(z * t));
	elseif (t <= 2.5e+171)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(-x) / t) / z);
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / t) / y;
	tmp = 0.0;
	if (t <= -2.15e-47)
		tmp = t_1;
	elseif (t <= 1.55e-16)
		tmp = -x / (y * z);
	elseif (t <= 3.2e+143)
		tmp = -x / (z * t);
	elseif (t <= 2.5e+171)
		tmp = t_1;
	else
		tmp = (-x / 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[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -2.15e-47], t$95$1, If[LessEqual[t, 1.55e-16], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+171], t$95$1, N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-47}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 3.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+171}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.1499999999999999e-47 or 3.20000000000000016e143 < t < 2.5000000000000002e171

    1. Initial program 82.0%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. div-inv51.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t}}{y}} \]
    4. Applied egg-rr50.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t}}{y}} \]
      2. div-inv60.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y} \]
    6. Applied egg-rr60.8%

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

    if -2.1499999999999999e-47 < t < 1.55e-16

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{y \cdot z} \]
      3. *-commutative44.4%

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

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

    if 1.55e-16 < t < 3.20000000000000016e143

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-163.6%

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

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

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

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

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

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

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

    if 2.5000000000000002e171 < t

    1. Initial program 83.1%

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

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-x}{t}}}{z} \]
    7. Applied egg-rr80.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 1.55 \cdot 10^{-16}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+171}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \end{array} \]

Alternative 3: 53.4% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{t}}{y}\\ \mathbf{if}\;t \leq -2.15 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+171}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{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 (/ (/ x t) y)))
   (if (<= t -2.15e-44)
     t_1
     (if (<= t 8e-14)
       (/ (/ (- x) z) y)
       (if (<= t 8e+143)
         (/ (- x) (* z t))
         (if (<= t 1.8e+171) t_1 (/ (/ (- x) t) z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / t) / y;
	double tmp;
	if (t <= -2.15e-44) {
		tmp = t_1;
	} else if (t <= 8e-14) {
		tmp = (-x / z) / y;
	} else if (t <= 8e+143) {
		tmp = -x / (z * t);
	} else if (t <= 1.8e+171) {
		tmp = t_1;
	} else {
		tmp = (-x / 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 = (x / t) / y
    if (t <= (-2.15d-44)) then
        tmp = t_1
    else if (t <= 8d-14) then
        tmp = (-x / z) / y
    else if (t <= 8d+143) then
        tmp = -x / (z * t)
    else if (t <= 1.8d+171) then
        tmp = t_1
    else
        tmp = (-x / 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 = (x / t) / y;
	double tmp;
	if (t <= -2.15e-44) {
		tmp = t_1;
	} else if (t <= 8e-14) {
		tmp = (-x / z) / y;
	} else if (t <= 8e+143) {
		tmp = -x / (z * t);
	} else if (t <= 1.8e+171) {
		tmp = t_1;
	} else {
		tmp = (-x / t) / z;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / t) / y
	tmp = 0
	if t <= -2.15e-44:
		tmp = t_1
	elif t <= 8e-14:
		tmp = (-x / z) / y
	elif t <= 8e+143:
		tmp = -x / (z * t)
	elif t <= 1.8e+171:
		tmp = t_1
	else:
		tmp = (-x / t) / z
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / t) / y)
	tmp = 0.0
	if (t <= -2.15e-44)
		tmp = t_1;
	elseif (t <= 8e-14)
		tmp = Float64(Float64(Float64(-x) / z) / y);
	elseif (t <= 8e+143)
		tmp = Float64(Float64(-x) / Float64(z * t));
	elseif (t <= 1.8e+171)
		tmp = t_1;
	else
		tmp = Float64(Float64(Float64(-x) / t) / z);
	end
	return tmp
end
y, t = num2cell(sort([y, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = (x / t) / y;
	tmp = 0.0;
	if (t <= -2.15e-44)
		tmp = t_1;
	elseif (t <= 8e-14)
		tmp = (-x / z) / y;
	elseif (t <= 8e+143)
		tmp = -x / (z * t);
	elseif (t <= 1.8e+171)
		tmp = t_1;
	else
		tmp = (-x / 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[(x / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -2.15e-44], t$95$1, If[LessEqual[t, 8e-14], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 8e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+171], t$95$1, N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-44}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 8 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\

\mathbf{elif}\;t \leq 1.8 \cdot 10^{+171}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.15000000000000007e-44 or 8.0000000000000002e143 < t < 1.80000000000000009e171

    1. Initial program 82.0%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. div-inv51.0%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t}}{y}} \]
    4. Applied egg-rr50.9%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t}}{y}} \]
      2. div-inv60.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y} \]
    6. Applied egg-rr60.8%

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

    if -2.15000000000000007e-44 < t < 7.99999999999999999e-14

    1. Initial program 92.5%

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

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

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

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

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

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

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

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

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

    if 7.99999999999999999e-14 < t < 8.0000000000000002e143

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-163.6%

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

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

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

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

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

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

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

    if 1.80000000000000009e171 < t

    1. Initial program 83.1%

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

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-x}{t}}}{z} \]
    7. Applied egg-rr80.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{-44}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-14}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+171}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-x}{t}}{z}\\ \end{array} \]

Alternative 4: 83.2% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.19999999999999996e-183

    1. Initial program 85.3%

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

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

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

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

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

    if -1.19999999999999996e-183 < t < 1.74999999999999997e-6

    1. Initial program 93.1%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}} \]
    4. Taylor expanded in t around 0 80.8%

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

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

        \[\leadsto -\color{blue}{\frac{\frac{x}{z}}{y - z}} \]
    6. Simplified85.0%

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

    if 1.74999999999999997e-6 < t < 4.5000000000000002e185

    1. Initial program 97.9%

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

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

    if 4.5000000000000002e185 < t

    1. Initial program 81.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. *-un-lft-identity81.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+185}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 5: 51.1% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{t}}{y}\\ \mathbf{if}\;t \leq -6.2 \cdot 10^{-50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \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 t) y)))
   (if (<= t -6.2e-50)
     t_1
     (if (<= t 5.3e-14)
       (/ (- x) (* y z))
       (if (<= t 1.36e+143) (/ (- x) (* z t)) t_1)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / t) / y;
	double tmp;
	if (t <= -6.2e-50) {
		tmp = t_1;
	} else if (t <= 5.3e-14) {
		tmp = -x / (y * z);
	} else if (t <= 1.36e+143) {
		tmp = -x / (z * t);
	} 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 / t) / y
    if (t <= (-6.2d-50)) then
        tmp = t_1
    else if (t <= 5.3d-14) then
        tmp = -x / (y * z)
    else if (t <= 1.36d+143) then
        tmp = -x / (z * t)
    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 / t) / y;
	double tmp;
	if (t <= -6.2e-50) {
		tmp = t_1;
	} else if (t <= 5.3e-14) {
		tmp = -x / (y * z);
	} else if (t <= 1.36e+143) {
		tmp = -x / (z * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / t) / y
	tmp = 0
	if t <= -6.2e-50:
		tmp = t_1
	elif t <= 5.3e-14:
		tmp = -x / (y * z)
	elif t <= 1.36e+143:
		tmp = -x / (z * t)
	else:
		tmp = t_1
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / t) / y)
	tmp = 0.0
	if (t <= -6.2e-50)
		tmp = t_1;
	elseif (t <= 5.3e-14)
		tmp = Float64(Float64(-x) / Float64(y * z));
	elseif (t <= 1.36e+143)
		tmp = Float64(Float64(-x) / Float64(z * t));
	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 / t) / y;
	tmp = 0.0;
	if (t <= -6.2e-50)
		tmp = t_1;
	elseif (t <= 5.3e-14)
		tmp = -x / (y * z);
	elseif (t <= 1.36e+143)
		tmp = -x / (z * t);
	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 / t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -6.2e-50], t$95$1, If[LessEqual[t, 5.3e-14], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.36e+143], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{t}}{y}\\
\mathbf{if}\;t \leq -6.2 \cdot 10^{-50}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 1.36 \cdot 10^{+143}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.2000000000000004e-50 or 1.3599999999999999e143 < t

    1. Initial program 82.5%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. div-inv49.5%

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{t}}{y}} \]
    4. Applied egg-rr49.4%

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t}}{y}} \]
      2. div-inv63.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y} \]
    6. Applied egg-rr63.8%

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

    if -6.2000000000000004e-50 < t < 5.3000000000000001e-14

    1. Initial program 92.5%

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

      \[\leadsto \frac{x}{\color{blue}{t \cdot y + z \cdot \left(-1 \cdot t + -1 \cdot y\right)}} \]
    3. Step-by-step derivation
      1. distribute-lft-out62.0%

        \[\leadsto \frac{x}{t \cdot y + z \cdot \color{blue}{\left(-1 \cdot \left(t + y\right)\right)}} \]
      2. mul-1-neg62.0%

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

        \[\leadsto \frac{x}{t \cdot y + \color{blue}{\left(-z \cdot \left(t + y\right)\right)}} \]
      4. unsub-neg62.0%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{y \cdot z} \]
      3. *-commutative44.8%

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

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

    if 5.3000000000000001e-14 < t < 1.3599999999999999e143

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-163.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;t \leq 1.36 \cdot 10^{+143}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]

Alternative 6: 66.6% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.46000000000000003e-52 or 9.8000000000000005e-135 < t

    1. Initial program 87.8%

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

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

    if -1.46000000000000003e-52 < t < 9.8000000000000005e-135

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.8% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.34999999999999985e-78

    1. Initial program 88.3%

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

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

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

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

    if 2.34999999999999985e-78 < t < 2.1e185

    1. Initial program 96.9%

      \[\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)}} \]

    if 2.1e185 < t

    1. Initial program 81.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. *-un-lft-identity81.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

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

Alternative 8: 75.5% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.1e-14

    1. Initial program 88.3%

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

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

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

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

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

    if 1.1e-14 < t < 2.2500000000000001e185

    1. Initial program 98.1%

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

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

    if 2.2500000000000001e185 < t

    1. Initial program 81.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. *-un-lft-identity81.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

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

Alternative 9: 91.2% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.34999999999999986e185

    1. Initial program 90.6%

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

    if 2.34999999999999986e185 < t

    1. Initial program 81.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Step-by-step derivation
      1. *-un-lft-identity81.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
      2. times-frac99.9%

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

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

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

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

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

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

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

Alternative 10: 96.8% accurate, 0.8× speedup?

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

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

      \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. times-frac96.0%

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

    \[\leadsto \color{blue}{\frac{1}{y - z} \cdot \frac{x}{t - z}} \]
  4. Final simplification96.0%

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

Alternative 11: 50.0% accurate, 0.9× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-12} \lor \neg \left(z \leq 2.5 \cdot 10^{-45}\right):\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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 -2e-12) (not (<= z 2.5e-45))) (/ (- x) (* z t)) (/ (/ x y) t)))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -2e-12) || !(z <= 2.5e-45)) {
		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 <= (-2d-12)) .or. (.not. (z <= 2.5d-45))) 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 <= -2e-12) || !(z <= 2.5e-45)) {
		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 <= -2e-12) or not (z <= 2.5e-45):
		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 <= -2e-12) || !(z <= 2.5e-45))
		tmp = Float64(Float64(-x) / Float64(z * t));
	else
		tmp = Float64(Float64(x / 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 <= -2e-12) || ~((z <= 2.5e-45)))
		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, -2e-12], N[Not[LessEqual[z, 2.5e-45]], $MachinePrecision]], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-12} \lor \neg \left(z \leq 2.5 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{-x}{z \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.99999999999999996e-12 or 2.49999999999999988e-45 < z

    1. Initial program 87.7%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-177.2%

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

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

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

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

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

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

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

    if -1.99999999999999996e-12 < z < 2.49999999999999988e-45

    1. Initial program 92.4%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. *-un-lft-identity56.7%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{t \cdot y} \]
      2. times-frac64.7%

        \[\leadsto \color{blue}{\frac{1}{t} \cdot \frac{x}{y}} \]
    4. Applied egg-rr64.7%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{t}} \]
      2. *-lft-identity64.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{t} \]
    6. Simplified64.7%

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

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

Alternative 12: 46.6% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+57} \lor \neg \left(z \leq 8.2 \cdot 10^{+32}\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 -1.32e+57) (not (<= z 8.2e+32))) (/ x (* z t)) (/ x (* y t))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.32e+57) || !(z <= 8.2e+32)) {
		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 <= (-1.32d+57)) .or. (.not. (z <= 8.2d+32))) 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 <= -1.32e+57) || !(z <= 8.2e+32)) {
		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 <= -1.32e+57) or not (z <= 8.2e+32):
		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 <= -1.32e+57) || !(z <= 8.2e+32))
		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 <= -1.32e+57) || ~((z <= 8.2e+32)))
		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, -1.32e+57], N[Not[LessEqual[z, 8.2e+32]], $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 -1.32 \cdot 10^{+57} \lor \neg \left(z \leq 8.2 \cdot 10^{+32}\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 < -1.32000000000000001e57 or 8.19999999999999961e32 < z

    1. Initial program 84.7%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-181.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. *-commutative43.5%

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

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

    if -1.32000000000000001e57 < z < 8.19999999999999961e32

    1. Initial program 93.7%

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

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

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

Alternative 13: 48.8% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8999999999999999e57 or 2.20000000000000001e32 < z

    1. Initial program 84.7%

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot x}{z \cdot \left(t - z\right)}} \]
      2. neg-mul-181.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot z}} \]
    10. Step-by-step derivation
      1. *-commutative43.5%

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

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

    if -1.8999999999999999e57 < z < 2.20000000000000001e32

    1. Initial program 93.7%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    3. Step-by-step derivation
      1. div-inv52.3%

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{t}}{y}} \]
      2. div-inv56.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{t}}}{y} \]
    6. Applied egg-rr56.7%

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

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

Alternative 14: 71.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 88.3%

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

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

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

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

    if 7.50000000000000041e-78 < t

    1. Initial program 92.3%

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

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

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

Alternative 15: 39.3% 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 89.7%

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

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

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

Developer target: 87.9% 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 2023314 
(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))))