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

Percentage Accurate: 88.9% → 97.7%
Time: 12.5s
Alternatives: 16
Speedup: 0.7×

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: 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: 97.7% accurate, 0.5× speedup?

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

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


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

    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-frac97.3%

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

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

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

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

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

    if -0.0 < (/.f64 x (*.f64 (-.f64 y z) (-.f64 t z)))

    1. Initial program 99.2%

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

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

Alternative 2: 51.9% accurate, 0.5× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{y}}{t}\\ t_2 := \frac{\frac{x}{t}}{y}\\ t_3 := \frac{-x}{z \cdot t}\\ \mathbf{if}\;t \leq -5 \cdot 10^{-24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+119}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\ \;\;\;\;t_3\\ \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) t)) (t_2 (/ (/ x t) y)) (t_3 (/ (- x) (* z t))))
   (if (<= t -5e-24)
     t_2
     (if (<= t 5e-121)
       (/ (/ (- x) z) y)
       (if (<= t 2.8e+88)
         t_1
         (if (<= t 1.5e+119)
           t_3
           (if (<= t 6.5e+149) t_1 (if (<= t 1.22e+243) t_3 t_2))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) / t;
	double t_2 = (x / t) / y;
	double t_3 = -x / (z * t);
	double tmp;
	if (t <= -5e-24) {
		tmp = t_2;
	} else if (t <= 5e-121) {
		tmp = (-x / z) / y;
	} else if (t <= 2.8e+88) {
		tmp = t_1;
	} else if (t <= 1.5e+119) {
		tmp = t_3;
	} else if (t <= 6.5e+149) {
		tmp = t_1;
	} else if (t <= 1.22e+243) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = (x / y) / t
    t_2 = (x / t) / y
    t_3 = -x / (z * t)
    if (t <= (-5d-24)) then
        tmp = t_2
    else if (t <= 5d-121) then
        tmp = (-x / z) / y
    else if (t <= 2.8d+88) then
        tmp = t_1
    else if (t <= 1.5d+119) then
        tmp = t_3
    else if (t <= 6.5d+149) then
        tmp = t_1
    else if (t <= 1.22d+243) then
        tmp = t_3
    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) / t;
	double t_2 = (x / t) / y;
	double t_3 = -x / (z * t);
	double tmp;
	if (t <= -5e-24) {
		tmp = t_2;
	} else if (t <= 5e-121) {
		tmp = (-x / z) / y;
	} else if (t <= 2.8e+88) {
		tmp = t_1;
	} else if (t <= 1.5e+119) {
		tmp = t_3;
	} else if (t <= 6.5e+149) {
		tmp = t_1;
	} else if (t <= 1.22e+243) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / y) / t
	t_2 = (x / t) / y
	t_3 = -x / (z * t)
	tmp = 0
	if t <= -5e-24:
		tmp = t_2
	elif t <= 5e-121:
		tmp = (-x / z) / y
	elif t <= 2.8e+88:
		tmp = t_1
	elif t <= 1.5e+119:
		tmp = t_3
	elif t <= 6.5e+149:
		tmp = t_1
	elif t <= 1.22e+243:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) / t)
	t_2 = Float64(Float64(x / t) / y)
	t_3 = Float64(Float64(-x) / Float64(z * t))
	tmp = 0.0
	if (t <= -5e-24)
		tmp = t_2;
	elseif (t <= 5e-121)
		tmp = Float64(Float64(Float64(-x) / z) / y);
	elseif (t <= 2.8e+88)
		tmp = t_1;
	elseif (t <= 1.5e+119)
		tmp = t_3;
	elseif (t <= 6.5e+149)
		tmp = t_1;
	elseif (t <= 1.22e+243)
		tmp = t_3;
	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) / t;
	t_2 = (x / t) / y;
	t_3 = -x / (z * t);
	tmp = 0.0;
	if (t <= -5e-24)
		tmp = t_2;
	elseif (t <= 5e-121)
		tmp = (-x / z) / y;
	elseif (t <= 2.8e+88)
		tmp = t_1;
	elseif (t <= 1.5e+119)
		tmp = t_3;
	elseif (t <= 6.5e+149)
		tmp = t_1;
	elseif (t <= 1.22e+243)
		tmp = t_3;
	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 / y), $MachinePrecision] / t), $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[t, -5e-24], t$95$2, If[LessEqual[t, 5e-121], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 2.8e+88], t$95$1, If[LessEqual[t, 1.5e+119], t$95$3, If[LessEqual[t, 6.5e+149], t$95$1, If[LessEqual[t, 1.22e+243], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y}}{t}\\
t_2 := \frac{\frac{x}{t}}{y}\\
t_3 := \frac{-x}{z \cdot t}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-24}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;t \leq 2.8 \cdot 10^{+88}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+119}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+149}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.9999999999999998e-24 or 1.21999999999999993e243 < t

    1. Initial program 83.7%

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

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

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

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

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

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

    if -4.9999999999999998e-24 < t < 4.99999999999999989e-121

    1. Initial program 90.9%

      \[\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*65.0%

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

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

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

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

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

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

    if 4.99999999999999989e-121 < t < 2.79999999999999989e88 or 1.50000000000000001e119 < t < 6.50000000000000015e149

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    if 2.79999999999999989e88 < t < 1.50000000000000001e119 or 6.50000000000000015e149 < t < 1.21999999999999993e243

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5 \cdot 10^{-24}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{elif}\;t \leq 5 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+119}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]

Alternative 3: 51.8% accurate, 0.5× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} t_1 := \frac{\frac{x}{y}}{t}\\ t_2 := \frac{-x}{z \cdot t}\\ \mathbf{if}\;t \leq -2.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+112}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+149}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\ \;\;\;\;t_2\\ \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
 (let* ((t_1 (/ (/ x y) t)) (t_2 (/ (- x) (* z t))))
   (if (<= t -2.1e-23)
     (/ 1.0 (* y (/ t x)))
     (if (<= t 5.3e-121)
       (/ (/ (- x) z) y)
       (if (<= t 1.5e+88)
         t_1
         (if (<= t 1.1e+112)
           t_2
           (if (<= t 7.2e+149)
             t_1
             (if (<= t 1.22e+243) t_2 (/ (/ x t) y)))))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double t_1 = (x / y) / t;
	double t_2 = -x / (z * t);
	double tmp;
	if (t <= -2.1e-23) {
		tmp = 1.0 / (y * (t / x));
	} else if (t <= 5.3e-121) {
		tmp = (-x / z) / y;
	} else if (t <= 1.5e+88) {
		tmp = t_1;
	} else if (t <= 1.1e+112) {
		tmp = t_2;
	} else if (t <= 7.2e+149) {
		tmp = t_1;
	} else if (t <= 1.22e+243) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x / y) / t
    t_2 = -x / (z * t)
    if (t <= (-2.1d-23)) then
        tmp = 1.0d0 / (y * (t / x))
    else if (t <= 5.3d-121) then
        tmp = (-x / z) / y
    else if (t <= 1.5d+88) then
        tmp = t_1
    else if (t <= 1.1d+112) then
        tmp = t_2
    else if (t <= 7.2d+149) then
        tmp = t_1
    else if (t <= 1.22d+243) then
        tmp = t_2
    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 t_1 = (x / y) / t;
	double t_2 = -x / (z * t);
	double tmp;
	if (t <= -2.1e-23) {
		tmp = 1.0 / (y * (t / x));
	} else if (t <= 5.3e-121) {
		tmp = (-x / z) / y;
	} else if (t <= 1.5e+88) {
		tmp = t_1;
	} else if (t <= 1.1e+112) {
		tmp = t_2;
	} else if (t <= 7.2e+149) {
		tmp = t_1;
	} else if (t <= 1.22e+243) {
		tmp = t_2;
	} else {
		tmp = (x / t) / y;
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	t_1 = (x / y) / t
	t_2 = -x / (z * t)
	tmp = 0
	if t <= -2.1e-23:
		tmp = 1.0 / (y * (t / x))
	elif t <= 5.3e-121:
		tmp = (-x / z) / y
	elif t <= 1.5e+88:
		tmp = t_1
	elif t <= 1.1e+112:
		tmp = t_2
	elif t <= 7.2e+149:
		tmp = t_1
	elif t <= 1.22e+243:
		tmp = t_2
	else:
		tmp = (x / t) / y
	return tmp
y, t = sort([y, t])
function code(x, y, z, t)
	t_1 = Float64(Float64(x / y) / t)
	t_2 = Float64(Float64(-x) / Float64(z * t))
	tmp = 0.0
	if (t <= -2.1e-23)
		tmp = Float64(1.0 / Float64(y * Float64(t / x)));
	elseif (t <= 5.3e-121)
		tmp = Float64(Float64(Float64(-x) / z) / y);
	elseif (t <= 1.5e+88)
		tmp = t_1;
	elseif (t <= 1.1e+112)
		tmp = t_2;
	elseif (t <= 7.2e+149)
		tmp = t_1;
	elseif (t <= 1.22e+243)
		tmp = t_2;
	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)
	t_1 = (x / y) / t;
	t_2 = -x / (z * t);
	tmp = 0.0;
	if (t <= -2.1e-23)
		tmp = 1.0 / (y * (t / x));
	elseif (t <= 5.3e-121)
		tmp = (-x / z) / y;
	elseif (t <= 1.5e+88)
		tmp = t_1;
	elseif (t <= 1.1e+112)
		tmp = t_2;
	elseif (t <= 7.2e+149)
		tmp = t_1;
	elseif (t <= 1.22e+243)
		tmp = t_2;
	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_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e-23], N[(1.0 / N[(y * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.3e-121], N[(N[((-x) / z), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.5e+88], t$95$1, If[LessEqual[t, 1.1e+112], t$95$2, If[LessEqual[t, 7.2e+149], t$95$1, If[LessEqual[t, 1.22e+243], t$95$2, N[(N[(x / t), $MachinePrecision] / y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
t_1 := \frac{\frac{x}{y}}{t}\\
t_2 := \frac{-x}{z \cdot t}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-23}:\\
\;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\

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

\mathbf{elif}\;t \leq 1.5 \cdot 10^{+88}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+112}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 7.2 \cdot 10^{+149}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 85.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot y}{x}}} \]
      2. inv-pow60.2%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot y}{x}\right)}^{-1}} \]
      3. associate-/l*61.8%

        \[\leadsto {\color{blue}{\left(\frac{t}{\frac{x}{y}}\right)}}^{-1} \]
    4. Applied egg-rr61.8%

      \[\leadsto \color{blue}{{\left(\frac{t}{\frac{x}{y}}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-161.8%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{x} \cdot y}} \]
    6. Simplified68.2%

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

    if -2.1000000000000001e-23 < t < 5.2999999999999996e-121

    1. Initial program 90.9%

      \[\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*65.0%

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

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

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

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

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

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

    if 5.2999999999999996e-121 < t < 1.50000000000000003e88 or 1.1e112 < t < 7.1999999999999999e149

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

    if 1.50000000000000003e88 < t < 1.1e112 or 7.1999999999999999e149 < t < 1.21999999999999993e243

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

    if 1.21999999999999993e243 < t

    1. Initial program 75.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\ \mathbf{elif}\;t \leq 5.3 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+112}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 1.22 \cdot 10^{+243}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]

Alternative 4: 82.0% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-35}:\\ \;\;\;\;\frac{\frac{-x}{t - z}}{z}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{-x}{z \cdot \left(y - 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 -4.8e-87)
   (/ (/ x (- t z)) y)
   (if (<= t 5.5e-121)
     (/ (/ (- x) z) (- y z))
     (if (<= t 4e-35)
       (/ (/ (- x) (- t z)) z)
       (if (<= t 1.8e-21) (/ (- x) (* z (- y z))) (/ (/ x t) (- y z)))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -4.8e-87) {
		tmp = (x / (t - z)) / y;
	} else if (t <= 5.5e-121) {
		tmp = (-x / z) / (y - z);
	} else if (t <= 4e-35) {
		tmp = (-x / (t - z)) / z;
	} else if (t <= 1.8e-21) {
		tmp = -x / (z * (y - 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 <= (-4.8d-87)) then
        tmp = (x / (t - z)) / y
    else if (t <= 5.5d-121) then
        tmp = (-x / z) / (y - z)
    else if (t <= 4d-35) then
        tmp = (-x / (t - z)) / z
    else if (t <= 1.8d-21) then
        tmp = -x / (z * (y - 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 <= -4.8e-87) {
		tmp = (x / (t - z)) / y;
	} else if (t <= 5.5e-121) {
		tmp = (-x / z) / (y - z);
	} else if (t <= 4e-35) {
		tmp = (-x / (t - z)) / z;
	} else if (t <= 1.8e-21) {
		tmp = -x / (z * (y - z));
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[y, t] = sort([y, t])
def code(x, y, z, t):
	tmp = 0
	if t <= -4.8e-87:
		tmp = (x / (t - z)) / y
	elif t <= 5.5e-121:
		tmp = (-x / z) / (y - z)
	elif t <= 4e-35:
		tmp = (-x / (t - z)) / z
	elif t <= 1.8e-21:
		tmp = -x / (z * (y - 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 <= -4.8e-87)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (t <= 5.5e-121)
		tmp = Float64(Float64(Float64(-x) / z) / Float64(y - z));
	elseif (t <= 4e-35)
		tmp = Float64(Float64(Float64(-x) / Float64(t - z)) / z);
	elseif (t <= 1.8e-21)
		tmp = Float64(Float64(-x) / Float64(z * Float64(y - 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 <= -4.8e-87)
		tmp = (x / (t - z)) / y;
	elseif (t <= 5.5e-121)
		tmp = (-x / z) / (y - z);
	elseif (t <= 4e-35)
		tmp = (-x / (t - z)) / z;
	elseif (t <= 1.8e-21)
		tmp = -x / (z * (y - 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, -4.8e-87], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 5.5e-121], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4e-35], N[(N[((-x) / N[(t - z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 1.8e-21], N[((-x) / N[(z * N[(y - 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 -4.8 \cdot 10^{-87}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -4.7999999999999999e-87

    1. Initial program 88.7%

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

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

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

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

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

    if -4.7999999999999999e-87 < t < 5.50000000000000031e-121

    1. Initial program 89.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{t - z}}{y - z}} \]
      2. *-un-lft-identity96.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. Taylor expanded in t around 0 85.8%

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

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

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

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

    if 5.50000000000000031e-121 < t < 4.00000000000000003e-35

    1. Initial program 94.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    6. Step-by-step derivation
      1. clear-num94.3%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{z \cdot \left(t - z\right)}} \]
      2. associate-/l/71.7%

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

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

        \[\leadsto \frac{\color{blue}{\frac{-x}{t - z}}}{z} \]
    10. Simplified71.7%

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

    if 4.00000000000000003e-35 < t < 1.79999999999999995e-21

    1. Initial program 100.0%

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

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

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

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

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

    if 1.79999999999999995e-21 < t

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-35}:\\ \;\;\;\;\frac{\frac{-x}{t - z}}{z}\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{-x}{z \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 5: 49.8% accurate, 0.6× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-201}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-103}:\\ \;\;\;\;\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 (<= y -4.2e+22)
   (/ (/ x y) t)
   (if (<= y -1.8e-22)
     (/ (- x) (* y z))
     (if (<= y -9e-201)
       (/ x (* y t))
       (if (<= y 6.8e-103) (/ (- x) (* z t)) (/ (/ x t) y))))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -4.2e+22) {
		tmp = (x / y) / t;
	} else if (y <= -1.8e-22) {
		tmp = -x / (y * z);
	} else if (y <= -9e-201) {
		tmp = x / (y * t);
	} else if (y <= 6.8e-103) {
		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 (y <= (-4.2d+22)) then
        tmp = (x / y) / t
    else if (y <= (-1.8d-22)) then
        tmp = -x / (y * z)
    else if (y <= (-9d-201)) then
        tmp = x / (y * t)
    else if (y <= 6.8d-103) 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 (y <= -4.2e+22) {
		tmp = (x / y) / t;
	} else if (y <= -1.8e-22) {
		tmp = -x / (y * z);
	} else if (y <= -9e-201) {
		tmp = x / (y * t);
	} else if (y <= 6.8e-103) {
		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 y <= -4.2e+22:
		tmp = (x / y) / t
	elif y <= -1.8e-22:
		tmp = -x / (y * z)
	elif y <= -9e-201:
		tmp = x / (y * t)
	elif y <= 6.8e-103:
		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 (y <= -4.2e+22)
		tmp = Float64(Float64(x / y) / t);
	elseif (y <= -1.8e-22)
		tmp = Float64(Float64(-x) / Float64(y * z));
	elseif (y <= -9e-201)
		tmp = Float64(x / Float64(y * t));
	elseif (y <= 6.8e-103)
		tmp = Float64(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 (y <= -4.2e+22)
		tmp = (x / y) / t;
	elseif (y <= -1.8e-22)
		tmp = -x / (y * z);
	elseif (y <= -9e-201)
		tmp = x / (y * t);
	elseif (y <= 6.8e-103)
		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[LessEqual[y, -4.2e+22], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, -1.8e-22], N[((-x) / N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9e-201], N[(x / N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-103], 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}\;y \leq -4.2 \cdot 10^{+22}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

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

\mathbf{elif}\;y \leq -9 \cdot 10^{-201}:\\
\;\;\;\;\frac{x}{y \cdot t}\\

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

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


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

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

    if -4.1999999999999996e22 < y < -1.7999999999999999e-22

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

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

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

    if -1.7999999999999999e-22 < y < -9.0000000000000004e-201

    1. Initial program 88.6%

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

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

    if -9.0000000000000004e-201 < y < 6.80000000000000006e-103

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

    if 6.80000000000000006e-103 < y

    1. Initial program 85.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq -1.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{-x}{y \cdot z}\\ \mathbf{elif}\;y \leq -9 \cdot 10^{-201}:\\ \;\;\;\;\frac{x}{y \cdot t}\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-103}:\\ \;\;\;\;\frac{-x}{z \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]

Alternative 6: 92.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8000000000000004e131

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000004e131 < z < 1.3000000000000001e32

    1. Initial program 95.4%

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

    if 1.3000000000000001e32 < z

    1. Initial program 74.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{y - z}}{\frac{t - z}{x}}} \]
    6. Step-by-step derivation
      1. clear-num99.7%

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

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

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

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

        \[\leadsto \color{blue}{-\frac{x}{z \cdot \left(t - z\right)}} \]
      2. associate-/l/90.9%

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

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

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

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

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

Alternative 7: 79.8% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-73}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-105}:\\ \;\;\;\;\frac{-x}{z \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 (<= y -2e-73)
   (/ (/ x (- t z)) y)
   (if (<= y 7.2e-105) (/ (- x) (* z (- t z))) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2e-73) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 7.2e-105) {
		tmp = -x / (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 (y <= (-2d-73)) then
        tmp = (x / (t - z)) / y
    else if (y <= 7.2d-105) then
        tmp = -x / (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 (y <= -2e-73) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 7.2e-105) {
		tmp = -x / (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 y <= -2e-73:
		tmp = (x / (t - z)) / y
	elif y <= 7.2e-105:
		tmp = -x / (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 (y <= -2e-73)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (y <= 7.2e-105)
		tmp = Float64(Float64(-x) / Float64(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 (y <= -2e-73)
		tmp = (x / (t - z)) / y;
	elseif (y <= 7.2e-105)
		tmp = -x / (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[y, -2e-73], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 7.2e-105], N[((-x) / N[(z * 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}\;y \leq -2 \cdot 10^{-73}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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

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


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

    1. Initial program 88.7%

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

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

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

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

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

    if -1.99999999999999999e-73 < y < 7.19999999999999929e-105

    1. Initial program 89.3%

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

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

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

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

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

    if 7.19999999999999929e-105 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

Alternative 8: 82.5% accurate, 0.7× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-22}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: y and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= t -2.05e-86)
   (/ (/ x (- t z)) y)
   (if (<= t 9.6e-22) (/ (/ (- x) z) (- y z)) (/ (/ x t) (- y z)))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -2.05e-86) {
		tmp = (x / (t - z)) / y;
	} else if (t <= 9.6e-22) {
		tmp = (-x / z) / (y - 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.05d-86)) then
        tmp = (x / (t - z)) / y
    else if (t <= 9.6d-22) then
        tmp = (-x / z) / (y - 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.05e-86) {
		tmp = (x / (t - z)) / y;
	} else if (t <= 9.6e-22) {
		tmp = (-x / z) / (y - 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.05e-86:
		tmp = (x / (t - z)) / y
	elif t <= 9.6e-22:
		tmp = (-x / z) / (y - 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.05e-86)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (t <= 9.6e-22)
		tmp = Float64(Float64(Float64(-x) / z) / Float64(y - 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.05e-86)
		tmp = (x / (t - z)) / y;
	elseif (t <= 9.6e-22)
		tmp = (-x / z) / (y - 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.05e-86], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 9.6e-22], N[(N[((-x) / z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, t] = \mathsf{sort}([y, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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

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


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

    1. Initial program 88.7%

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

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

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

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

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

    if -2.0499999999999999e-86 < t < 9.60000000000000009e-22

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

    if 9.60000000000000009e-22 < t

    1. Initial program 84.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.05 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;t \leq 9.6 \cdot 10^{-22}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y - z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]

Alternative 9: 66.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 85.9%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot y}{x}}} \]
      2. inv-pow60.2%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot y}{x}\right)}^{-1}} \]
      3. associate-/l*61.8%

        \[\leadsto {\color{blue}{\left(\frac{t}{\frac{x}{y}}\right)}}^{-1} \]
    4. Applied egg-rr61.8%

      \[\leadsto \color{blue}{{\left(\frac{t}{\frac{x}{y}}\right)}^{-1}} \]
    5. Step-by-step derivation
      1. unpow-161.8%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{x} \cdot y}} \]
    6. Simplified68.2%

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

    if -4.80000000000000005e-22 < t < 5.50000000000000031e-121

    1. Initial program 90.9%

      \[\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*65.0%

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

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

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

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

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

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

    if 5.50000000000000031e-121 < t

    1. Initial program 86.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{-22}:\\ \;\;\;\;\frac{1}{y \cdot \frac{t}{x}}\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{-x}{z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - z\right) \cdot t}\\ \end{array} \]

Alternative 10: 50.3% accurate, 0.9× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.8 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-104}:\\ \;\;\;\;\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 (<= y -2.8e-200)
   (/ (/ x y) t)
   (if (<= y 2.1e-104) (/ (- x) (* z t)) (/ (/ x t) y))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -2.8e-200) {
		tmp = (x / y) / t;
	} else if (y <= 2.1e-104) {
		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 (y <= (-2.8d-200)) then
        tmp = (x / y) / t
    else if (y <= 2.1d-104) 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 (y <= -2.8e-200) {
		tmp = (x / y) / t;
	} else if (y <= 2.1e-104) {
		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 y <= -2.8e-200:
		tmp = (x / y) / t
	elif y <= 2.1e-104:
		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 (y <= -2.8e-200)
		tmp = Float64(Float64(x / y) / t);
	elseif (y <= 2.1e-104)
		tmp = Float64(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 (y <= -2.8e-200)
		tmp = (x / y) / t;
	elseif (y <= 2.1e-104)
		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[LessEqual[y, -2.8e-200], N[(N[(x / y), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 2.1e-104], 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}\;y \leq -2.8 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{x}{y}}{t}\\

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

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


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

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

    if -2.80000000000000007e-200 < y < 2.09999999999999999e-104

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

    if 2.09999999999999999e-104 < y

    1. Initial program 85.8%

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

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

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

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

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

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

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

Alternative 11: 46.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000002e53 or 9.4999999999999996e73 < z

    1. Initial program 77.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y} \]
    8. Step-by-step derivation
      1. expm1-log1p-u50.8%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)} - 1} \]
      3. associate-/l/58.5%

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

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

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

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

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

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

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

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

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

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

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

    if -4.5000000000000002e53 < z < 9.4999999999999996e73

    1. Initial program 94.0%

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

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

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

Alternative 12: 48.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8000000000000004e53 or 9.50000000000000059e88 < z

    1. Initial program 78.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-x}{z}}}{y} \]
    8. Step-by-step derivation
      1. expm1-log1p-u52.4%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\frac{-x}{z}}{y}\right)} - 1} \]
      3. associate-/l/60.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{z \cdot y}} \]
    11. Simplified37.9%

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

    if -5.8000000000000004e53 < z < 9.50000000000000059e88

    1. Initial program 93.0%

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

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

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

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

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

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

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

Alternative 13: 70.9% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 3.7 \cdot 10^{-94}:\\ \;\;\;\;\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 3.7e-94) (/ 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 <= 3.7e-94) {
		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 <= 3.7d-94) 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 <= 3.7e-94) {
		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 <= 3.7e-94:
		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 <= 3.7e-94)
		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 <= 3.7e-94)
		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, 3.7e-94], 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 3.7 \cdot 10^{-94}:\\
\;\;\;\;\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 < 3.6999999999999998e-94

    1. Initial program 88.9%

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

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

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

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

    if 3.6999999999999998e-94 < t

    1. Initial program 86.3%

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

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

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

Alternative 14: 71.9% accurate, 1.0× speedup?

\[\begin{array}{l} [y, t] = \mathsf{sort}([y, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 4.8 \cdot 10^{-94}:\\ \;\;\;\;\frac{x}{y \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 4.8e-94) (/ x (* y (- t z))) (/ (/ x t) (- y z))))
assert(y < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 4.8e-94) {
		tmp = x / (y * (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 <= 4.8d-94) then
        tmp = x / (y * (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 <= 4.8e-94) {
		tmp = x / (y * (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 <= 4.8e-94:
		tmp = x / (y * (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 <= 4.8e-94)
		tmp = Float64(x / Float64(y * 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 <= 4.8e-94)
		tmp = x / (y * (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, 4.8e-94], N[(x / N[(y * 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 4.8 \cdot 10^{-94}:\\
\;\;\;\;\frac{x}{y \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 < 4.8e-94

    1. Initial program 88.9%

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

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

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

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

    if 4.8e-94 < t

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

Alternative 15: 73.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 88.9%

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

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

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

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

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

    if 5.49999999999999989e-94 < t

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

Alternative 16: 39.2% 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 88.0%

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

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

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

Developer target: 87.7% 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 2023298 
(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))))