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

Percentage Accurate: 88.4% → 97.0%
Time: 13.1s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 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.4% 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.0% accurate, 1.0× speedup?

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
  4. Add Preprocessing
  5. Final simplification96.9%

    \[\leadsto \frac{\frac{x}{t - z}}{y - z} \]
  6. Add Preprocessing

Alternative 2: 82.3% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-106}:\\
\;\;\;\;t\_1 \cdot \frac{-1}{z}\\

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


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

    1. Initial program 90.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv99.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    10. Step-by-step derivation
      1. div-inv90.4%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{y}}{t - z}} \]
    12. Step-by-step derivation
      1. *-commutative86.9%

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

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

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

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

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

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

    if -3.45e21 < y < -3.3e-35

    1. Initial program 92.0%

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

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

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

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

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

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

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

    if -3.3e-35 < y < -2.5000000000000001e-59

    1. Initial program 99.7%

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

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

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

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

    if -2.5000000000000001e-59 < y < 7.20000000000000025e-106

    1. Initial program 90.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/95.9%

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

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

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

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

    if 7.20000000000000025e-106 < y

    1. Initial program 84.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.45 \cdot 10^{+21}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-35}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-59}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot y}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-106}:\\ \;\;\;\;\frac{x}{t - z} \cdot \frac{-1}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.7% accurate, 0.3× speedup?

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.3e15

    1. Initial program 87.6%

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

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

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

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

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

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

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

    if -2.3e15 < z < -1.9999999999999999e-302 or 2.9e-170 < z < 4.99999999999999986e-29

    1. Initial program 93.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/92.5%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{t - z}}{y - z}} \]
      2. clear-num91.6%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    10. Step-by-step derivation
      1. div-inv69.1%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-302 < z < 2.9e-170

    1. Initial program 93.4%

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

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

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

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

    if 4.99999999999999986e-29 < z

    1. Initial program 81.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-302}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-170}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \mathbf{elif}\;z \leq 5 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 51.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+74} \lor \neg \left(t \leq 3.5 \cdot 10^{+134}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{y}\\

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


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

    1. Initial program 86.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/94.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    9. Simplified56.8%

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

    if -3.6000000000000001e-108 < t < 9.49999999999999934e-180

    1. Initial program 88.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/98.7%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv98.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\color{blue}{z \cdot y}} \]
    12. Simplified47.3%

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

    if 9.49999999999999934e-180 < t < 2.49999999999999982e74 or 3.50000000000000003e134 < t

    1. Initial program 93.1%

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

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

        \[\leadsto \color{blue}{\frac{-x}{-t \cdot y}} \]
      2. add-cube-cbrt52.2%

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

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

        \[\leadsto \color{blue}{\sqrt[3]{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      5. sqr-neg47.4%

        \[\leadsto \sqrt[3]{\color{blue}{x \cdot x}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      6. cbrt-unprod52.2%

        \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      7. pow252.2%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x}\right)}^{2}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      8. add-sqr-sqrt25.4%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}}{-t \cdot y} \]
      9. sqrt-unprod36.7%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}}{-t \cdot y} \]
      10. sqr-neg36.7%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\sqrt{\color{blue}{x \cdot x}}}}{-t \cdot y} \]
      11. sqrt-unprod13.5%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-t \cdot y} \]
      12. add-sqr-sqrt26.0%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{x}}}{-t \cdot y} \]
      13. distribute-rgt-neg-in26.0%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{x}}{\color{blue}{t \cdot \left(-y\right)}} \]
    5. Applied egg-rr26.0%

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

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)}} \]
      2. unpow226.0%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)} \]
      3. rem-3cbrt-lft26.0%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \left(-y\right)} \]
    7. Simplified26.0%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{t}}{-y}} \cdot x \]
      4. add-sqr-sqrt12.5%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot x \]
      5. sqrt-unprod34.6%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot x \]
      6. sqr-neg34.6%

        \[\leadsto \frac{\frac{1}{t}}{\sqrt{\color{blue}{y \cdot y}}} \cdot x \]
      7. sqrt-unprod29.0%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x \]
      8. add-sqr-sqrt52.4%

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

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

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

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

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

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

    if 2.49999999999999982e74 < t < 3.50000000000000003e134

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{-108}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{elif}\;t \leq 9.5 \cdot 10^{-180}:\\ \;\;\;\;\frac{x}{y \cdot \left(-z\right)}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+74} \lor \neg \left(t \leq 3.5 \cdot 10^{+134}\right):\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 93.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -6.5e109 < z < 8.0000000000000003e138

    1. Initial program 92.6%

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

    if 8.0000000000000003e138 < z

    1. Initial program 73.6%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+109}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - y}\\ \mathbf{elif}\;z \leq 8 \cdot 10^{+138}:\\ \;\;\;\;\frac{x}{\left(t - z\right) \cdot \left(y - z\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 93.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -8e104 < z < 2.3000000000000001e151

    1. Initial program 92.8%

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

    if 2.3000000000000001e151 < z

    1. Initial program 70.8%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.8%

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

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

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

      \[\leadsto \frac{x}{t - z} \cdot \color{blue}{\frac{-1}{z}} \]
    6. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{-1}{z} \cdot \frac{x}{t - z}} \]
      2. clear-num99.8%

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

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

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

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

Alternative 7: 73.6% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5e14 or 1.5000000000000001e-33 < z

    1. Initial program 84.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

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

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

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

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

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

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

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

    if -1.5e14 < z < 1.5000000000000001e-33

    1. Initial program 93.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+14} \lor \neg \left(z \leq 1.5 \cdot 10^{-33}\right):\\ \;\;\;\;\frac{x}{z \cdot \left(z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t \cdot \left(y - z\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.4% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 86.4%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/94.7%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num99.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/99.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    9. Simplified56.8%

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

    if -3.6000000000000001e-108 < t < 1.02e-179

    1. Initial program 88.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/98.7%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv98.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-x}{\color{blue}{z \cdot y}} \]
    12. Simplified47.3%

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

    if 1.02e-179 < t

    1. Initial program 91.0%

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

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

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

Alternative 9: 77.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.3%

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

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

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

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

    if -4.29999999999999989e-4 < y < 7.9999999999999996e-178

    1. Initial program 91.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.5%

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

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

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

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

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

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

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

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

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

    if 7.9999999999999996e-178 < y

    1. Initial program 85.0%

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

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

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

Alternative 10: 78.0% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.3%

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

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

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

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

    if -7.5000000000000002e-4 < y < 3.3999999999999998e-112

    1. Initial program 91.7%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.1%

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

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

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

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

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

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

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

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

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

    if 3.3999999999999998e-112 < y

    1. Initial program 83.8%

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

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

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

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

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

Alternative 11: 79.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 90.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv99.9%

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

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

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

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

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

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

    if -4.6000000000000001e-4 < y < 7e-106

    1. Initial program 91.1%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.2%

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

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

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

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

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

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

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

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

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

    if 7e-106 < y

    1. Initial program 84.2%

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

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

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

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

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

Alternative 12: 82.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -170000000000:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -170000000000.0)
   (/ (/ x y) (- t z))
   (if (<= y 2.75e-107) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -170000000000.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.75e-107) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, 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 <= (-170000000000.0d0)) then
        tmp = (x / y) / (t - z)
    else if (y <= 2.75d-107) then
        tmp = (x / z) / (z - t)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -170000000000.0) {
		tmp = (x / y) / (t - z);
	} else if (y <= 2.75e-107) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -170000000000.0:
		tmp = (x / y) / (t - z)
	elif y <= 2.75e-107:
		tmp = (x / z) / (z - t)
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -170000000000.0)
		tmp = Float64(Float64(x / y) / Float64(t - z));
	elseif (y <= 2.75e-107)
		tmp = Float64(Float64(x / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -170000000000.0)
		tmp = (x / y) / (t - z);
	elseif (y <= 2.75e-107)
		tmp = (x / z) / (z - t);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -170000000000.0], N[(N[(x / y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.75e-107], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -170000000000:\\
\;\;\;\;\frac{\frac{x}{y}}{t - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.7e11

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv99.9%

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

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

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

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

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

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

    if -1.7e11 < y < 2.74999999999999993e-107

    1. Initial program 90.5%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 2.74999999999999993e-107 < y

    1. Initial program 84.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -170000000000:\\ \;\;\;\;\frac{\frac{x}{y}}{t - z}\\ \mathbf{elif}\;y \leq 2.75 \cdot 10^{-107}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 82.0% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -118000000000:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (if (<= y -118000000000.0)
   (/ (/ x (- t z)) y)
   (if (<= y 4.7e-110) (/ (/ x z) (- z t)) (/ (/ x t) (- y z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -118000000000.0) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 4.7e-110) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
NOTE: x, y, z, 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 <= (-118000000000.0d0)) then
        tmp = (x / (t - z)) / y
    else if (y <= 4.7d-110) then
        tmp = (x / z) / (z - t)
    else
        tmp = (x / t) / (y - z)
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -118000000000.0) {
		tmp = (x / (t - z)) / y;
	} else if (y <= 4.7e-110) {
		tmp = (x / z) / (z - t);
	} else {
		tmp = (x / t) / (y - z);
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= -118000000000.0:
		tmp = (x / (t - z)) / y
	elif y <= 4.7e-110:
		tmp = (x / z) / (z - t)
	else:
		tmp = (x / t) / (y - z)
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -118000000000.0)
		tmp = Float64(Float64(x / Float64(t - z)) / y);
	elseif (y <= 4.7e-110)
		tmp = Float64(Float64(x / z) / Float64(z - t));
	else
		tmp = Float64(Float64(x / t) / Float64(y - z));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -118000000000.0)
		tmp = (x / (t - z)) / y;
	elseif (y <= 4.7e-110)
		tmp = (x / z) / (z - t);
	else
		tmp = (x / t) / (y - z);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := If[LessEqual[y, -118000000000.0], N[(N[(x / N[(t - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 4.7e-110], N[(N[(x / z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -118000000000:\\
\;\;\;\;\frac{\frac{x}{t - z}}{y}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.18e11

    1. Initial program 91.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.9%

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

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

      \[\leadsto \color{blue}{\frac{x}{t - z} \cdot \frac{1}{y - z}} \]
    5. Step-by-step derivation
      1. un-div-inv99.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t - z}} \]
    10. Step-by-step derivation
      1. div-inv89.2%

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

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

      \[\leadsto \color{blue}{x \cdot \frac{\frac{1}{y}}{t - z}} \]
    12. Step-by-step derivation
      1. *-commutative85.9%

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

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

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

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

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

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

    if -1.18e11 < y < 4.69999999999999992e-110

    1. Initial program 90.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 4.69999999999999992e-110 < y

    1. Initial program 84.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -118000000000:\\ \;\;\;\;\frac{\frac{x}{t - z}}{y}\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{x}{z}}{z - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 51.8% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 92.3%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/99.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/97.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{t}} \]
    9. Simplified55.7%

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

    if -2.24999999999999979e-87 < y < 4e-165

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

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

    if 4e-165 < y

    1. Initial program 85.1%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. frac-2neg43.6%

        \[\leadsto \color{blue}{\frac{-x}{-t \cdot y}} \]
      2. add-cube-cbrt43.5%

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

        \[\leadsto \color{blue}{\left(\sqrt[3]{-x} \cdot \sqrt[3]{-x}\right) \cdot \frac{\sqrt[3]{-x}}{-t \cdot y}} \]
      4. cbrt-unprod46.6%

        \[\leadsto \color{blue}{\sqrt[3]{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      5. sqr-neg46.6%

        \[\leadsto \sqrt[3]{\color{blue}{x \cdot x}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      6. cbrt-unprod43.5%

        \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      7. pow243.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x}\right)}^{2}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      8. add-sqr-sqrt22.1%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}}{-t \cdot y} \]
      9. sqrt-unprod40.6%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}}{-t \cdot y} \]
      10. sqr-neg40.6%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\sqrt{\color{blue}{x \cdot x}}}}{-t \cdot y} \]
      11. sqrt-unprod13.6%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-t \cdot y} \]
      12. add-sqr-sqrt26.6%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{x}}}{-t \cdot y} \]
      13. distribute-rgt-neg-in26.6%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{x}}{\color{blue}{t \cdot \left(-y\right)}} \]
    5. Applied egg-rr26.6%

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

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)}} \]
      2. unpow226.6%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)} \]
      3. rem-3cbrt-lft26.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{t}}{-y}} \cdot x \]
      4. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot x \]
      5. sqrt-unprod44.0%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot x \]
      6. sqr-neg44.0%

        \[\leadsto \frac{\frac{1}{t}}{\sqrt{\color{blue}{y \cdot y}}} \cdot x \]
      7. sqrt-unprod44.4%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x \]
      8. add-sqr-sqrt44.5%

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

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

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

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

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

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

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

Alternative 15: 44.9% accurate, 0.9× speedup?

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

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


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

    1. Initial program 87.9%

      \[\frac{x}{\left(y - z\right) \cdot \left(t - z\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/l/96.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y - z} \cdot \frac{1}{t - z}} \]
      4. clear-num97.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{y - z}{x}}} \cdot \frac{1}{t - z} \]
      5. associate-*l/97.8%

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

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

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

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

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

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

    if 3.9999999999999996e-96 < t

    1. Initial program 90.1%

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

      \[\leadsto \color{blue}{\frac{x}{t \cdot y}} \]
    4. Step-by-step derivation
      1. frac-2neg45.9%

        \[\leadsto \color{blue}{\frac{-x}{-t \cdot y}} \]
      2. add-cube-cbrt45.7%

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

        \[\leadsto \color{blue}{\left(\sqrt[3]{-x} \cdot \sqrt[3]{-x}\right) \cdot \frac{\sqrt[3]{-x}}{-t \cdot y}} \]
      4. cbrt-unprod41.8%

        \[\leadsto \color{blue}{\sqrt[3]{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      5. sqr-neg41.8%

        \[\leadsto \sqrt[3]{\color{blue}{x \cdot x}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      6. cbrt-unprod45.7%

        \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      7. pow245.7%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x}\right)}^{2}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
      8. add-sqr-sqrt19.2%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}}{-t \cdot y} \]
      9. sqrt-unprod31.8%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}}{-t \cdot y} \]
      10. sqr-neg31.8%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\sqrt{\color{blue}{x \cdot x}}}}{-t \cdot y} \]
      11. sqrt-unprod14.1%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-t \cdot y} \]
      12. add-sqr-sqrt25.8%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{x}}}{-t \cdot y} \]
      13. distribute-rgt-neg-in25.8%

        \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{x}}{\color{blue}{t \cdot \left(-y\right)}} \]
    5. Applied egg-rr25.8%

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

        \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)}} \]
      2. unpow225.8%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)} \]
      3. rem-3cbrt-lft25.8%

        \[\leadsto \frac{\color{blue}{x}}{t \cdot \left(-y\right)} \]
    7. Simplified25.8%

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{t}}{-y}} \cdot x \]
      4. add-sqr-sqrt13.2%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot x \]
      5. sqrt-unprod29.3%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot x \]
      6. sqr-neg29.3%

        \[\leadsto \frac{\frac{1}{t}}{\sqrt{\color{blue}{y \cdot y}}} \cdot x \]
      7. sqrt-unprod22.5%

        \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x \]
      8. add-sqr-sqrt45.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4 \cdot 10^{-96}:\\ \;\;\;\;\frac{\frac{x}{y}}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 39.7% accurate, 1.8× speedup?

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

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

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

    \[\leadsto \frac{x}{t \cdot y} \]
  5. Add Preprocessing

Alternative 17: 43.1% accurate, 1.8× speedup?

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

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

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

      \[\leadsto \color{blue}{\frac{-x}{-t \cdot y}} \]
    2. add-cube-cbrt38.3%

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{-x} \cdot \sqrt[3]{-x}\right) \cdot \frac{\sqrt[3]{-x}}{-t \cdot y}} \]
    4. cbrt-unprod41.7%

      \[\leadsto \color{blue}{\sqrt[3]{\left(-x\right) \cdot \left(-x\right)}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
    5. sqr-neg41.7%

      \[\leadsto \sqrt[3]{\color{blue}{x \cdot x}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
    6. cbrt-unprod38.3%

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
    7. pow238.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x}\right)}^{2}} \cdot \frac{\sqrt[3]{-x}}{-t \cdot y} \]
    8. add-sqr-sqrt18.8%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}}}{-t \cdot y} \]
    9. sqrt-unprod34.9%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}}}{-t \cdot y} \]
    10. sqr-neg34.9%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\sqrt{\color{blue}{x \cdot x}}}}{-t \cdot y} \]
    11. sqrt-unprod10.9%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\sqrt{x} \cdot \sqrt{x}}}}{-t \cdot y} \]
    12. add-sqr-sqrt21.1%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{x}}}{-t \cdot y} \]
    13. distribute-rgt-neg-in21.1%

      \[\leadsto {\left(\sqrt[3]{x}\right)}^{2} \cdot \frac{\sqrt[3]{x}}{\color{blue}{t \cdot \left(-y\right)}} \]
  5. Applied egg-rr21.1%

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

      \[\leadsto \color{blue}{\frac{{\left(\sqrt[3]{x}\right)}^{2} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)}} \]
    2. unpow221.1%

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)} \cdot \sqrt[3]{x}}{t \cdot \left(-y\right)} \]
    3. rem-3cbrt-lft21.1%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{t}}{-y}} \cdot x \]
    4. add-sqr-sqrt10.2%

      \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}} \cdot x \]
    5. sqrt-unprod31.9%

      \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}} \cdot x \]
    6. sqr-neg31.9%

      \[\leadsto \frac{\frac{1}{t}}{\sqrt{\color{blue}{y \cdot y}}} \cdot x \]
    7. sqrt-unprod20.7%

      \[\leadsto \frac{\frac{1}{t}}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \cdot x \]
    8. add-sqr-sqrt38.8%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{t}}{y}} \]
  12. Final simplification45.6%

    \[\leadsto \frac{\frac{x}{t}}{y} \]
  13. Add Preprocessing

Developer target: 87.6% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{t\_1}\\


\end{array}
\end{array}

Reproduce

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

  :alt
  (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))))